]> granicus.if.org Git - clang/commitdiff
Use Path.makeAbsolute() and make a constant std::string a const char*.
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 8 Dec 2009 11:02:29 +0000 (11:02 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 8 Dec 2009 11:02:29 +0000 (11:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90851 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 56ee63f098c55573db7f1eaa6ea2e08aad11b032..197c145c67c4178bfd8091cac3024a2334152221 100644 (file)
@@ -84,11 +84,7 @@ llvm::DICompileUnit CGDebugInfo::getOrCreateCompileUnit(SourceLocation Loc) {
 
   // 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 @@ llvm::DICompileUnit CGDebugInfo::getOrCreateCompileUnit(SourceLocation Loc) {
     LangTag = llvm::dwarf::DW_LANG_C89;
   }
 
-  std::string Producer =
+  const char *Producer =
 #ifdef CLANG_VENDOR
     CLANG_VENDOR
 #endif
@@ -139,7 +135,7 @@ llvm::DICompileUnit CGDebugInfo::getOrCreateCompileUnit(SourceLocation Loc) {
   return Unit = DebugFactory.CreateCompileUnit(LangTag, 
                                                AbsFileName.getLast(),
                                                AbsFileName.getDirname(),
-                                               Producer.c_str(), isMain, 
+                                               Producer, isMain,
                                                isOptimized, Flags, RuntimeVers);
 }