Updated to Clang 3.5a.
Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
diff --git a/tools/libclang/CXCompilationDatabase.cpp b/tools/libclang/CXCompilationDatabase.cpp
index 433caec..f4728fe 100644
--- a/tools/libclang/CXCompilationDatabase.cpp
+++ b/tools/libclang/CXCompilationDatabase.cpp
@@ -8,7 +8,7 @@
extern "C" {
-// FIXME: do something more usefull with the error message
+// FIXME: do something more useful with the error message
CXCompilationDatabase
clang_CompilationDatabase_fromDirectory(const char *BuildDir,
CXCompilationDatabase_Error *ErrorCode)
@@ -40,9 +40,8 @@
{
std::vector<CompileCommand> CCmd;
- AllocatedCXCompileCommands(const std::vector<CompileCommand>& Cmd)
- : CCmd(Cmd)
- { }
+ AllocatedCXCompileCommands(std::vector<CompileCommand> Cmd)
+ : CCmd(std::move(Cmd)) {}
};
CXCompileCommands
@@ -50,10 +49,9 @@
const char *CompleteFileName)
{
if (CompilationDatabase *db = static_cast<CompilationDatabase *>(CDb)) {
- const std::vector<CompileCommand>
- CCmd(db->getCompileCommands(CompleteFileName));
+ std::vector<CompileCommand> CCmd(db->getCompileCommands(CompleteFileName));
if (!CCmd.empty())
- return new AllocatedCXCompileCommands( CCmd );
+ return new AllocatedCXCompileCommands(std::move(CCmd));
}
return 0;
@@ -62,9 +60,9 @@
CXCompileCommands
clang_CompilationDatabase_getAllCompileCommands(CXCompilationDatabase CDb) {
if (CompilationDatabase *db = static_cast<CompilationDatabase *>(CDb)) {
- const std::vector<CompileCommand> CCmd(db->getAllCompileCommands());
+ std::vector<CompileCommand> CCmd(db->getAllCompileCommands());
if (!CCmd.empty())
- return new AllocatedCXCompileCommands( CCmd );
+ return new AllocatedCXCompileCommands(std::move(CCmd));
}
return 0;