Make sure the verify pass gets run after the user's loaded passes as well
authorReid Spencer <rspencer@reidspencer.com>
Sun, 20 Aug 2006 20:54:38 +0000 (20:54 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 20 Aug 2006 20:54:38 +0000 (20:54 +0000)
when the verify-each option is given.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29783 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-ld/Optimize.cpp

index e6387fe..f539703 100644 (file)
@@ -175,12 +175,11 @@ void Optimize(Module* M) {
   std::auto_ptr<TargetMachine> target;
   for (unsigned i = 0; i < OptimizationList.size(); ++i) {
     const PassInfo *Opt = OptimizationList[i];
-    
     if (Opt->getNormalCtor())
-      Passes.add(Opt->getNormalCtor()());
+      addPass(Passes, Opt->getNormalCtor()());
     else if (Opt->getTargetCtor()) {
       assert(target.get() && "Could not allocate target machine!");
-      Passes.add(Opt->getTargetCtor()(*target.get()));
+      addPass(Passes, Opt->getTargetCtor()(*target.get()));
     } else
       std::cerr << "llvm-ld: cannot create pass: " << Opt->getPassName() 
                 << "\n";