diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
commit | cd749a9c07f1de2fb8affde90537efa4bc3e7c54 (patch) | |
tree | b21f6de4e08b89bb7931806bab798fc2a5e3a686 /include/llvm/Analysis/ProfileInfoLoader.h | |
parent | 72621d11de5b873f1695f391eb95f0b336c3d2d4 (diff) | |
download | FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.zip FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.tar.gz |
Update llvm to r84119.
Diffstat (limited to 'include/llvm/Analysis/ProfileInfoLoader.h')
-rw-r--r-- | include/llvm/Analysis/ProfileInfoLoader.h | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/include/llvm/Analysis/ProfileInfoLoader.h b/include/llvm/Analysis/ProfileInfoLoader.h index 9076fbc..9e0c393 100644 --- a/include/llvm/Analysis/ProfileInfoLoader.h +++ b/include/llvm/Analysis/ProfileInfoLoader.h @@ -27,11 +27,13 @@ class Function; class BasicBlock; class ProfileInfoLoader { + const std::string &Filename; Module &M; std::vector<std::string> CommandLines; std::vector<unsigned> FunctionCounts; std::vector<unsigned> BlockCounts; std::vector<unsigned> EdgeCounts; + std::vector<unsigned> OptimalEdgeCounts; std::vector<unsigned> BBTrace; bool Warned; public: @@ -40,49 +42,41 @@ public: ProfileInfoLoader(const char *ToolName, const std::string &Filename, Module &M); + static const unsigned Uncounted; + unsigned getNumExecutions() const { return CommandLines.size(); } const std::string &getExecution(unsigned i) const { return CommandLines[i]; } - // getFunctionCounts - This method is used by consumers of function counting - // information. If we do not directly have function count information, we - // compute it from other, more refined, types of profile information. - // - void getFunctionCounts(std::vector<std::pair<Function*, unsigned> > &Counts); + const std::string &getFileName() const { return Filename; } - // hasAccurateBlockCounts - Return true if we can synthesize accurate block - // frequency information from whatever we have. + // getRawFunctionCounts - This method is used by consumers of function + // counting information. // - bool hasAccurateBlockCounts() const { - return !BlockCounts.empty() || !EdgeCounts.empty(); + const std::vector<unsigned> &getRawFunctionCounts() const { + return FunctionCounts; } - // hasAccurateEdgeCounts - Return true if we can synthesize accurate edge - // frequency information from whatever we have. + // getRawBlockCounts - This method is used by consumers of block counting + // information. // - bool hasAccurateEdgeCounts() const { - return !EdgeCounts.empty(); + const std::vector<unsigned> &getRawBlockCounts() const { + return BlockCounts; } - // getBlockCounts - This method is used by consumers of block counting - // information. If we do not directly have block count information, we - // compute it from other, more refined, types of profile information. - // - void getBlockCounts(std::vector<std::pair<BasicBlock*, unsigned> > &Counts); - // getEdgeCounts - This method is used by consumers of edge counting - // information. If we do not directly have edge count information, we compute - // it from other, more refined, types of profile information. - // - // Edges are represented as a pair, where the first element is the basic block - // and the second element is the successor number. + // information. // - typedef std::pair<BasicBlock*, unsigned> Edge; - void getEdgeCounts(std::vector<std::pair<Edge, unsigned> > &Counts); + const std::vector<unsigned> &getRawEdgeCounts() const { + return EdgeCounts; + } - // getBBTrace - This method is used by consumers of basic-block trace - // information. + // getEdgeOptimalCounts - This method is used by consumers of optimal edge + // counting information. // - void getBBTrace(std::vector<BasicBlock *> &Trace); + const std::vector<unsigned> &getRawOptimalEdgeCounts() const { + return OptimalEdgeCounts; + } + }; } // End llvm namespace |