[llvm-commits] [llvm] r67555 - in /llvm/branches/Apple/Dib/utils/TableGen: AsmWriterEmitter.cpp TGLexer.cpp

Bill Wendling isanbard at gmail.com
Mon Mar 23 13:24:21 PDT 2009


Author: void
Date: Mon Mar 23 15:24:09 2009
New Revision: 67555

URL: http://llvm.org/viewvc/llvm-project?rev=67555&view=rev
Log:
--- Reverse-merging (from foreign repository) r66958 into '.':
U    utils/TableGen/AsmWriterEmitter.cpp
U    utils/TableGen/TGLexer.cpp

Revert r66958.

Modified:
    llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp
    llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp

Modified: llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp?rev=67555&r1=67554&r2=67555&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp Mon Mar 23 15:24:09 2009
@@ -130,20 +130,11 @@
 
     // Emit a constant string fragment.
     if (DollarPos != LastEmitted) {
-      if (CurVariant == Variant || CurVariant == ~0U) {
-        for (; LastEmitted != DollarPos; ++LastEmitted)
-          switch (AsmString[LastEmitted]) {
-          case '\n': AddLiteralString("\\n"); break;
-          case '\t': AddLiteralString("\\t"); break;
-          case '"': AddLiteralString("\\\""); break;
-          case '\\': AddLiteralString("\\\\"); break;
-          default:
-            AddLiteralString(std::string(1, AsmString[LastEmitted]));
-            break;
-          }
-      } else {
-        LastEmitted = DollarPos;
-      }
+      // TODO: this should eventually handle escaping.
+      if (CurVariant == Variant || CurVariant == ~0U)
+        AddLiteralString(std::string(AsmString.begin()+LastEmitted,
+                                     AsmString.begin()+DollarPos));
+      LastEmitted = DollarPos;
     } else if (AsmString[DollarPos] == '\\') {
       if (DollarPos+1 != AsmString.size() &&
           (CurVariant == Variant || CurVariant == ~0U)) {

Modified: llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp?rev=67555&r1=67554&r2=67555&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp (original)
+++ llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp Mon Mar 23 15:24:09 2009
@@ -174,11 +174,11 @@
       CurStrVal += *CurPtr++;
       break;
     case 't':
-      CurStrVal += '\t';
+      CurStrVal += "\\t";
       ++CurPtr;
       break;
     case 'n':
-      CurStrVal += '\n';
+      CurStrVal += "\\n";
       ++CurPtr;
       break;
         





More information about the llvm-commits mailing list