summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-10 21:27:11 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-10 21:27:11 +0000
commitf32302a7d932ce32f489aa5bdbe0e1a6c2b48f42 (patch)
treedc545db566ba839d37844cc362449d3e8e93e91f /clang/lib/Sema/SemaStmt.cpp
parentdc009da2a8d34ab836927394f7d822bb1d5d8a14 (diff)
downloadbcm5719-llvm-f32302a7d932ce32f489aa5bdbe0e1a6c2b48f42.tar.gz
bcm5719-llvm-f32302a7d932ce32f489aa5bdbe0e1a6c2b48f42.zip
[ms-inline asm] PatchMSAsmString() doesn't correctly patch non-simple asm
statements. Therefore, we can't pass the PatchedAsmString to the AsmParser and expect things to work. llvm-svn: 161701
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r--clang/lib/Sema/SemaStmt.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index e72495fc7b0..347b34f78a3 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -2902,6 +2902,15 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
std::string PatchedAsmString =
PatchMSAsmString(*this, IsSimple, AsmLoc, AsmToks, Context.getTargetInfo());
+ // PatchMSAsmString doesn't correctly patch non-simple asm statements.
+ if (!IsSimple) {
+ MSAsmStmt *NS =
+ new (Context) MSAsmStmt(Context, AsmLoc, /* IsSimple */ true,
+ /* IsVolatile */ true, AsmToks, LineEnds,
+ AsmString, Clobbers, EndLoc);
+ return Owned(NS);
+ }
+
// Initialize targets and assembly printers/parsers.
llvm::InitializeAllTargetInfos();
llvm::InitializeAllTargetMCs();
OpenPOWER on IntegriCloud