From c72c57c9e9b69944e3e009cd5e209634839581d3 Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 8 Apr 2013 18:45:10 +0000 Subject: Vendor import of clang trunk r178860: http://llvm.org/svn/llvm-project/cfe/trunk@178860 --- examples/clang-interpreter/main.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'examples/clang-interpreter/main.cpp') diff --git a/examples/clang-interpreter/main.cpp b/examples/clang-interpreter/main.cpp index 84e4c71..3d0d640 100644 --- a/examples/clang-interpreter/main.cpp +++ b/examples/clang-interpreter/main.cpp @@ -8,25 +8,24 @@ //===----------------------------------------------------------------------===// #include "clang/CodeGen/CodeGenAction.h" +#include "clang/Basic/DiagnosticOptions.h" #include "clang/Driver/Compilation.h" #include "clang/Driver/Driver.h" #include "clang/Driver/Tool.h" -#include "clang/Frontend/CompilerInvocation.h" #include "clang/Frontend/CompilerInstance.h" +#include "clang/Frontend/CompilerInvocation.h" #include "clang/Frontend/FrontendDiagnostic.h" #include "clang/Frontend/TextDiagnosticPrinter.h" -#include "clang/Basic/DiagnosticOptions.h" - -#include "llvm/Module.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallString.h" -#include "llvm/ExecutionEngine/JIT.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" -#include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/raw_ostream.h" +#include "llvm/ExecutionEngine/JIT.h" +#include "llvm/IR/Module.h" #include "llvm/Support/Host.h" +#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Path.h" #include "llvm/Support/TargetSelect.h" +#include "llvm/Support/raw_ostream.h" using namespace clang; using namespace clang::driver; @@ -75,14 +74,13 @@ int main(int argc, const char **argv, char * const *envp) { IntrusiveRefCntPtr DiagID(new DiagnosticIDs()); DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagClient); - Driver TheDriver(Path.str(), llvm::sys::getDefaultTargetTriple(), - "a.out", /*IsProduction=*/false, Diags); + Driver TheDriver(Path.str(), llvm::sys::getProcessTriple(), "a.out", Diags); TheDriver.setTitle("clang interpreter"); // FIXME: This is a hack to try to force the driver to do something we can // recognize. We need to extend the driver library to support this use model // (basically, exactly one input, and the operation mode is hard wired). - llvm::SmallVector Args(argv, argv + argc); + SmallVector Args(argv, argv + argc); Args.push_back("-fsyntax-only"); OwningPtr C(TheDriver.BuildCompilation(Args)); if (!C) @@ -130,7 +128,7 @@ int main(int argc, const char **argv, char * const *envp) { Clang.setInvocation(CI.take()); // Create the compilers actual diagnostics engine. - Clang.createDiagnostics(int(CCArgs.size()),const_cast(CCArgs.data())); + Clang.createDiagnostics(); if (!Clang.hasDiagnostics()) return 1; -- cgit v1.1