Get rid of a static boolean.
authorOwen Anderson <resistor@mac.com>
Wed, 24 Jun 2009 22:08:59 +0000 (22:08 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 24 Jun 2009 22:08:59 +0000 (22:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74125 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/ProfileInfoLoader.h
lib/Analysis/ProfileInfoLoader.cpp

index 8a5141ab23525f4f6f150bb95b7d1bfb17fb87c1..9076fbc4fb959c65b4439a21391022c53f01712d 100644 (file)
@@ -33,6 +33,7 @@ class ProfileInfoLoader {
   std::vector<unsigned>    BlockCounts;
   std::vector<unsigned>    EdgeCounts;
   std::vector<unsigned>    BBTrace;
+  bool Warned;
 public:
   // ProfileInfoLoader ctor - Read the specified profiling data file, exiting
   // the program if the file is invalid or broken.
index 3a0a740f0035dac54044516398947360793bf367..adb2bdc425491fae4fc5411233e635d64282cda3 100644 (file)
@@ -73,7 +73,8 @@ static void ReadProfilingBlock(const char *ToolName, FILE *F,
 //
 ProfileInfoLoader::ProfileInfoLoader(const char *ToolName,
                                      const std::string &Filename,
-                                     Module &TheModule) : M(TheModule) {
+                                     Module &TheModule) : 
+                              M(TheModule), Warned(false) {
   FILE *F = fopen(Filename.c_str(), "r");
   if (F == 0) {
     cerr << ToolName << ": Error opening '" << Filename << "': ";
@@ -200,7 +201,6 @@ void ProfileInfoLoader::getBlockCounts(std::vector<std::pair<BasicBlock*,
         Counts.back().second += EdgeCounts[i].second;
         unsigned SuccNum = EdgeCounts[i].first.second;
         if (SuccNum >= TI->getNumSuccessors()) {
-          static bool Warned = false;
           if (!Warned) {
             cerr << "WARNING: profile info doesn't seem to match"
                  << " the program!\n";