summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/BugDriver.h
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2015-11-26 19:23:49 +0000
committerHal Finkel <hfinkel@anl.gov>2015-11-26 19:23:49 +0000
commit28ad2b47dd109450ef910fdf477a2831f2f7947b (patch)
tree3c10f35ddf2e71d24afb1a2ee572502b47473ceb /llvm/tools/bugpoint/BugDriver.h
parent8934577171b967cc23186c2ffa0a0c4b54a8d992 (diff)
downloadbcm5719-llvm-28ad2b47dd109450ef910fdf477a2831f2f7947b.tar.gz
bcm5719-llvm-28ad2b47dd109450ef910fdf477a2831f2f7947b.zip
[bugpoint] Fix "Alias must point to a definition" problems
GlobalAliases may reference function definitions, but not function declarations. bugpoint would sometimes create invalid IR by deleting a function's body (thus mutating a function definition into a declaration) without first 'fixing' any GlobalAliases that reference that function definition. This change iteratively prevents that issue. Before deleting a function's body, it scans the module for GlobalAliases which reference that function. When found, it eliminates them using replaceAllUsesWith. Fixes PR20788. Patch by Nick Johnson! llvm-svn: 254171
Diffstat (limited to 'llvm/tools/bugpoint/BugDriver.h')
-rw-r--r--llvm/tools/bugpoint/BugDriver.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/tools/bugpoint/BugDriver.h b/llvm/tools/bugpoint/BugDriver.h
index 1bd2e80a630..45fcf74aa6b 100644
--- a/llvm/tools/bugpoint/BugDriver.h
+++ b/llvm/tools/bugpoint/BugDriver.h
@@ -321,6 +321,11 @@ void PrintFunctionList(const std::vector<Function*> &Funcs);
///
void PrintGlobalVariableList(const std::vector<GlobalVariable*> &GVs);
+// DeleteGlobalInitializer - "Remove" the global variable by deleting its
+// initializer, making it external.
+//
+void DeleteGlobalInitializer(GlobalVariable *GV);
+
// DeleteFunctionBody - "Remove" the function by deleting all of it's basic
// blocks, making it external.
//
OpenPOWER on IntegriCloud