Skip to content

Commit 5c3a0fa

Browse files
[GlobalISel] IRTranslator: Use RAIIMFObsDelInstaller (#102379)
Similar to #102156. runOnMachineFunction() installs the Observer correctly manually. finishPendingPhis() doesn't install into the MF, but this currently can't cause issues because DILocationVerifier doesn't care about changed instructions. Switch to RAIIMFObsDelInstaller in both places for consistency.
1 parent adb4cfe commit 5c3a0fa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3339,7 +3339,7 @@ void IRTranslator::finishPendingPhis() {
33393339
#ifndef NDEBUG
33403340
DILocationVerifier Verifier;
33413341
GISelObserverWrapper WrapperObserver(&Verifier);
3342-
RAIIDelegateInstaller DelInstall(*MF, &WrapperObserver);
3342+
RAIIMFObsDelInstaller ObsInstall(*MF, WrapperObserver);
33433343
#endif // ifndef NDEBUG
33443344
for (auto &Phi : PendingPHIs) {
33453345
const PHINode *PI = Phi.first;
@@ -3966,8 +3966,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
39663966
DILocationVerifier Verifier;
39673967
WrapperObserver.addObserver(&Verifier);
39683968
#endif // ifndef NDEBUG
3969-
RAIIDelegateInstaller DelInstall(*MF, &WrapperObserver);
3970-
RAIIMFObserverInstaller ObsInstall(*MF, WrapperObserver);
3969+
RAIIMFObsDelInstaller ObsInstall(*MF, WrapperObserver);
39713970
for (const BasicBlock *BB : RPOT) {
39723971
MachineBasicBlock &MBB = getMBB(*BB);
39733972
// Set the insertion point of all the following translations to

0 commit comments

Comments
 (0)