~ubuntu-branches/ubuntu/wily/clamav/wily-proposed

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/utils/llvm.grm

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Sebastian Andrzej Siewior, Andreas Cadhalpun, Scott Kitterman, Javier Fernández-Sanguino
  • Date: 2015-01-28 00:25:13 UTC
  • mfrom: (0.48.14 sid)
  • Revision ID: package-import@ubuntu.com-20150128002513-lil2oi74cooy4lzr
Tags: 0.98.6+dfsg-1
[ Sebastian Andrzej Siewior ]
* update "fix-ssize_t-size_t-off_t-printf-modifier", include of misc.h was
  missing but was pulled in via the systemd patch.
* Don't leak return codes from libmspack to clamav API. (Closes: #774686).

[ Andreas Cadhalpun ]
* Add patch to avoid emitting incremental progress messages when not
  outputting to a terminal. (Closes: #767350)
* Update lintian-overrides for unused-file-paragraph-in-dep5-copyright.
* clamav-base.postinst: always chown /var/log/clamav and /var/lib/clamav
  to clamav:clamav, not only on fresh installations. (Closes: #775400)
* Adapt the clamav-daemon and clamav-freshclam logrotate scripts,
  so that they correctly work under systemd.
* Move the PidFile variable from the clamd/freshclam configuration files
  to the init scripts. This makes the init scripts more robust against
  misconfiguration and avoids error messages with systemd. (Closes: #767353)
* debian/copyright: drop files from Files-Excluded only present in github
  tarballs
* Drop Workaround-a-bug-in-libc-on-Hurd.patch, because hurd got fixed.
  (see #752237)
* debian/rules: Remove useless --with-system-tommath --without-included-ltdl
  configure options.

[ Scott Kitterman ]
* Stop stripping llvm when repacking the tarball as the system llvm on some
  releases is too old to use
* New upstream bugfix release
  - Library shared object revisions.
  - Includes a patch from Sebastian Andrzej Siewior making ClamAV pid files
    compatible with systemd.
  - Fix a heap out of bounds condition with crafted Yoda's crypter files.
    This issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted mew packer files. This
    issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted upx packer files. This
    issue was discovered by Kevin Szkudlapski of Quarkslab.
  - Fix a heap out of bounds condition with crafted upack packer files. This
    issue was discovered by Sebastian Andrzej Siewior. CVE-2014-9328.
  - Compensate a crash due to incorrect compiler optimization when handling
    crafted petite packer files. This issue was discovered by Sebastian
    Andrzej Siewior.
* Update lintian override for embedded zlib to match new so version

[ Javier Fernández-Sanguino ]
* Updated Spanish Debconf template translation (Closes: #773563)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(*
 
2
 
 
3
polygen grammar for LLVM assembly language.
 
4
 
 
5
This file defines an LLVM assembly language grammar for polygen,
 
6
which is a tool for generating random text based on a grammar.
 
7
It is strictly syntax-based, and makes no attempt to generate
 
8
IR that is semantically valid. Most of the IR produced doesn't
 
9
pass the Verifier.
 
10
 
 
11
TODO: Metadata, in all its forms
 
12
 
 
13
*)
 
14
 
 
15
I ::=   "title:    LLVM assembly language\n"
 
16
      ^ "status:   experimental\n"
 
17
      ^ "audience: LLVM developers\n"
 
18
;
 
19
 
 
20
S ::= Module ;
 
21
 
 
22
(*
 
23
Define rules for non-keyword tokens. This is currently just a bunch
 
24
of hacks. They don't cover many valid forms of tokens, and they also
 
25
generate some invalid forms of tokens. The LLVM parser has custom
 
26
C++ code to lex these; custom C++ code for emitting them would be
 
27
convenient, but polygen doesn't support that.
 
28
*)
 
29
NonZeroDecimalDigit ::=     1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;
 
30
DecimalDigit        ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;
 
31
DecimalDigitSeq     ::= DecimalDigit [^ DecimalDigitSeq ];
 
32
HexDigit            ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
 
33
                      | a | b | c | d | e | f ;
 
34
HexDigitSeq         ::= HexDigit [^ HexDigitSeq ];
 
35
StringChar          ::= a | b | c | d | e | f | g | h | i | j | k | l | m
 
36
                      | n | o | p | q | r | s | t | u | v | w | x | y | z ;
 
37
StringConstantSeq   ::= StringChar [^ StringConstantSeq ];
 
38
StringConstant      ::= StringChar [^ StringConstantSeq ];
 
39
EUINT64VAL          ::= NonZeroDecimalDigit [^ DecimalDigitSeq ];
 
40
ESINT64VAL          ::= [ "-" ] ^ EUINT64VAL ;
 
41
EUAPINTVAL          ::= EUINT64VAL ;
 
42
ESAPINTVAL          ::= ESINT64VAL ;
 
43
LOCALVALID          ::= "%" ^ DecimalDigitSeq ;
 
44
GLOBALVALID         ::= "@" ^ DecimalDigitSeq ;
 
45
INTTYPE             ::= "i" ^ EUINT64VAL ;
 
46
GLOBALVAR           ::= "@" ^ StringConstant ;
 
47
LOCALVAR            ::= "%" ^ StringConstant ;
 
48
STRINGCONSTANT      ::= "\"" ^ StringConstant ^ "\"" ;
 
49
ATSTRINGCONSTANT    ::= "@" ^ STRINGCONSTANT ;
 
50
PCTSTRINGCONSTANT   ::= "%" ^ STRINGCONSTANT ;
 
51
LABELSTR            ::= StringConstant ;
 
52
FPVAL               ::= ESAPINTVAL ^ "." ^ EUAPINTVAL | "0x" ^ HexDigitSeq ;
 
53
 
 
54
(*
 
55
The rest of this file is derived directly from llvmAsmParser.y.
 
56
*)
 
57
 
 
58
ArithmeticOps ::= + OptNW add | fadd | OptNW sub | fsub | OptNW mul | fmul |
 
59
                  udiv | OptExact sdiv | fdiv | urem | srem | frem ;
 
60
LogicalOps    ::= shl | lshr | ashr | and | or | xor;
 
61
CastOps       ::= trunc | zext | sext | fptrunc | fpext | bitcast |
 
62
                  uitofp | sitofp | fptoui | fptosi | inttoptr | ptrtoint ;
 
63
 
 
64
IPredicates ::= eq | ne | slt | sgt | sle | sge | ult | ugt | ule | uge ;
 
65
 
 
66
FPredicates ::= oeq | one | olt | ogt | ole | oge | ord | uno | ueq | une
 
67
              | ult | ugt | ule | uge | true | false ;
 
68
 
 
69
IntType ::= INTTYPE;
 
70
FPType  ::= float | double | "ppc_fp128" | fp128 | "x86_fp80";
 
71
 
 
72
LocalName ::= LOCALVAR | STRINGCONSTANT | PCTSTRINGCONSTANT ;
 
73
OptLocalName ::= LocalName | _ ;
 
74
 
 
75
OptAddrSpace ::= - addrspace ^ "(" ^ EUINT64VAL ^ ")" | _ ;
 
76
 
 
77
OptLocalAssign ::= LocalName "=" | _ ;
 
78
 
 
79
GlobalName ::= GLOBALVAR | ATSTRINGCONSTANT ;
 
80
 
 
81
OptGlobalAssign ::= GlobalAssign | _ ;
 
82
 
 
83
GlobalAssign ::= GlobalName "=" ;
 
84
 
 
85
GVInternalLinkage
 
86
  ::= + internal
 
87
 | weak
 
88
 | "weak_odr"
 
89
 | linkonce
 
90
 | "linkonce_odr"
 
91
 | appending
 
92
 | dllexport
 
93
 | common
 
94
 | private
 
95
 | "linker_private"
 
96
 | "linker_private_weak"
 
97
 ;
 
98
 
 
99
GVExternalLinkage
 
100
  ::= dllimport
 
101
 | "extern_weak"
 
102
 | + external
 
103
 ;
 
104
 
 
105
GVVisibilityStyle
 
106
  ::= + _
 
107
 | default
 
108
 | hidden
 
109
 | protected
 
110
 ;
 
111
 
 
112
FunctionDeclareLinkage
 
113
  ::= + _
 
114
 | dllimport
 
115
 | "extern_weak"
 
116
 ;
 
117
 
 
118
FunctionDefineLinkage
 
119
  ::= + _
 
120
 | internal
 
121
 | linkonce
 
122
 | "linkonce_odr"
 
123
 | weak
 
124
 | "weak_odr"
 
125
 | dllexport
 
126
 ;
 
127
 
 
128
AliasLinkage ::= + _ | weak | "weak_odr" | internal ;
 
129
 
 
130
OptCallingConv ::= + _ |
 
131
                 ccc |
 
132
                 fastcc |
 
133
                 coldcc |
 
134
                 "x86_stdcallcc" |
 
135
                 "x86_fastcallcc" |
 
136
                 cc EUINT64VAL ;
 
137
 
 
138
ParamAttr ::= zeroext
 
139
 | signext
 
140
 | inreg
 
141
 | sret
 
142
 | noalias
 
143
 | nocapture
 
144
 | byval
 
145
 | nest
 
146
 | align EUINT64VAL
 
147
 ;
 
148
 
 
149
OptParamAttrs ::= + _ | OptParamAttrs ParamAttr ;
 
150
 
 
151
RetAttr       ::= inreg
 
152
              | zeroext
 
153
              | signext
 
154
              | noalias
 
155
              ;
 
156
 
 
157
OptRetAttrs  ::= _
 
158
             | OptRetAttrs RetAttr
 
159
             ;
 
160
 
 
161
FuncAttr      ::= noreturn
 
162
 | nounwind
 
163
 | inreg
 
164
 | zeroext
 
165
 | signext
 
166
 | readnone
 
167
 | readonly
 
168
 | inlinehint
 
169
 | alignstack
 
170
 | noinline
 
171
 | alwaysinline
 
172
 | optsize
 
173
 | ssp
 
174
 | sspreq
 
175
 ;
 
176
 
 
177
OptFuncAttrs  ::= + _ | OptFuncAttrs FuncAttr ;
 
178
 
 
179
OptGC         ::= + _ | gc STRINGCONSTANT ;
 
180
 
 
181
OptAlign      ::= + _ | align EUINT64VAL ;
 
182
OptCAlign     ::= + _ | ^ "," align EUINT64VAL ;
 
183
 
 
184
SectionString ::= section STRINGCONSTANT ;
 
185
 
 
186
OptSection    ::= + _ | SectionString ;
 
187
 
 
188
GlobalVarAttributes ::= + _ | ^ "," GlobalVarAttribute GlobalVarAttributes ;
 
189
GlobalVarAttribute  ::= SectionString | align EUINT64VAL ;
 
190
 
 
191
PrimType ::= INTTYPE | float | double | "ppc_fp128" | fp128 | "x86_fp80"
 
192
          | - label ;
 
193
 
 
194
Types
 
195
  ::= opaque
 
196
 | PrimType
 
197
 | Types OptAddrSpace ^ "*"
 
198
 | SymbolicValueRef
 
199
 | "\\" ^ EUINT64VAL
 
200
 | Types "(" ^ ArgTypeListI ^ ")" OptFuncAttrs
 
201
 | void "(" ^ ArgTypeListI ^ ")" OptFuncAttrs
 
202
 | "[" ^ EUINT64VAL "x" Types ^ "]"
 
203
 | "<" ^ EUINT64VAL "x" Types ^ ">"
 
204
 | "{" TypeListI "}"
 
205
 | "{" ^ "}"
 
206
 | "<" ^ "{" TypeListI "}" ^ ">"
 
207
 | "<" ^ "{" ^ "}" ^ ">"
 
208
 ;
 
209
 
 
210
ArgType ::= Types OptParamAttrs ;
 
211
 
 
212
ResultTypes ::= Types | void ;
 
213
 
 
214
ArgTypeList ::= ArgType | ArgTypeList ^ "," ArgType ;
 
215
 
 
216
ArgTypeListI ::= ArgTypeList | ArgTypeList ^ "," "..." | "..." | _ ;
 
217
 
 
218
TypeListI ::= Types | TypeListI ^ "," Types ;
 
219
 
 
220
ConstVal::= Types "[" ^ ConstVector ^ "]"
 
221
 | Types "[" ^ "]"
 
222
 | Types "c" ^ STRINGCONSTANT
 
223
 | Types "<" ^ ConstVector ^ ">"
 
224
 | Types "{" ConstVector "}"
 
225
 | Types "{" ^ "}"
 
226
 | Types "<" ^ "{" ConstVector "}" ^ ">"
 
227
 | Types "<" ^ "{" ^ "}" ^ ">"
 
228
 | Types null
 
229
 | Types undef
 
230
 | Types SymbolicValueRef
 
231
 | Types ConstExpr
 
232
 | Types zeroinitializer
 
233
 | Types ESINT64VAL
 
234
 | Types ESAPINTVAL
 
235
 | Types EUINT64VAL
 
236
 | Types EUAPINTVAL
 
237
 | Types true
 
238
 | Types false
 
239
 | Types FPVAL ;
 
240
 
 
241
ConstExpr::= CastOps "(" ^ ConstVal to Types ^ ")"
 
242
 | getelementptr OptInBounds "(" ^ ConstVal IndexList ^ ")"
 
243
 | select "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
 
244
 | ArithmeticOps "(" ^ ConstVal ^ "," ConstVal ^ ")"
 
245
 | LogicalOps "(" ^ ConstVal ^ "," ConstVal ^ ")"
 
246
 | icmp IPredicates "(" ^ ConstVal ^ "," ConstVal ^ ")"
 
247
 | fcmp FPredicates "(" ^ ConstVal ^ "," ConstVal ^ ")"
 
248
 | extractelement "(" ^ ConstVal ^ "," ConstVal ^ ")"
 
249
 | insertelement "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
 
250
 | shufflevector "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
 
251
 | extractvalue "(" ^ ConstVal ^ ConstantIndexList ^ ")"
 
252
 | insertvalue "(" ^ ConstVal ^ "," ConstVal ^ ConstantIndexList ^ ")" ;
 
253
 
 
254
ConstVector ::= ConstVector ^ "," ConstVal | ConstVal ;
 
255
 
 
256
GlobalType ::= global | constant ;
 
257
 
 
258
ThreadLocal ::= - "thread_local" | _ ;
 
259
 
 
260
AliaseeRef ::= ResultTypes SymbolicValueRef
 
261
 | bitcast "(" ^ AliaseeRef to Types ^ ")" ;
 
262
 
 
263
Module ::= +++ DefinitionList | --- _ ;
 
264
 
 
265
DefinitionList ::= - Definition | + DefinitionList Definition ;
 
266
 
 
267
Definition
 
268
  ::= ^ ( +++++ define Function
 
269
 | declare FunctionProto
 
270
 | - module asm AsmBlock
 
271
 | OptLocalAssign type Types
 
272
 | OptGlobalAssign GVVisibilityStyle ThreadLocal OptAddrSpace GlobalType
 
273
   ConstVal GlobalVarAttributes
 
274
 | OptGlobalAssign GVInternalLinkage GVVisibilityStyle ThreadLocal OptAddrSpace
 
275
   GlobalType ConstVal GlobalVarAttributes
 
276
 | OptGlobalAssign GVExternalLinkage GVVisibilityStyle ThreadLocal OptAddrSpace
 
277
   GlobalType Types GlobalVarAttributes
 
278
 | OptGlobalAssign GVVisibilityStyle alias AliasLinkage AliaseeRef
 
279
 | target TargetDefinition
 
280
 | deplibs "=" LibrariesDefinition
 
281
 ) ^ "\n";
 
282
 
 
283
AsmBlock ::= STRINGCONSTANT ;
 
284
 
 
285
TargetDefinition ::= triple "=" STRINGCONSTANT
 
286
 | datalayout "=" STRINGCONSTANT ;
 
287
 
 
288
LibrariesDefinition ::= "[" ( LibList | _ ) "]";
 
289
 
 
290
LibList ::= LibList ^ "," STRINGCONSTANT | STRINGCONSTANT ;
 
291
 
 
292
ArgListH ::= ArgListH ^ "," Types OptParamAttrs OptLocalName
 
293
 | Types OptParamAttrs OptLocalName ;
 
294
 
 
295
ArgList ::= ArgListH | ArgListH ^ "," "..." | "..." | _ ;
 
296
 
 
297
FunctionHeaderH ::= OptCallingConv OptRetAttrs ResultTypes
 
298
                  GlobalName ^ "(" ^ ArgList ^ ")"
 
299
                  OptFuncAttrs OptSection OptAlign OptGC ;
 
300
 
 
301
BEGIN ::= ( begin | "{" ) ^ "\n";
 
302
 
 
303
FunctionHeader ::=
 
304
  FunctionDefineLinkage GVVisibilityStyle FunctionHeaderH BEGIN ;
 
305
 
 
306
END ::= ^ ( end | "}" ) ^ "\n";
 
307
 
 
308
Function ::= BasicBlockList END ;
 
309
 
 
310
FunctionProto ::= FunctionDeclareLinkage GVVisibilityStyle FunctionHeaderH ;
 
311
 
 
312
OptSideEffect ::= _ | sideeffect ;
 
313
 
 
314
ConstValueRef ::= ESINT64VAL
 
315
 | EUINT64VAL
 
316
 | FPVAL
 
317
 | true
 
318
 | false
 
319
 | null
 
320
 | undef
 
321
 | zeroinitializer
 
322
 | "<" ConstVector ">"
 
323
 | "[" ConstVector "]"
 
324
 | "[" ^ "]"
 
325
 | "c" ^ STRINGCONSTANT
 
326
 | "{" ConstVector "}"
 
327
 | "{" ^ "}"
 
328
 | "<" ^ "{" ConstVector "}" ^ ">"
 
329
 | "<" ^ "{" ^ "}" ^ ">"
 
330
 | ConstExpr
 
331
 | asm OptSideEffect STRINGCONSTANT ^ "," STRINGCONSTANT ;
 
332
 
 
333
SymbolicValueRef ::= LOCALVALID
 
334
 | GLOBALVALID
 
335
 | LocalName
 
336
 | GlobalName ;
 
337
 
 
338
ValueRef ::= SymbolicValueRef | ConstValueRef;
 
339
 
 
340
ResolvedVal ::= Types ValueRef ;
 
341
 
 
342
ReturnedVal ::= ResolvedVal | ReturnedVal ^ "," ResolvedVal ;
 
343
 
 
344
BasicBlockList ::= BasicBlockList BasicBlock | FunctionHeader BasicBlock ;
 
345
 
 
346
BasicBlock ::= InstructionList OptLocalAssign BBTerminatorInst ;
 
347
 
 
348
InstructionList ::= +++ InstructionList Inst
 
349
 | - _
 
350
 | ^ LABELSTR ^ ":\n" ;
 
351
 
 
352
BBTerminatorInst ::= ^ "  " ^
 
353
 ( ret ReturnedVal
 
354
 | ret void
 
355
 | br label ValueRef
 
356
 | br INTTYPE ValueRef ^ "," label ValueRef ^ "," label ValueRef
 
357
 | switch IntType ValueRef ^ "," label ValueRef "[" JumpTable "]"
 
358
 | switch IntType ValueRef ^ "," label ValueRef "[" ^ "]"
 
359
 | invoke OptCallingConv ResultTypes ValueRef ^ "(" ^ ParamList ^ ")"
 
360
   OptFuncAttrs
 
361
   to label ValueRef unwind label ValueRef
 
362
 | unwind
 
363
 | unreachable ) ^ "\n";
 
364
 
 
365
JumpTable ::= JumpTable IntType ConstValueRef ^ "," label ValueRef
 
366
 | IntType ConstValueRef ^ "," label ValueRef ;
 
367
 
 
368
Inst ::= ^ "  " ^ OptLocalAssign InstVal ^ "\n";
 
369
 
 
370
PHIList ::= Types "[" ValueRef ^ "," ValueRef "]"
 
371
 | PHIList ^ "," "[" ValueRef ^ "," ValueRef "]" ;
 
372
 
 
373
ParamList ::= Types OptParamAttrs ValueRef OptParamAttrs
 
374
 | label OptParamAttrs ValueRef OptParamAttrs
 
375
 | ParamList ^ "," Types OptParamAttrs ValueRef OptParamAttrs
 
376
 | ParamList ^ "," label OptParamAttrs ValueRef OptParamAttrs
 
377
 | - _ ;
 
378
 
 
379
IndexList ::= _ | IndexList ^ "," ResolvedVal ;
 
380
 
 
381
ConstantIndexList ::= "," EUINT64VAL | ConstantIndexList ^ "," EUINT64VAL ;
 
382
 
 
383
OptTailCall ::= tail call | call ;
 
384
 
 
385
InstVal ::=
 
386
   ArithmeticOps Types ValueRef ^ "," ValueRef
 
387
 | LogicalOps Types ValueRef ^ "," ValueRef
 
388
 | icmp IPredicates Types ValueRef ^ "," ValueRef
 
389
 | fcmp FPredicates Types ValueRef ^ "," ValueRef
 
390
 | CastOps ResolvedVal to Types
 
391
 | select ResolvedVal ^ "," ResolvedVal ^ "," ResolvedVal
 
392
 | "va_arg" ResolvedVal ^ "," Types
 
393
 | extractelement ResolvedVal ^ "," ResolvedVal
 
394
 | insertelement ResolvedVal ^ "," ResolvedVal ^ "," ResolvedVal
 
395
 | shufflevector ResolvedVal ^ "," ResolvedVal ^ "," ResolvedVal
 
396
 | phi PHIList
 
397
 | OptTailCall OptCallingConv ResultTypes ValueRef ^ "(" ^ ParamList ^ ")"
 
398
   OptFuncAttrs
 
399
 | MemoryInst ;
 
400
 
 
401
OptVolatile ::= - volatile | _ ;
 
402
OptExact ::= - exact | _ ;
 
403
OptNSW ::= - nsw | _ ;
 
404
OptNUW ::= - nuw | _ ;
 
405
OptNW  ::= OptNUW OptNSW | OptNSW OptNUW ;
 
406
OptInBounds  ::= - inbounds | _ ;
 
407
 
 
408
MemoryInst ::= malloc Types OptCAlign
 
409
 | malloc Types ^ "," INTTYPE ValueRef OptCAlign
 
410
 | alloca Types OptCAlign
 
411
 | alloca Types ^ "," INTTYPE ValueRef OptCAlign
 
412
 | free ResolvedVal
 
413
 | OptVolatile load Types ValueRef OptCAlign
 
414
 | OptVolatile store ResolvedVal ^ "," Types ValueRef OptCAlign
 
415
 | getresult Types ValueRef ^ "," EUINT64VAL
 
416
 | getelementptr OptInBounds Types ValueRef IndexList
 
417
 | extractvalue Types ValueRef ^ ConstantIndexList 
 
418
 | insertvalue Types ValueRef ^ "," Types ValueRef ^ ConstantIndexList ;