llvm-go: Set $GCCGO instead of putting a gccgo executable on $PATH.
[oota-llvm.git] / tools / opt / AnalysisWrappers.cpp
index 1774ea02957ec9003c44a7be5c723221b9d3504c..4bdc268f8d7594d54bb0b6e5ba9b1c23e38556b8 100644 (file)
@@ -37,12 +37,11 @@ namespace {
         if (!I->isDeclaration()) continue;
 
         bool PrintedFn = false;
-        for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
-             UI != E; ++UI) {
-          Instruction *User = dyn_cast<Instruction>(*UI);
-          if (!User) continue;
+        for (User *U : I->users()) {
+          Instruction *UI = dyn_cast<Instruction>(U);
+          if (!UI) continue;
 
-          CallSite CS(cast<Value>(User));
+          CallSite CS(cast<Value>(UI));
           if (!CS) continue;
 
           for (CallSite::arg_iterator AI = CS.arg_begin(),
@@ -53,7 +52,7 @@ namespace {
               errs() << "Function '" << I->getName() << "':\n";
               PrintedFn = true;
             }
-            errs() << *User;
+            errs() << *UI;
             break;
           }
         }