summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/bugpoint/CrashDebugger.cpp4
-rw-r--r--llvm/tools/verify-uselistorder/verify-uselistorder.cpp8
2 files changed, 10 insertions, 2 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp
index d494007665a..b161d88882a 100644
--- a/llvm/tools/bugpoint/CrashDebugger.cpp
+++ b/llvm/tools/bugpoint/CrashDebugger.cpp
@@ -264,8 +264,8 @@ bool ReduceCrashingFunctions::TestFuncs(std::vector<Function*> &Funcs) {
std::vector<GlobalValue*> ToRemove;
// First, remove aliases to functions we're about to purge.
for (GlobalAlias &Alias : M->aliases()) {
- Constant *Root = Alias.getAliasee()->stripPointerCasts();
- Function *F = dyn_cast<Function>(Root);
+ GlobalObject *Root = Alias.getBaseObject();
+ Function *F = dyn_cast_or_null<Function>(Root);
if (F) {
if (Functions.count(F))
// We're keeping this function.
diff --git a/llvm/tools/verify-uselistorder/verify-uselistorder.cpp b/llvm/tools/verify-uselistorder/verify-uselistorder.cpp
index a2f80996416..b7118a09024 100644
--- a/llvm/tools/verify-uselistorder/verify-uselistorder.cpp
+++ b/llvm/tools/verify-uselistorder/verify-uselistorder.cpp
@@ -191,6 +191,8 @@ ValueMapping::ValueMapping(const Module &M) {
map(&G);
for (const GlobalAlias &A : M.aliases())
map(&A);
+ for (const GlobalIFunc &IF : M.ifuncs())
+ map(&IF);
for (const Function &F : M)
map(&F);
@@ -200,6 +202,8 @@ ValueMapping::ValueMapping(const Module &M) {
map(G.getInitializer());
for (const GlobalAlias &A : M.aliases())
map(A.getAliasee());
+ for (const GlobalIFunc &IF : M.ifuncs())
+ map(IF.getResolver());
for (const Function &F : M) {
if (F.hasPrefixData())
map(F.getPrefixData());
@@ -463,6 +467,8 @@ static void changeUseLists(Module &M, Changer changeValueUseList) {
changeValueUseList(&G);
for (GlobalAlias &A : M.aliases())
changeValueUseList(&A);
+ for (GlobalIFunc &IF : M.ifuncs())
+ changeValueUseList(&IF);
for (Function &F : M)
changeValueUseList(&F);
@@ -472,6 +478,8 @@ static void changeUseLists(Module &M, Changer changeValueUseList) {
changeValueUseList(G.getInitializer());
for (GlobalAlias &A : M.aliases())
changeValueUseList(A.getAliasee());
+ for (GlobalIFunc &IF : M.ifuncs())
+ changeValueUseList(IF.getResolver());
for (Function &F : M) {
if (F.hasPrefixData())
changeValueUseList(F.getPrefixData());
OpenPOWER on IntegriCloud