[PATCH] Clang side changes for fixing load order problems with PassRegistry
Zachary Turner
zturner at google.com
Mon Jun 2 17:48:45 PDT 2014
Hi chandlerc, dblaikie,
(As with the other change, I don't know who the correct reviewer is. Please re-assign if I've chosen incorrectly).
See http://reviews.llvm.org/D3996 for a more comprehensive description of this change.
This patch simply instantiates the PassRegistry in main for clang.
http://reviews.llvm.org/D3997
Files:
tools/driver/cc1_main.cpp
tools/driver/driver.cpp
Index: tools/driver/cc1_main.cpp
===================================================================
--- tools/driver/cc1_main.cpp
+++ tools/driver/cc1_main.cpp
@@ -75,6 +75,7 @@
llvm::InitializeAllAsmParsers();
#ifdef LINK_POLLY_INTO_TOOLS
+ PassRegistry::initializePassRegistry();
llvm::PassRegistry &Registry = *llvm::PassRegistry::getPassRegistry();
polly::initializePollyPasses(Registry);
#endif
Index: tools/driver/driver.cpp
===================================================================
--- tools/driver/driver.cpp
+++ tools/driver/driver.cpp
@@ -21,6 +21,7 @@
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "clang/Frontend/Utils.h"
+#include "llvm/PassRegistry.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
@@ -310,6 +311,8 @@
StringSetSaver Saver(SavedStrings);
llvm::cl::ExpandResponseFiles(Saver, llvm::cl::TokenizeGNUCommandLine, argv);
+ llvm::PassRegistry::initializePassRegistry();
+
// Handle -cc1 integrated tools.
if (argv.size() > 1 && StringRef(argv[1]).startswith("-cc1")) {
StringRef Tool = argv[1] + 4;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3997.10033.patch
Type: text/x-patch
Size: 1185 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140603/c0aa4755/attachment.bin>
More information about the cfe-commits
mailing list