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 | 6a33de18a3ea4c3869b7164ab996d5cd163ee098 (patch) | |
tree | 11a6c42f6ca0495f246e32b820ee7de17e7191be /clang | |
parent | 251ad5e06b2002ae8e0a0c1b2c03f89356fb55f5 (diff) | |
download | bcm5719-llvm-6a33de18a3ea4c3869b7164ab996d5cd163ee098.tar.gz bcm5719-llvm-6a33de18a3ea4c3869b7164ab996d5cd163ee098.zip |
[libclang] Avoid copying the CompileCommand related strings when wrapping them to a CXString.
llvm-svn: 169227
Diffstat (limited to 'clang')
-rw-r--r-- | clang/tools/libclang/CXCompilationDatabase.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/tools/libclang/CXCompilationDatabase.cpp b/clang/tools/libclang/CXCompilationDatabase.cpp index 8567d318a27..7216307a96a 100644 --- a/clang/tools/libclang/CXCompilationDatabase.cpp +++ b/clang/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); } |