changeset 25:8198410b6780

SROA.cpp : change the terms for execution of SROA pass. before : has a "goto cs();". after : the function is a code segment.
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Tue, 12 Nov 2013 18:03:08 +0900
parents 9b9640b7b299
children d84031a0fa3c
files lib/Transforms/Scalar/SROA.cpp
diffstat 1 files changed, 2 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lib/Transforms/Scalar/SROA.cpp	Wed Nov 06 22:30:04 2013 +0900
+++ b/lib/Transforms/Scalar/SROA.cpp	Tue Nov 12 18:03:08 2013 +0900
@@ -3739,19 +3739,8 @@
   DT = getAnalysisIfAvailable<DominatorTree>();
 
 #ifndef noCbC
-  if (isOnlyForCbC()) { //if only for CbC , we must check this function contains __code
-    bool contains__Code = false;
-    for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
-      for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
-        if (CallInst *CI = dyn_cast<CallInst>(I)){
-	  Function* CalledFunction = CI->getCalledFunction();
-	  if (CalledFunction != NULL) 
-	    if (CalledFunction->getReturnType()->is__CodeTy())
-	      contains__Code = true;
-	}
-    if (!contains__Code)
-      return false; // if the function doesn't contains __code , we have not to touch it. 
-  }
+  if (isOnlyForCbC() && !F.getReturnType()->is__CodeTy())
+    return false;
 #endif
 
   BasicBlock &EntryBB = F.getEntryBlock();