[llvm-commits] CVS: llvm/lib/Analysis/ProfileInfo.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Feb 10 16:13:03 PST 2004
Changes in directory llvm/lib/Analysis:
ProfileInfo.cpp added (r1.1)
---
Log message:
An initial implementation of an LLVM ProfileInfo class which is designed to
eventually allow Passes to use profiling information to direct them.
---
Diffs of the changes: (+42 -0)
Index: llvm/lib/Analysis/ProfileInfo.cpp
diff -c /dev/null llvm/lib/Analysis/ProfileInfo.cpp:1.1
*** /dev/null Tue Feb 10 16:12:01 2004
--- llvm/lib/Analysis/ProfileInfo.cpp Tue Feb 10 16:11:21 2004
***************
*** 0 ****
--- 1,42 ----
+ //===- ProfileInfo.cpp - Profile Info Interface ---------------------------===//
+ //
+ // 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 implements the abstract ProfileInfo interface, and the default
+ // "no profile" implementation.
+ //
+ //===----------------------------------------------------------------------===//
+
+ #include "llvm/Analysis/ProfileInfo.h"
+ #include "llvm/Pass.h"
+ using namespace llvm;
+
+ // Register the AliasAnalysis interface, providing a nice name to refer to.
+ namespace {
+ RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
+ }
+
+ ProfileInfo::~ProfileInfo() {}
+
+
+ //===----------------------------------------------------------------------===//
+ // NoProfile ProfileInfo implementation
+ //
+
+ namespace {
+ struct NoProfileInfo : public ImmutablePass, public ProfileInfo {
+ unsigned getExecutionCount(BasicBlock *BB) { return 0; }
+ };
+
+ // Register this pass...
+ RegisterOpt<NoProfileInfo>
+ X("no-profile", "No Profile Information");
+
+ // Declare that we implement the AliasAnalysis interface
+ RegisterAnalysisGroup<ProfileInfo, NoProfileInfo> Y;
+ } // End of anonymous namespace
More information about the llvm-commits
mailing list