about summary refs log tree commit diff homepage
path: root/lib/Module
diff options
context:
space:
mode:
authorLukas Zaoral <lzaoral@redhat.com>2021-08-24 13:59:32 +0200
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2021-12-20 14:36:51 +0000
commit49935def640a19b6dccf69c33be65d3798ea218a (patch)
tree193c54d50da8e5a39fd4082ffd6b8e1fead4eabc /lib/Module
parentebba5c50806d2c67a357ce8091ad861dfa0f434f (diff)
downloadklee-49935def640a19b6dccf69c33be65d3798ea218a.tar.gz
llvm13: CreateGEP no longer accepts nullptr
See: https://reviews.llvm.org/D105653
Diffstat (limited to 'lib/Module')
-rw-r--r--lib/Module/IntrinsicCleaner.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
index 5e720e45..f4b867e5 100644
--- a/lib/Module/IntrinsicCleaner.cpp
+++ b/lib/Module/IntrinsicCleaner.cpp
@@ -106,19 +106,20 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) {
           auto pDst = Builder.CreatePointerCast(dst, i64p, "vacopy.cast.dst");
           auto pSrc = Builder.CreatePointerCast(src, i64p, "vacopy.cast.src");
 
-          auto pType = pSrc->getType()->getPointerElementType();
+          auto pSrcType = pSrc->getType()->getPointerElementType();
+          auto pDstType = pDst->getType()->getPointerElementType();
 
-          auto val = Builder.CreateLoad(pType, pSrc);
+          auto val = Builder.CreateLoad(pSrcType, pSrc);
           Builder.CreateStore(val, pDst, ii);
 
           auto off = ConstantInt::get(Type::getInt64Ty(ctx), 1);
-          pDst = Builder.CreateGEP(nullptr, pDst, off, std::string());
-          pSrc = Builder.CreateGEP(nullptr, pSrc, off, std::string());
-          val = Builder.CreateLoad(pType, pSrc);
+          pDst = Builder.CreateGEP(pDstType, pDst, off);
+          pSrc = Builder.CreateGEP(pSrcType, pSrc, off);
+          val = Builder.CreateLoad(pSrcType, pSrc);
           Builder.CreateStore(val, pDst);
-          pDst = Builder.CreateGEP(nullptr, pDst, off, std::string());
-          pSrc = Builder.CreateGEP(nullptr, pSrc, off, std::string());
-          val = Builder.CreateLoad(pType, pSrc);
+          pDst = Builder.CreateGEP(pDstType, pDst, off);
+          pSrc = Builder.CreateGEP(pSrcType, pSrc, off);
+          val = Builder.CreateLoad(pSrcType, pSrc);
           Builder.CreateStore(val, pDst);
         }
         ii->eraseFromParent();