From 7f4b3a460a0b4f83e9039b57c033f6f43be08550 Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Mon, 4 Jan 2021 22:23:04 +0100 Subject: more code cleanup (instrumentation) --- instrumentation/compare-transform-pass.so.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'instrumentation/compare-transform-pass.so.cc') diff --git a/instrumentation/compare-transform-pass.so.cc b/instrumentation/compare-transform-pass.so.cc index de8b97f0..887970a0 100644 --- a/instrumentation/compare-transform-pass.so.cc +++ b/instrumentation/compare-transform-pass.so.cc @@ -100,6 +100,12 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp, IntegerType * Int32Ty = IntegerType::getInt32Ty(C); IntegerType * Int64Ty = IntegerType::getInt64Ty(C); +#if LLVM_VERSION_MAJOR < 9 + Function *tolowerFn; +#else + FunctionCallee tolowerFn; +#endif + { #if LLVM_VERSION_MAJOR < 9 Constant * #else @@ -112,11 +118,11 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp, #endif ); #if LLVM_VERSION_MAJOR < 9 - Function *tolowerFn = cast(c); + tolowerFn = cast(c); #else - FunctionCallee tolowerFn = c; + tolowerFn = c; #endif - + } /* iterate over all functions, bbs and instruction and add suitable calls to * strcmp/memcmp/strncmp/strcasecmp/strncasecmp */ for (auto &F : M) { @@ -234,7 +240,7 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp, if (!HasStr2) { - auto *Ptr = dyn_cast(Str1P); + Ptr = dyn_cast(Str1P); if (Ptr && Ptr->isGEPWithNoNotionalOverIndexing()) { if (auto *Var = dyn_cast(Ptr->getOperand(0))) { -- cgit 1.4.1