[llvm] r281620 - [compiler-rt] Changing function prototype returning unused value

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 08:45:05 PDT 2016


Author: etienneb
Date: Thu Sep 15 10:45:05 2016
New Revision: 281620

URL: http://llvm.org/viewvc/llvm-project?rev=281620&view=rev
Log:
[compiler-rt] Changing function prototype returning unused value

Summary: The return value of `maybeInsertAsanInitAtFunctionEntry` is ignored.

Reviewers: rnk

Subscribers: llvm-commits, chrisha, dberris

Differential Revision: https://reviews.llvm.org/D24568

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=281620&r1=281619&r2=281620&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Thu Sep 15 10:45:05 2016
@@ -1885,13 +1885,16 @@ bool AddressSanitizer::runOnFunction(Fun
   if (!ClDebugFunc.empty() && ClDebugFunc == F.getName()) return false;
   if (F.getName().startswith("__asan_")) return false;
 
+  bool FunctionModified = false;
+
   // If needed, insert __asan_init before checking for SanitizeAddress attr.
   // This function needs to be called even if the function body is not
   // instrumented.  
-  maybeInsertAsanInitAtFunctionEntry(F);
+  if (maybeInsertAsanInitAtFunctionEntry(F))
+    FunctionModified = true;
   
   // Leave if the function doesn't need instrumentation.
-  if (!F.hasFnAttribute(Attribute::SanitizeAddress)) return false;
+  if (!F.hasFnAttribute(Attribute::SanitizeAddress)) return FunctionModified;
 
   DEBUG(dbgs() << "ASAN instrumenting:\n" << F << "\n");
 
@@ -1992,11 +1995,13 @@ bool AddressSanitizer::runOnFunction(Fun
     NumInstrumented++;
   }
 
-  bool res = NumInstrumented > 0 || ChangedStack || !NoReturnCalls.empty();
+  if (NumInstrumented > 0 || ChangedStack || !NoReturnCalls.empty())
+    FunctionModified = true;
 
-  DEBUG(dbgs() << "ASAN done instrumenting: " << res << " " << F << "\n");
+  DEBUG(dbgs() << "ASAN done instrumenting: " << FunctionModified << " "
+               << F << "\n");
 
-  return res;
+  return FunctionModified;
 }
 
 // Workaround for bug 11395: we don't want to instrument stack in functions




More information about the llvm-commits mailing list