Chris Lattner | 171de65 | 2004-02-10 22:11:42 +0000 | [diff] [blame] | 1 | //===- ProfileInfo.cpp - Profile Info Interface ---------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the abstract ProfileInfo interface, and the default |
| 11 | // "no profile" implementation. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "llvm/Analysis/ProfileInfo.h" |
| 16 | #include "llvm/Pass.h" |
| 17 | using namespace llvm; |
| 18 | |
Chris Lattner | ecefc96 | 2004-02-11 06:10:18 +0000 | [diff] [blame^] | 19 | // Register the ProfileInfo interface, providing a nice name to refer to. |
Chris Lattner | 171de65 | 2004-02-10 22:11:42 +0000 | [diff] [blame] | 20 | namespace { |
| 21 | RegisterAnalysisGroup<ProfileInfo> Z("Profile Information"); |
| 22 | } |
| 23 | |
| 24 | ProfileInfo::~ProfileInfo() {} |
| 25 | |
| 26 | |
| 27 | //===----------------------------------------------------------------------===// |
| 28 | // NoProfile ProfileInfo implementation |
| 29 | // |
| 30 | |
| 31 | namespace { |
| 32 | struct NoProfileInfo : public ImmutablePass, public ProfileInfo { |
| 33 | unsigned getExecutionCount(BasicBlock *BB) { return 0; } |
| 34 | }; |
| 35 | |
| 36 | // Register this pass... |
| 37 | RegisterOpt<NoProfileInfo> |
| 38 | X("no-profile", "No Profile Information"); |
| 39 | |
Chris Lattner | ecefc96 | 2004-02-11 06:10:18 +0000 | [diff] [blame^] | 40 | // Declare that we implement the ProfileInfo interface |
Chris Lattner | b060194 | 2004-02-11 04:47:54 +0000 | [diff] [blame] | 41 | RegisterAnalysisGroup<ProfileInfo, NoProfileInfo, true> Y; |
Chris Lattner | 171de65 | 2004-02-10 22:11:42 +0000 | [diff] [blame] | 42 | } // End of anonymous namespace |