We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d063024 commit 0fe55a5Copy full SHA for 0fe55a5
llvm/lib/Target/DirectX/DXILFinalizeLinkage.cpp
@@ -29,16 +29,12 @@ static bool finalizeLinkage(Module &M) {
29
}
30
31
// Remove unused global variables.
32
- SmallVector<GlobalVariable *> ToErase;
33
- for (GlobalVariable &GV : M.globals()) {
+ for (GlobalVariable &GV : make_early_inc_range(M.globals())) {
34
if (GV.use_empty()) {
35
- ToErase.push_back(&GV);
+ GV.eraseFromParent();
+ MadeChange = true;
36
37
38
- for (GlobalVariable *GV : ToErase) {
39
- GV->eraseFromParent();
40
- MadeChange = true;
41
- }
42
43
SmallVector<Function *> Funcs;
44
0 commit comments