diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-09-05 00:08:17 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-09-05 00:08:17 +0000 |
commit | f42fad625127e0ea33432daf89421e2bb86935cd (patch) | |
tree | f295f29c614eb855426a8c0cf106a19381336aac /llvm/lib/AsmParser/LLParser.cpp | |
parent | df476e5e936b5d16484bdbb5024a46de359a59aa (diff) | |
download | bcm5719-llvm-f42fad625127e0ea33432daf89421e2bb86935cd.tar.gz bcm5719-llvm-f42fad625127e0ea33432daf89421e2bb86935cd.zip |
[ms-inline asm] Emit the (new) inline asm Non-Standard Dialect attribute.
llvm-svn: 163181
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 271691b85cb..30c55960770 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -2069,16 +2069,18 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) { case lltok::kw_asm: { // ValID ::= 'asm' SideEffect? AlignStack? STRINGCONSTANT ',' STRINGCONSTANT - bool HasSideEffect, AlignStack; + bool HasSideEffect, AlignStack, NSDialect; Lex.Lex(); if (ParseOptionalToken(lltok::kw_sideeffect, HasSideEffect) || ParseOptionalToken(lltok::kw_alignstack, AlignStack) || + ParseOptionalToken(lltok::kw_nsdialect, NSDialect) || 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 = unsigned(HasSideEffect) | (unsigned(AlignStack)<<1); + ID.UIntVal = unsigned(HasSideEffect) | (unsigned(AlignStack)<<1) | + (unsigned(NSDialect)<<2); ID.Kind = ValID::t_InlineAsm; return false; } @@ -2495,7 +2497,8 @@ bool LLParser::ConvertValIDToValue(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&1, ID.UIntVal>>1); + V = InlineAsm::get(FTy, ID.StrVal, ID.StrVal2, ID.UIntVal&1, + (ID.UIntVal>>1)&1, (ID.UIntVal>>2)&1); return false; } case ValID::t_MDNode: |