Today the front-ends (llvm-gcc and clang) generate multiple llvm.dbg.compile_units...
[oota-llvm.git] / lib / Analysis / ProfileInfo.cpp
index 2a6a6a50bd037333593e1bdf2a651ac5de38ee3c..a0965b66da81526f61212d0a584d706a11915716 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
 using namespace llvm;
 
 // Register the ProfileInfo interface, providing a nice name to refer to.
-namespace {
-  RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
-}
-const int ProfileInfo::ID = 0;
+static RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
+char ProfileInfo::ID = 0;
 
 ProfileInfo::~ProfileInfo() {}
 
@@ -86,17 +84,17 @@ unsigned ProfileInfo::getExecutionCount(BasicBlock *BB) const {
 namespace {
   struct VISIBILITY_HIDDEN NoProfileInfo 
     : public ImmutablePass, public ProfileInfo {
-    static const int ID; // Class identification, replacement for typeinfo
-    NoProfileInfo() : ImmutablePass((intptr_t)&ID) {}
+    static char ID; // Class identification, replacement for typeinfo
+    NoProfileInfo() : ImmutablePass(&ID) {}
   };
+}  // End of anonymous namespace
 
-  const int NoProfileInfo::ID = 0;
-  // Register this pass...
-  RegisterPass<NoProfileInfo>
-  X("no-profile", "No Profile Information");
+char NoProfileInfo::ID = 0;
+// Register this pass...
+static RegisterPass<NoProfileInfo>
+X("no-profile", "No Profile Information", false, true);
 
-  // Declare that we implement the ProfileInfo interface
-  RegisterAnalysisGroup<ProfileInfo, true> Y(X);
-}  // End of anonymous namespace
+// Declare that we implement the ProfileInfo interface
+static RegisterAnalysisGroup<ProfileInfo, true> Y(X);
 
 ImmutablePass *llvm::createNoProfileInfoPass() { return new NoProfileInfo(); }