blob: 24a26c872131edcc96c306ad6875dc17785cab46 [file] [log] [blame]
Chris Lattner171de652004-02-10 22:11:42 +00001//===- 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"
17using namespace llvm;
18
19// Register the AliasAnalysis interface, providing a nice name to refer to.
20namespace {
21 RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
22}
23
24ProfileInfo::~ProfileInfo() {}
25
26
27//===----------------------------------------------------------------------===//
28// NoProfile ProfileInfo implementation
29//
30
31namespace {
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
40 // Declare that we implement the AliasAnalysis interface
Chris Lattnerb0601942004-02-11 04:47:54 +000041 RegisterAnalysisGroup<ProfileInfo, NoProfileInfo, true> Y;
Chris Lattner171de652004-02-10 22:11:42 +000042} // End of anonymous namespace