Skip to content

Commit

Permalink
transforms/ExplicitConsdes: Fix compilation with LLVM 12+
Browse files Browse the repository at this point in the history
  • Loading branch information
lzaoral authored and mchalupa committed Nov 1, 2021
1 parent fe89142 commit 14976d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions transforms/ExplicitConsdes.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <llvm/IR/Constants.h>
#include <llvm/IR/Function.h>
#include <llvm/IR/InstIterator.h>
#include <llvm/Support/Casting.h>

Expand All @@ -23,7 +24,7 @@ class ExplicitConsdes : public ModulePass {
private:
struct FunctionEntry {
uint32_t priority;
Value *function;
Function *function;
Value *param;
};

Expand Down Expand Up @@ -64,7 +65,7 @@ class ExplicitConsdes : public ModulePass {
entry.priority =
dyn_cast<ConstantInt>(elem->getAggregateElement(0u))
->getZExtValue();
entry.function = elem->getAggregateElement(1);
entry.function = dyn_cast<Function>(elem->getAggregateElement(1));
entry.param = elem->getAggregateElement(2);
target.push_back(std::move(entry));
}
Expand Down

0 comments on commit 14976d5

Please sign in to comment.