diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-05 18:44:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-05 18:44:00 +0000 |
commit | 018b54e5c3d31dc03e2a874d58ae258651087296 (patch) | |
tree | 166c49aa9d9d314b4c8f1dea2e3e85d59e220333 /lib | |
parent | 8b96253907c47141af0b7b2a44a368748d006a87 (diff) |
fix PR6780, properly handling the IR {|} escapes in inline asm strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100449 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/Stmt.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 8347249a46..97023820e2 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -249,14 +249,18 @@ unsigned AsmStmt::AnalyzeAsmString(llvm::SmallVectorImpl<AsmStringPiece>&Pieces, } char CurChar = *CurPtr++; - if (CurChar == '$') { - CurStringPiece += "$$"; - continue; - } else if (CurChar != '%') { + switch (CurChar) { + case '$': CurStringPiece += "$$"; continue; + case '{': CurStringPiece += "$("; continue; + case '|': CurStringPiece += "$|"; continue; + case '}': CurStringPiece += "$)"; continue; + case '%': + break; + default: CurStringPiece += CurChar; continue; } - + // Escaped "%" character in asm string. if (CurPtr == StrEnd) { // % at end of string is invalid (no escape). |