From 923327267949b537d7a2fdad5b7a919bd90ce085 Mon Sep 17 00:00:00 2001 From: Andreas Neustifter Date: Wed, 16 Sep 2009 11:35:50 +0000 Subject: Reapplied r81355 with the problems fixed. (See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090907/086737.html and http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090907/086746.html) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82039 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp') diff --git a/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp b/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp index cdaf5f1b0d..b2e6747ca0 100644 --- a/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp +++ b/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp @@ -18,6 +18,7 @@ #include "llvm/Pass.h" #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/ProfileInfo.h" +#include "llvm/Analysis/ProfileInfoLoader.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Debug.h" @@ -113,8 +114,8 @@ bool OptimalEdgeProfiler::runOnModule(Module &M) { NumEdgesInserted = 0; std::vector Initializer(NumEdges); - Constant* zeroc = ConstantInt::get(Int32, 0); - Constant* minusonec = ConstantInt::get(Int32, ProfileInfo::MissingValue); + Constant* Zero = ConstantInt::get(Int32, 0); + Constant* Uncounted = ConstantInt::get(Int32, ProfileInfoLoader::Uncounted); // Instrument all of the edges not in MST... unsigned i = 0; @@ -144,9 +145,9 @@ bool OptimalEdgeProfiler::runOnModule(Module &M) { if (!std::binary_search(MST.begin(), MST.end(), edge)) { printEdgeCounter(edge,entry,i); IncrementCounterInBlock(entry, i, Counters); NumEdgesInserted++; - Initializer[i++] = (zeroc); + Initializer[i++] = (Zero); } else{ - Initializer[i++] = (minusonec); + Initializer[i++] = (Uncounted); } // InsertedBlocks contains all blocks that were inserted for splitting an @@ -167,9 +168,9 @@ bool OptimalEdgeProfiler::runOnModule(Module &M) { if (!std::binary_search(MST.begin(), MST.end(), edge)) { printEdgeCounter(edge,BB,i); IncrementCounterInBlock(BB, i, Counters); NumEdgesInserted++; - Initializer[i++] = (zeroc); + Initializer[i++] = (Zero); } else{ - Initializer[i++] = (minusonec); + Initializer[i++] = (Uncounted); } } for (unsigned s = 0, e = TI->getNumSuccessors(); s != e; ++s) { @@ -195,9 +196,9 @@ bool OptimalEdgeProfiler::runOnModule(Module &M) { printEdgeCounter(edge,Succ,i); IncrementCounterInBlock(Succ, i, Counters); NumEdgesInserted++; } - Initializer[i++] = (zeroc); + Initializer[i++] = (Zero); } else { - Initializer[i++] = (minusonec); + Initializer[i++] = (Uncounted); } } } -- cgit v1.2.3