[cfe-commits] r100449 - in /cfe/trunk: lib/AST/Stmt.cpp test/CodeGen/asm.c
Chris Lattner
sabre at nondot.org
Mon Apr 5 11:44:01 PDT 2010
Author: lattner
Date: Mon Apr 5 13:44:00 2010
New Revision: 100449
URL: http://llvm.org/viewvc/llvm-project?rev=100449&view=rev
Log:
fix PR6780, properly handling the IR {|} escapes in inline asm strings.
Modified:
cfe/trunk/lib/AST/Stmt.cpp
cfe/trunk/test/CodeGen/asm.c
Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=100449&r1=100448&r2=100449&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Mon Apr 5 13:44:00 2010
@@ -249,14 +249,18 @@
}
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).
Modified: cfe/trunk/test/CodeGen/asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/asm.c?rev=100449&r1=100448&r2=100449&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/asm.c (original)
+++ cfe/trunk/test/CodeGen/asm.c Mon Apr 5 13:44:00 2010
@@ -135,3 +135,15 @@
// CHECK-NEXT: extractvalue
// CHECK-NEXT: extractvalue
}
+
+
+// PR6780
+int t19(unsigned data) {
+ int a, b;
+
+ asm("x{abc|def|ghi}z" :"=r"(a): "r"(data));
+ return a + b;
+ // CHECK: t19(i32
+ // CHECK: = call {{.*}}asm "x$(abc$|def$|ghi$)z"
+}
+
More information about the cfe-commits
mailing list