mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-01 02:33:44 +00:00
Remove llvm.dbg.global_variables also.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66471 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3cfe6a4bc2
commit
d07128c906
@ -392,6 +392,16 @@ bool StripDebugDeclare::runOnModule(Module &M) {
|
||||
}
|
||||
Declare->eraseFromParent();
|
||||
|
||||
// Delete all llvm.dbg.global_variables.
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
|
||||
I != E; ++I) {
|
||||
GlobalVariable *GV = dyn_cast<GlobalVariable>(I);
|
||||
if (!GV) continue;
|
||||
if (GV->use_empty() && GV->hasName()
|
||||
&& strncmp(GV->getNameStart(), "llvm.dbg.global_variable", 24) == 0)
|
||||
DeadConstants.push_back(GV);
|
||||
}
|
||||
|
||||
while (!DeadConstants.empty()) {
|
||||
Constant *C = DeadConstants.back();
|
||||
DeadConstants.pop_back();
|
||||
|
Loading…
x
Reference in New Issue
Block a user