diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-23 16:29:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-23 16:29:58 +0000 |
commit | 9bffb0701d02a10e77e1ac0f196074eed6466ed0 (patch) | |
tree | a9b3c3913b15036affbcaee8ee53e03bb9379dad /lib/AST/Stmt.cpp | |
parent | d57a38ee02c285d69d05fed6df0d7406b2517888 (diff) |
david conrad points out that {|} in inline assembly on arm are not asm
variants. This fixes neon inline asm which my patch for PR6780 broke.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102181 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r-- | lib/AST/Stmt.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 97023820e2..ee4a74a612 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -19,6 +19,7 @@ #include "clang/AST/Type.h" #include "clang/AST/ASTContext.h" #include "clang/AST/ASTDiagnostic.h" +#include "clang/Basic/TargetInfo.h" #include <cstdio> using namespace clang; @@ -240,6 +241,8 @@ unsigned AsmStmt::AnalyzeAsmString(llvm::SmallVectorImpl<AsmStringPiece>&Pieces, // asm string. std::string CurStringPiece; + bool HasVariants = !C.Target.hasNoAsmVariants(); + while (1) { // Done with the string? if (CurPtr == StrEnd) { @@ -251,9 +254,9 @@ unsigned AsmStmt::AnalyzeAsmString(llvm::SmallVectorImpl<AsmStringPiece>&Pieces, char CurChar = *CurPtr++; switch (CurChar) { case '$': CurStringPiece += "$$"; continue; - case '{': CurStringPiece += "$("; continue; - case '|': CurStringPiece += "$|"; continue; - case '}': CurStringPiece += "$)"; continue; + case '{': CurStringPiece += (HasVariants ? "$(" : "{"); continue; + case '|': CurStringPiece += (HasVariants ? "$|" : "|"); continue; + case '}': CurStringPiece += (HasVariants ? "$)" : "}"); continue; case '%': break; default: |