[PATCH] D24568: [compiler-rt] Changing function prototype returning unused value

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 10:47:48 PDT 2016


etienneb updated this revision to Diff 71393.
etienneb marked an inline comment as done.
etienneb added a comment.

fix naming


https://reviews.llvm.org/D24568

Files:
  lib/Transforms/Instrumentation/AddressSanitizer.cpp

Index: lib/Transforms/Instrumentation/AddressSanitizer.cpp
===================================================================
--- lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -1885,13 +1885,16 @@
   if (!ClDebugFunc.empty() && ClDebugFunc == F.getName()) return false;
   if (F.getName().find("__asan_") != std::string::npos) 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 @@
     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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24568.71393.patch
Type: text/x-patch
Size: 1548 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160914/52b95024/attachment.bin>


More information about the llvm-commits mailing list