[cfe-commits] r169227 - /cfe/trunk/tools/libclang/CXCompilationDatabase.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Mon Dec 3 23:26:48 PST 2012


Author: akirtzidis
Date: Tue Dec  4 01:26:48 2012
New Revision: 169227

URL: http://llvm.org/viewvc/llvm-project?rev=169227&view=rev
Log:
[libclang] Avoid copying the CompileCommand related strings when wrapping them to a CXString.

Modified:
    cfe/trunk/tools/libclang/CXCompilationDatabase.cpp

Modified: cfe/trunk/tools/libclang/CXCompilationDatabase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCompilationDatabase.cpp?rev=169227&r1=169226&r2=169227&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXCompilationDatabase.cpp (original)
+++ cfe/trunk/tools/libclang/CXCompilationDatabase.cpp Tue Dec  4 01:26:48 2012
@@ -110,7 +110,7 @@
     return createCXString((const char*)NULL);
 
   CompileCommand *cmd = static_cast<CompileCommand *>(CCmd);
-  return createCXString(cmd->Directory);
+  return createCXString(cmd->Directory.c_str(), /*DupString=*/false);
 }
 
 unsigned
@@ -133,7 +133,7 @@
   if (Arg >= Cmd->CommandLine.size())
     return createCXString((const char*)NULL);
 
-  return createCXString(Cmd->CommandLine[Arg]);
+  return createCXString(Cmd->CommandLine[Arg].c_str(), /*DupString=*/false);
 }
 
 





More information about the cfe-commits mailing list