[asan] simplify the code around doesNotReturn call. It now magically works.
authorKostya Serebryany <kcc@google.com>
Fri, 30 Nov 2012 11:08:59 +0000 (11:08 +0000)
committerKostya Serebryany <kcc@google.com>
Fri, 30 Nov 2012 11:08:59 +0000 (11:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168995 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp

index 8ebc5d25e9f7652e487312af0f282a40cf49f10e..c0690f58c6064e97e9b4a23905a7d11f6794895a 100644 (file)
@@ -867,13 +867,6 @@ bool AddressSanitizer::maybeInsertAsanInitAtFunctionEntry(Function &F) {
   return false;
 }
 
-// Check both the call and the callee for doesNotReturn().
-static bool isNoReturnCall(CallInst *CI) {
-  if (CI->doesNotReturn()) return true;
-  Function *F = CI->getCalledFunction();
-  return (F && F->doesNotReturn());
-}
-
 bool AddressSanitizer::runOnFunction(Function &F) {
   if (BL->isIn(F)) return false;
   if (&F == AsanCtorFunction) return false;
@@ -915,7 +908,7 @@ bool AddressSanitizer::runOnFunction(Function &F) {
         if (CallInst *CI = dyn_cast<CallInst>(BI)) {
           // A call inside BB.
           TempsToInstrument.clear();
-          if (isNoReturnCall(CI)) {
+          if (CI->doesNotReturn()) {
             NoReturnCalls.push_back(CI);
           }
         }