Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: include/llvm/CodeGen/JumpInstrTables.h

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/llvm/CodeGen/ISDOpcodes.h ('k') | include/llvm/CodeGen/LinkAllCodegenComponents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/CodeGen/JumpInstrTables.h
diff --git a/include/llvm/CodeGen/JumpInstrTables.h b/include/llvm/CodeGen/JumpInstrTables.h
index 005bc1eb2b2dea640c3fce609897ba5af8cdcbe4..3fee83a112a7043f9d77fbcec412c2a23c2fddb9 100644
--- a/include/llvm/CodeGen/JumpInstrTables.h
+++ b/include/llvm/CodeGen/JumpInstrTables.h
@@ -14,6 +14,7 @@
#define LLVM_CODEGEN_JUMPINSTRTABLES_H
#include "llvm/ADT/DenseMap.h"
+#include "llvm/IR/LegacyPassManagers.h"
#include "llvm/Pass.h"
#include "llvm/Target/TargetOptions.h"
@@ -58,6 +59,27 @@ public:
const char *getPassName() const override { return "Jump-Instruction Tables"; }
void getAnalysisUsage(AnalysisUsage &AU) const override;
+ // @LOCALMOD-BEGIN
+ // If there is not a ModulePassManager in the pass manager stack, do not
+ // schedule this pass. pnacl-llc uses only a FunctionPassManager but for
+ // some reason it will happily schedule any module passes that are handed to
+ // it and call them with bogus arguments. We could move this mod up into
+ // ModulePass::assignPassManager except that the JIT also uses a FPM and
+ // schedules a DebugInfoVerifier (which we do not use). That is still
+ // probably wrong but DebugInfoVerifier seems to accidentally work anyway for
+ // that case.
+ // All of this should be fixed upstream, except that the pass manager is being
+ // completely rewritten. So for now this is a noninvasive solution.
+ void assignPassManager(PMStack &PMS, PassManagerType PreferredType) override {
+
+ if (std::none_of(PMS.begin(), PMS.end(), [](PMDataManager *PM) {
+ return PM->getPassManagerType() == PMT_ModulePassManager;})) {
+ return;
+ }
+ ModulePass::assignPassManager(PMS, PreferredType);
+ }
+ // @LOCALMOD-END
+
/// Creates a jump-instruction table function for the Target and adds it to
/// the tables.
Function *insertEntry(Module &M, Function *Target);
« no previous file with comments | « include/llvm/CodeGen/ISDOpcodes.h ('k') | include/llvm/CodeGen/LinkAllCodegenComponents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698