summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/llvmAsmParser.y
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-11-05 09:21:28 +0000
committerNate Begeman <natebegeman@mac.com>2005-11-05 09:21:28 +0000
commit848622f87f00b81bdfef2aed8c26f80e38217713 (patch)
treecef0c6b2b461e20d131912b80cd6b21e5f895520 /llvm/lib/AsmParser/llvmAsmParser.y
parent75fe59c4ead311d292bec997ff6a08c00e644b6d (diff)
downloadbcm5719-llvm-848622f87f00b81bdfef2aed8c26f80e38217713.tar.gz
bcm5719-llvm-848622f87f00b81bdfef2aed8c26f80e38217713.zip
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. llvm-svn: 24196
Diffstat (limited to 'llvm/lib/AsmParser/llvmAsmParser.y')
-rw-r--r--llvm/lib/AsmParser/llvmAsmParser.y18
1 files changed, 17 insertions, 1 deletions
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y
index c0b7d63c138..c5589782937 100644
--- a/llvm/lib/AsmParser/llvmAsmParser.y
+++ b/llvm/lib/AsmParser/llvmAsmParser.y
@@ -953,7 +953,7 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) {
%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 @@ MemoryInst : MALLOC Types {
$$ = 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 " +
OpenPOWER on IntegriCloud