summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-10-13 20:46:56 +0000
committerDale Johannesen <dalej@apple.com>2009-10-13 20:46:56 +0000
commitfd04c74bc0f83966f26d9f62a98f3ea9eaa83fd1 (patch)
tree5a5cdfca6d0b6331faf2c236ff2d8bb5e9613bea /llvm/lib/AsmParser/LLParser.cpp
parent41e170eb54a1a40554372c37a54f7918a2416067 (diff)
downloadbcm5719-llvm-fd04c74bc0f83966f26d9f62a98f3ea9eaa83fd1.tar.gz
bcm5719-llvm-fd04c74bc0f83966f26d9f62a98f3ea9eaa83fd1.zip
Add an "msasm" flag to inline asm as suggested in PR 5125.
A little ugliness is accepted to keep the binary file format compatible. No functional change yet. llvm-svn: 84020
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index a1186ac9c7b..09bc5f736fc 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -1959,16 +1959,17 @@ bool LLParser::ParseValID(ValID &ID) {
return false;
case lltok::kw_asm: {
- // ValID ::= 'asm' SideEffect? STRINGCONSTANT ',' STRINGCONSTANT
- bool HasSideEffect;
+ // ValID ::= 'asm' SideEffect? MsAsm? STRINGCONSTANT ',' STRINGCONSTANT
+ bool HasSideEffect, MsAsm;
Lex.Lex();
if (ParseOptionalToken(lltok::kw_sideeffect, HasSideEffect) ||
+ ParseOptionalToken(lltok::kw_msasm, MsAsm) ||
ParseStringConstant(ID.StrVal) ||
ParseToken(lltok::comma, "expected comma in inline asm expression") ||
ParseToken(lltok::StringConstant, "expected constraint string"))
return true;
ID.StrVal2 = Lex.getStrVal();
- ID.UIntVal = HasSideEffect;
+ ID.UIntVal = HasSideEffect | ((unsigned)MsAsm<<1);
ID.Kind = ValID::t_InlineAsm;
return false;
}
@@ -2368,7 +2369,7 @@ bool LLParser::ConvertValIDToValue(const Type *Ty, ValID &ID, Value *&V,
PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
if (!FTy || !InlineAsm::Verify(FTy, ID.StrVal2))
return Error(ID.Loc, "invalid type for inline asm constraint string");
- V = InlineAsm::get(FTy, ID.StrVal, ID.StrVal2, ID.UIntVal);
+ V = InlineAsm::get(FTy, ID.StrVal, ID.StrVal2, ID.UIntVal&1, ID.UIntVal>>1);
return false;
} else if (ID.Kind == ValID::t_Metadata) {
V = ID.MetadataVal;
OpenPOWER on IntegriCloud