Cleanup in dbg_stoppoint handling in CBE. Patch by Sandeep Patel.
authorAnton Korobeynikov <asl@math.spbu.ru>
Wed, 5 Aug 2009 09:31:40 +0000 (09:31 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Wed, 5 Aug 2009 09:31:40 +0000 (09:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78182 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp

index 0feb87fd3395b6046ca3fc84ea52c75c9e1d7044..fffa2cbfe4345fd0be5266394d1c6f13b86b5e33 100644 (file)
@@ -3160,16 +3160,15 @@ bool CWriter::visitBuiltinCall(CallInst &I, Intrinsic::ID ID,
   case Intrinsic::dbg_stoppoint: {
     // If we use writeOperand directly we get a "u" suffix which is rejected
     // by gcc.
-    std::stringstream SPIStr;
     DbgStopPointInst &SPI = cast<DbgStopPointInst>(I);
-    SPI.getDirectory()->print(SPIStr);
+    std::string dir;
+    GetConstantStringInfo(SPI.getDirectory(), dir);
+    std::string file;
+    GetConstantStringInfo(SPI.getFileName(), file);
     Out << "\n#line "
         << SPI.getLine()
-        << " \"";
-    Out << SPIStr.str();
-    SPIStr.clear();
-    SPI.getFileName()->print(SPIStr);
-    Out << SPIStr.str() << "\"\n";
+        << " \""
+        << dir << '/' << file << "\"\n";
     return true;
   }
   case Intrinsic::x86_sse_cmp_ss: