File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -457,7 +457,7 @@ class TargetPassConfig : public ImmutablePass {
457
457
458
458
// / Add a CodeGen pass at this point in the pipeline after checking overrides.
459
459
// / Return the pass that was added, or zero if no pass was added.
460
- AnalysisID addPass (AnalysisID PassID);
460
+ AnalysisID addPass (IdentifyingPassPtr PassID);
461
461
462
462
// / Add a pass to the PassManager if that pass is supposed to be run, as
463
463
// / determined by the StartAfter and StopAfter options. Takes ownership of the
Original file line number Diff line number Diff line change @@ -745,7 +745,9 @@ void TargetPassConfig::addPass(Pass *P) {
745
745
// /
746
746
// / addPass cannot return a pointer to the pass instance because is internal the
747
747
// / PassManager and the instance we create here may already be freed.
748
- AnalysisID TargetPassConfig::addPass (AnalysisID PassID) {
748
+ AnalysisID TargetPassConfig::addPass (IdentifyingPassPtr PassPtr) {
749
+ AnalysisID PassID = PassPtr.isInstance () ? PassPtr.getInstance ()->getPassID ()
750
+ : PassPtr.getID ();
749
751
IdentifyingPassPtr TargetID = getPassSubstitution (PassID);
750
752
IdentifyingPassPtr FinalPtr = overridePass (PassID, TargetID);
751
753
if (!FinalPtr.isValid ())
@@ -1513,8 +1515,7 @@ void TargetPassConfig::addMachineLateOptimization() {
1513
1515
// Cleanup of redundant immediate/address loads.
1514
1516
addPass (&MachineLateInstrsCleanupID);
1515
1517
1516
- // Branch folding must be run after regalloc and prolog/epilog insertion.
1517
- addPass (createBranchFolderPass (getEnableTailMerge ()));
1518
+ addPass (IdentifyingPassPtr (createBranchFolderPass (getEnableTailMerge ())));
1518
1519
1519
1520
// Tail duplication.
1520
1521
// Note that duplicating tail just increases code size and degrades
You can’t perform that action at this time.
0 commit comments