diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h
index e38fe31..cfc4cc9 100644
--- a/include/llvm/Analysis/LoopInfo.h
+++ b/include/llvm/Analysis/LoopInfo.h
@@ -239,7 +239,7 @@ public:
            I != E; ++I)
         if (!std::binary_search(LoopBBs.begin(), LoopBBs.end(), *I))
           // Not in current loop? It must be an exit block.
-          ExitEdges.push_back(std::make_pair(*BI,*I));
+          ExitEdges.push_back(std::make_pair(*BI, *I));
   }
 
   /// getUniqueExitBlocks - Return all unique successor blocks of this loop. 
diff --git a/include/llvm/Analysis/ProfileInfo.h b/include/llvm/Analysis/ProfileInfo.h
index 3b76ef9..9b69251 100644
--- a/include/llvm/Analysis/ProfileInfo.h
+++ b/include/llvm/Analysis/ProfileInfo.h
@@ -67,7 +67,7 @@ namespace llvm {
 
     // getEdge() - Creates an Edge from two BasicBlocks.
     static Edge getEdge(const BasicBlock* Src, const BasicBlock* Dest) {
-      return std::make_pair(Src,Dest);
+      return std::make_pair(Src, Dest);
     }
 
     //===------------------------------------------------------------------===//
diff --git a/lib/Analysis/ProfileInfo.cpp b/lib/Analysis/ProfileInfo.cpp
index e8fa29f..287c626 100644
--- a/lib/Analysis/ProfileInfo.cpp
+++ b/lib/Analysis/ProfileInfo.cpp
@@ -64,6 +64,7 @@ double ProfileInfo::getExecutionCount(const BasicBlock *BB) {
 }
 
 double ProfileInfo::getExecutionCount(const Function *F) {
+  if (F->isDeclaration()) return MissingValue;
   std::map<const Function*, double>::iterator J =
     FunctionInformation.find(F);
   if (J != FunctionInformation.end())
diff --git a/lib/Analysis/ProfileInfoLoaderPass.cpp b/lib/Analysis/ProfileInfoLoaderPass.cpp
index c65c8fa..e1f8e23 100644
--- a/lib/Analysis/ProfileInfoLoaderPass.cpp
+++ b/lib/Analysis/ProfileInfoLoaderPass.cpp
@@ -76,7 +76,7 @@ Pass *llvm::createProfileLoaderPass(const std::string &Filename) {
 }
 
 bool LoaderPass::runOnModule(Module &M) {
-  if(PIL==NULL) PIL=new ProfileInfoLoader("profile-loader", Filename, M);
+  if (PIL == NULL) PIL=new ProfileInfoLoader("profile-loader", Filename, M);
 
   EdgeInformation.clear();
   std::vector<unsigned> ECs = PIL->getRawEdgeCounts();
@@ -84,7 +84,7 @@ bool LoaderPass::runOnModule(Module &M) {
     unsigned ei = 0;
     for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
       if (F->isDeclaration()) continue;
-      EdgeInformation[F][ProfileInfo::getEdge(0,&F->getEntryBlock())] +=
+      EdgeInformation[F][ProfileInfo::getEdge(0, &F->getEntryBlock())] +=
         ECs[ei++];
       for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
         // Okay, we have to add a counter of each outgoing edge.  If the
@@ -97,7 +97,7 @@ bool LoaderPass::runOnModule(Module &M) {
         }
       }
     }
-    if (ei!=ECs.size()) {
+    if (ei != ECs.size()) {
       cerr << "WARNING: profile information is inconsistent with "
            << "the current program!\n";
     }
@@ -112,7 +112,7 @@ bool LoaderPass::runOnModule(Module &M) {
       for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
         BlockInformation[F][BB] = BCs[bi++];
     }
-    if (bi!=BCs.size()) {
+    if (bi != BCs.size()) {
       cerr << "WARNING: profile information is inconsistent with "
            << "the current program!\n";
     }
@@ -126,7 +126,7 @@ bool LoaderPass::runOnModule(Module &M) {
       if (F->isDeclaration()) continue;
       FunctionInformation[F] = FCs[fi++];
     }
-    if (fi!=FCs.size()) {
+    if (fi != FCs.size()) {
       cerr << "WARNING: profile information is inconsistent with "
            << "the current program!\n";
     }
diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp
index c78469f..d0003e3 100644
--- a/tools/llvm-prof/llvm-prof.cpp
+++ b/tools/llvm-prof/llvm-prof.cpp
@@ -103,24 +103,22 @@ namespace {
     ProfileAnnotator(ProfileInfo* pi) : PI(pi) {}
 
     virtual void emitFunctionAnnot(const Function *F, raw_ostream &OS) {
-      OS << ";;; %" << F->getName() << " called ";
       double w = PI->getExecutionCount(F);
-      if (w == ProfileInfo::MissingValue)
-        OS << "(no value)";
-      else
-        OS << (unsigned)w;
-      OS << " times.\n;;;\n";
+      if (w != ProfileInfo::MissingValue) {
+        OS << ";;; %" << F->getName() << " called "<<(unsigned)w
+           <<" times.\n;;;\n";
+      }
     }
     virtual void emitBasicBlockStartAnnot(const BasicBlock *BB,
                                           raw_ostream &OS) {
       double w = PI->getExecutionCount(BB);
-      if (w == ProfileInfo::MissingValue)
-        OS << "\t;;; (no value)\n";
-      else
-        if (w!=0)
-          OS << "\t;;; Basic block executed " << w << " times.\n";
-        else
+      if (w != ProfileInfo::MissingValue) {
+        if (w != 0) {
+          OS << "\t;;; Basic block executed " << (unsigned)w << " times.\n";
+        } else {
           OS << "\t;;; Never executed!\n";
+        }
+      }
     }
 
     virtual void emitBasicBlockEndAnnot(const BasicBlock *BB, raw_ostream &OS) {
@@ -130,8 +128,9 @@ namespace {
       const TerminatorInst *TI = BB->getTerminator();
       for (unsigned s = 0, e = TI->getNumSuccessors(); s != e; ++s) {
         BasicBlock* Succ = TI->getSuccessor(s);
-        double w = ignoreMissing(PI->getEdgeWeight(std::make_pair(BB,Succ)));
-        SuccCounts.push_back(std::make_pair(std::make_pair(BB,Succ), w));
+        double w = ignoreMissing(PI->getEdgeWeight(std::make_pair(BB, Succ)));
+        if (w != 0)
+          SuccCounts.push_back(std::make_pair(std::make_pair(BB, Succ), w));
       }
       if (!SuccCounts.empty()) {
         OS << "\t;;; Out-edge counts:";
@@ -190,11 +189,11 @@ int main(int argc, char **argv) {
     for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI) {
       if (FI->isDeclaration()) continue;
       double w = ignoreMissing(PI.getExecutionCount(FI));
-      FunctionCounts.push_back(std::make_pair(FI,w));
+      FunctionCounts.push_back(std::make_pair(FI, w));
       for (Function::iterator BB = FI->begin(), BBE = FI->end(); 
            BB != BBE; ++BB) {
         double w = ignoreMissing(PI.getExecutionCount(BB));
-        Counts.push_back(std::make_pair(BB,w));
+        Counts.push_back(std::make_pair(BB, w));
       }
     }
 
