Use the new interface, simplifies code

NOTE that these two files are _BUGGY_ and need to be fixed, just not by me  :)

llvm-svn: 8241
diff --git a/llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp b/llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
index a74d5c7..1c0ec3b 100644
--- a/llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
+++ b/llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
@@ -121,6 +121,12 @@
 
   removeRedundant(be);
 
+  // FIXME: THIS IS HORRIBLY BROKEN.  FunctionPass's cannot do this, except in
+  // their initialize function!!
+  Function *inCountMth = 
+    F.getParent()->getOrInsertFunction("llvm_first_trigger",
+                                       Type::VoidTy, 0);
+
   for(std::map<BasicBlock *, BasicBlock *>::iterator MI = be.begin(),
 	ME = be.end(); MI != ME; ++MI){
     BasicBlock *u = MI->first;
@@ -138,15 +144,6 @@
         
     BasicBlock::InstListType &lt = newBB->getInstList();
 
-    std::vector<const Type*> inCountArgs;
-    const FunctionType *cFty = FunctionType::get(Type::VoidTy, inCountArgs, 
-						 false);
-    Function *inCountMth = 
-      u->getParent()->getParent()->getOrInsertFunction("llvm_first_trigger",
-						       cFty);
-        
-    assert(inCountMth && "Initial method could not be inserted!");
-
     Instruction *call = new CallInst(inCountMth);
     lt.push_back(call);
     lt.push_back(new BranchInst(BB));