diff options
author | Brad King <brad.king@kitware.com> | 2014-08-12 19:32:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-08-12 19:43:29 (GMT) |
commit | 69e6ab58e10d2a4fba257c7bb59ea1df3c136910 (patch) | |
tree | f751720e30952664a39697b458829c88c9ee83f3 | |
parent | 698099dc3e026ea2f307e8f2ed04afea1657b9cd (diff) | |
download | CastXML-69e6ab58e10d2a4fba257c7bb59ea1df3c136910.zip CastXML-69e6ab58e10d2a4fba257c7bb59ea1df3c136910.tar.gz CastXML-69e6ab58e10d2a4fba257c7bb59ea1df3c136910.tar.bz2 |
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.
-rw-r--r-- | README.rst | 2 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/RunClang.cxx | 12 | ||||
-rw-r--r-- | src/castxml.cxx | 4 |
4 files changed, 10 insertions, 10 deletions
@@ -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 <iostream> +#include <memory> //---------------------------------------------------------------------------- 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<clang::FrontendAction> + std::unique_ptr<clang::FrontendAction> 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<clang::DiagnosticIDs> diagID(new clang::DiagnosticIDs()); - llvm::OwningPtr<llvm::opt::OptTable> + std::unique_ptr<llvm::opt::OptTable> opts(clang::driver::createDriverOptTable()); unsigned missingArgIndex, missingArgCount; - llvm::OwningPtr<llvm::opt::InputArgList> + std::unique_ptr<llvm::opt::InputArgList> 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<clang::driver::Compilation> c(d.BuildCompilation(cArgs)); + std::unique_ptr<clang::driver::Compilation> 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<clang::driver::Command>(*i); if(cmd && strcmp(cmd->getCreator().getName(), "clang") == 0) { // Invoke Clang with this set of arguments. - llvm::OwningPtr<clang::CompilerInstance> + std::unique_ptr<clang::CompilerInstance> 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 <iostream> #include <set> +#include <system_error> #include <vector> #include <string.h> @@ -52,7 +52,7 @@ int main(int argc_in, const char** argv_in) llvm::SmallVector<const char*, 64> argv; llvm::SpecificBumpPtrAllocator<char> argAlloc; - if(llvm::error_code e = + if(std::error_code e = llvm::sys::Process::GetArgumentVector( argv, llvm::ArrayRef<const char*>(argv_in, argc_in), argAlloc)) { llvm::errs() << "error: could not get arguments: " << e.message() << "\n"; |