From 69e6ab58e10d2a4fba257c7bb59ea1df3c136910 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 12 Aug 2014 15:32:46 -0400 Subject: Port to LLVM/Clang SVN r215430 (release_35) Use std::error_code instead of llvm::error_code. Use std::unique_ptr instead of llvm::OwningPtr. Use llvm_map_components_to_libnames instead of llvm_map_components_to_libraries. --- README.rst | 2 +- src/CMakeLists.txt | 2 +- src/RunClang.cxx | 12 ++++++------ src/castxml.cxx | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 339f72c..135d201 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,7 @@ To build CastXML from source, first obtain the prerequisites: * `LLVM/Clang`_ compiler SDK install tree built using the C++ compiler. This version of CastXML has been tested with LLVM/Clang SVN revision - ``210479``. + ``215430`` on the ``release_35`` branch. * Optionally, the `Sphinx`_ documentation generator to build documentation. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0771859..71014d2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,7 +43,7 @@ set(clang_libs clangBasic ) -llvm_map_components_to_libraries(llvm_libs +llvm_map_components_to_libnames(llvm_libs native option bitreader diff --git a/src/RunClang.cxx b/src/RunClang.cxx index c6d9c58..224c804 100644 --- a/src/RunClang.cxx +++ b/src/RunClang.cxx @@ -37,12 +37,12 @@ #include "clang/Lex/Preprocessor.h" #include "clang/Sema/Sema.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/Option/ArgList.h" #include "llvm/Support/Host.h" #include "llvm/Support/raw_ostream.h" #include +#include //---------------------------------------------------------------------------- class ASTConsumer: public clang::ASTConsumer @@ -227,7 +227,7 @@ static bool runClangCI(clang::CompilerInstance* CI, Options const& opts) // Construct our Clang front-end action. This dispatches // handling of each input file with an action based on the // flags provided (e.g. -E to preprocess-only). - llvm::OwningPtr + std::unique_ptr action(CreateFrontendAction(CI, opts)); if(action) { return CI->ExecuteAction(*action); @@ -244,10 +244,10 @@ runClangCreateDiagnostics(const char* const* argBeg, const char* const* argEnd) diagOpts(new clang::DiagnosticOptions); llvm::IntrusiveRefCntPtr diagID(new clang::DiagnosticIDs()); - llvm::OwningPtr + std::unique_ptr opts(clang::driver::createDriverOptTable()); unsigned missingArgIndex, missingArgCount; - llvm::OwningPtr + std::unique_ptr args(opts->ParseArgs(argBeg, argEnd, missingArgIndex, missingArgCount)); clang::ParseDiagnosticArgs(*diagOpts, *args); clang::TextDiagnosticPrinter* diagClient = @@ -287,7 +287,7 @@ static int runClangImpl(const char* const* argBeg, } // Ask the driver to build the compiler commands for us. - llvm::OwningPtr c(d.BuildCompilation(cArgs)); + std::unique_ptr c(d.BuildCompilation(cArgs)); // For '-###' just print the jobs and exit early. if(c->getArgs().hasArg(clang::driver::options::OPT__HASH_HASH_HASH)) { @@ -309,7 +309,7 @@ static int runClangImpl(const char* const* argBeg, clang::driver::Command* cmd = llvm::dyn_cast(*i); if(cmd && strcmp(cmd->getCreator().getName(), "clang") == 0) { // Invoke Clang with this set of arguments. - llvm::OwningPtr + std::unique_ptr CI(new clang::CompilerInstance()); const char* const* cmdArgBeg = cmd->getArguments().data(); const char* const* cmdArgEnd = cmdArgBeg + cmd->getArguments().size(); diff --git a/src/castxml.cxx b/src/castxml.cxx index a53c8fe..bf78f30 100644 --- a/src/castxml.cxx +++ b/src/castxml.cxx @@ -25,10 +25,10 @@ #include "llvm/Support/Process.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/Support/system_error.h" #include #include +#include #include #include @@ -52,7 +52,7 @@ int main(int argc_in, const char** argv_in) llvm::SmallVector argv; llvm::SpecificBumpPtrAllocator argAlloc; - if(llvm::error_code e = + if(std::error_code e = llvm::sys::Process::GetArgumentVector( argv, llvm::ArrayRef(argv_in, argc_in), argAlloc)) { llvm::errs() << "error: could not get arguments: " << e.message() << "\n"; -- cgit v0.12