[cfe-commits] r166510 - /cfe/trunk/examples/clang-interpreter/main.cpp

Douglas Gregor dgregor at apple.com
Tue Oct 23 15:36:49 PDT 2012


Author: dgregor
Date: Tue Oct 23 17:36:49 2012
New Revision: 166510

URL: http://llvm.org/viewvc/llvm-project?rev=166510&view=rev
Log:
Update clang-interpreter example

Modified:
    cfe/trunk/examples/clang-interpreter/main.cpp

Modified: cfe/trunk/examples/clang-interpreter/main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/clang-interpreter/main.cpp?rev=166510&r1=166509&r2=166510&view=diff
==============================================================================
--- cfe/trunk/examples/clang-interpreter/main.cpp (original)
+++ cfe/trunk/examples/clang-interpreter/main.cpp Tue Oct 23 17:36:49 2012
@@ -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 @@
 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");





More information about the cfe-commits mailing list