[cfe-commits] r90851 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Benjamin Kramer benny.kra at googlemail.com
Tue Dec 8 03:02:29 PST 2009


Author: d0k
Date: Tue Dec  8 05:02:29 2009
New Revision: 90851

URL: http://llvm.org/viewvc/llvm-project?rev=90851&view=rev
Log:
Use Path.makeAbsolute() and make a constant std::string a const char*.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=90851&r1=90850&r2=90851&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue Dec  8 05:02:29 2009
@@ -84,11 +84,7 @@
 
   // Get absolute path name.
   llvm::sys::Path AbsFileName(FileName);
-  if (!AbsFileName.isAbsolute()) {
-    llvm::sys::Path tmp = llvm::sys::Path::GetCurrentDirectory();
-    tmp.appendComponent(FileName);
-    AbsFileName = tmp;
-  }
+  AbsFileName.makeAbsolute();
 
   // See if thie compile unit is representing main source file. Each source
   // file has corresponding compile unit. There is only one main source
@@ -122,7 +118,7 @@
     LangTag = llvm::dwarf::DW_LANG_C89;
   }
 
-  std::string Producer =
+  const char *Producer =
 #ifdef CLANG_VENDOR
     CLANG_VENDOR
 #endif
@@ -139,7 +135,7 @@
   return Unit = DebugFactory.CreateCompileUnit(LangTag, 
                                                AbsFileName.getLast(),
                                                AbsFileName.getDirname(),
-                                               Producer.c_str(), isMain, 
+                                               Producer, isMain,
                                                isOptimized, Flags, RuntimeVers);
 }
 





More information about the cfe-commits mailing list