diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-10-23 22:36:49 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-10-23 22:36:49 +0000 |
commit | 35d516cf1aa88a1af7b25c869984758750af3c1b (patch) | |
tree | 145f62dc5b67cc8abb6bffd5fd010a0da27596b6 /examples | |
parent | 8e023611637905629b928915cbda22a90b2432c3 (diff) |
Update clang-interpreter example
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r-- | examples/clang-interpreter/main.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/clang-interpreter/main.cpp b/examples/clang-interpreter/main.cpp index c39468a3fd..84e4c7137e 100644 --- a/examples/clang-interpreter/main.cpp +++ b/examples/clang-interpreter/main.cpp @@ -13,9 +13,9 @@ #include "clang/Driver/Tool.h" #include "clang/Frontend/CompilerInvocation.h" #include "clang/Frontend/CompilerInstance.h" -#include "clang/Frontend/DiagnosticOptions.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" @@ -69,11 +69,12 @@ static int Execute(llvm::Module *Mod, char * const *envp) { int main(int argc, const char **argv, char * const *envp) { void *MainAddr = (void*) (intptr_t) GetExecutablePath; llvm::sys::Path Path = GetExecutablePath(argv[0]); + IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions(); TextDiagnosticPrinter *DiagClient = - new TextDiagnosticPrinter(llvm::errs(), DiagnosticOptions()); + new TextDiagnosticPrinter(llvm::errs(), &*DiagOpts); IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs()); - DiagnosticsEngine Diags(DiagID, DiagClient); + DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagClient); Driver TheDriver(Path.str(), llvm::sys::getDefaultTargetTriple(), "a.out", /*IsProduction=*/false, Diags); TheDriver.setTitle("clang interpreter"); |