about summary refs log tree commit diff
path: root/instrumentation/compare-transform-pass.so.cc
diff options
context:
space:
mode:
Diffstat (limited to 'instrumentation/compare-transform-pass.so.cc')
-rw-r--r--instrumentation/compare-transform-pass.so.cc14
1 files changed, 10 insertions, 4 deletions
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
@@ -101,6 +101,12 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
   IntegerType *                    Int64Ty = IntegerType::getInt64Ty(C);
 
 #if LLVM_VERSION_MAJOR < 9
+  Function *tolowerFn;
+#else
+  FunctionCallee tolowerFn;
+#endif
+  {
+#if LLVM_VERSION_MAJOR < 9
   Constant *
 #else
   FunctionCallee
@@ -112,11 +118,11 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
 #endif
       );
 #if LLVM_VERSION_MAJOR < 9
-  Function *tolowerFn = cast<Function>(c);
+  tolowerFn = cast<Function>(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<ConstantExpr>(Str1P);
+              Ptr = dyn_cast<ConstantExpr>(Str1P);
               if (Ptr && Ptr->isGEPWithNoNotionalOverIndexing()) {
 
                 if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {