From 14976d5039669c1aea18d612f27c2e6c448c62bf Mon Sep 17 00:00:00 2001 From: Lukas Zaoral Date: Mon, 1 Nov 2021 11:18:41 +0100 Subject: [PATCH] transforms/ExplicitConsdes: Fix compilation with LLVM 12+ --- transforms/ExplicitConsdes.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/transforms/ExplicitConsdes.cpp b/transforms/ExplicitConsdes.cpp index 049f873b..3fbc14f6 100644 --- a/transforms/ExplicitConsdes.cpp +++ b/transforms/ExplicitConsdes.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -23,7 +24,7 @@ class ExplicitConsdes : public ModulePass { private: struct FunctionEntry { uint32_t priority; - Value *function; + Function *function; Value *param; }; @@ -64,7 +65,7 @@ class ExplicitConsdes : public ModulePass { entry.priority = dyn_cast(elem->getAggregateElement(0u)) ->getZExtValue(); - entry.function = elem->getAggregateElement(1); + entry.function = dyn_cast(elem->getAggregateElement(1)); entry.param = elem->getAggregateElement(2); target.push_back(std::move(entry)); }