Remove some overzealous checks that were rejecting
valid comments in inline assembly.
gcc.target/i386/20011009-1.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57365 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 63ada0c..0185441 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1246,21 +1246,17 @@
break;
case '|':
++LastEmitted; // consume '|' character.
- if (CurVariant == -1) {
- cerr << "Found '|' character outside of variant in inline asm "
- << "string: '" << AsmStr << "'\n";
- exit(1);
- }
- ++CurVariant; // We're in the next variant.
+ if (CurVariant == -1)
+ O << '|'; // this is gcc's behavior for | outside a variant
+ else
+ ++CurVariant; // We're in the next variant.
break;
case ')': // $) -> same as GCC's } char.
++LastEmitted; // consume ')' character.
- if (CurVariant == -1) {
- cerr << "Found '}' character outside of variant in inline asm "
- << "string: '" << AsmStr << "'\n";
- exit(1);
- }
- CurVariant = -1;
+ if (CurVariant == -1)
+ O << '}'; // this is gcc's behavior for } outside a variant
+ else
+ CurVariant = -1;
break;
}
if (Done) break;