summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-12-04 07:26:48 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-12-04 07:26:48 +0000
commit6a33de18a3ea4c3869b7164ab996d5cd163ee098 (patch)
tree11a6c42f6ca0495f246e32b820ee7de17e7191be
parent251ad5e06b2002ae8e0a0c1b2c03f89356fb55f5 (diff)
downloadbcm5719-llvm-6a33de18a3ea4c3869b7164ab996d5cd163ee098.tar.gz
bcm5719-llvm-6a33de18a3ea4c3869b7164ab996d5cd163ee098.zip
[libclang] Avoid copying the CompileCommand related strings when wrapping them to a CXString.
llvm-svn: 169227
-rw-r--r--clang/tools/libclang/CXCompilationDatabase.cpp4
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);
}
OpenPOWER on IntegriCloud