mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
eraseIfNoUse: check if WeakVH is dead
This commit is contained in:
@@ -217,9 +217,10 @@ protected:
|
||||
};
|
||||
|
||||
static void eraseIfNoUse(const WeakVH &V) {
|
||||
if (Instruction *I = dyn_cast_or_null<Instruction>(&*V))
|
||||
if (I->use_begin() == I->use_end())
|
||||
eraseFromParent(I);
|
||||
if (V != nullptr)
|
||||
if (Instruction *I = dyn_cast_or_null<Instruction>(&*V))
|
||||
if (I->use_begin() == I->use_end())
|
||||
eraseFromParent(I);
|
||||
}
|
||||
|
||||
static SwitchInst *getNextSwitch(SwitchInst::CaseHandle Case) {
|
||||
|
||||
Reference in New Issue
Block a user