diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-12-04 07:26:48 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-12-04 07:26:48 +0000 |
commit | 9f9e0d2ecd4b9dd7ceeb57f662f6d8f549adca63 (patch) | |
tree | 77cd976a0d7364378d27b41205cbc8340feadb8f /tools/libclang/CXCompilationDatabase.cpp | |
parent | 7e96bfb4d507700a122f270a11ce3fc0e8e36c85 (diff) |
[libclang] Avoid copying the CompileCommand related strings when wrapping them to a CXString.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CXCompilationDatabase.cpp')
-rw-r--r-- | tools/libclang/CXCompilationDatabase.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/libclang/CXCompilationDatabase.cpp b/tools/libclang/CXCompilationDatabase.cpp index 8567d318a2..7216307a96 100644 --- a/tools/libclang/CXCompilationDatabase.cpp +++ b/tools/libclang/CXCompilationDatabase.cpp @@ -110,7 +110,7 @@ clang_CompileCommand_getDirectory(CXCompileCommand CCmd) 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 @@ clang_CompileCommand_getArg(CXCompileCommand CCmd, unsigned Arg) if (Arg >= Cmd->CommandLine.size()) return createCXString((const char*)NULL); - return createCXString(Cmd->CommandLine[Arg]); + return createCXString(Cmd->CommandLine[Arg].c_str(), /*DupString=*/false); } |