Add support alignment of allocation instructions.
Add support for specifying alignment and size of setjmp jmpbufs.
No targets currently do anything with this information, nor is it presrved
in the bytecode representation. That's coming up next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24196 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index c0b7d63..c558978 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -953,7 +953,7 @@
%token IMPLEMENTATION ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK
%token DECLARE GLOBAL CONSTANT VOLATILE
%token TO DOTDOTDOT NULL_TOK UNDEF CONST INTERNAL LINKONCE WEAK APPENDING
-%token OPAQUE NOT EXTERNAL TARGET TRIPLE ENDIAN POINTERSIZE LITTLE BIG
+%token OPAQUE NOT EXTERNAL TARGET TRIPLE ENDIAN POINTERSIZE LITTLE BIG ALIGN
%token DEPLIBS CALL TAIL
%token CC_TOK CCC_TOK FASTCC_TOK COLDCC_TOK
%type <UIntVal> OptCallingConv
@@ -2208,18 +2208,34 @@
$$ = new MallocInst(*$2);
delete $2;
}
+ | MALLOC Types ',' ALIGN EUINT64VAL {
+ $$ = new MallocInst(*$2, 0, $5);
+ delete $2;
+ }
| MALLOC Types ',' UINT ValueRef {
$$ = new MallocInst(*$2, getVal($4, $5));
delete $2;
}
+ | MALLOC Types ',' UINT ValueRef ',' ALIGN EUINT64VAL {
+ $$ = new MallocInst(*$2, getVal($4, $5), $8);
+ delete $2;
+ }
| ALLOCA Types {
$$ = new AllocaInst(*$2);
delete $2;
}
+ | ALLOCA Types ',' ALIGN EUINT64VAL {
+ $$ = new AllocaInst(*$2, 0, $5);
+ delete $2;
+ }
| ALLOCA Types ',' UINT ValueRef {
$$ = new AllocaInst(*$2, getVal($4, $5));
delete $2;
}
+ | ALLOCA Types ',' UINT ValueRef ',' ALIGN EUINT64VAL {
+ $$ = new AllocaInst(*$2, getVal($4, $5), $8);
+ delete $2;
+ }
| FREE ResolvedVal {
if (!isa<PointerType>($2->getType()))
ThrowException("Trying to free nonpointer type " +