summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2014-12-03 02:45:01 +0000
committerNick Lewycky <nicholas@mxc.ca>2014-12-03 02:45:01 +0000
commit2e8a6219fc0159a6e95845e401ea67b720dc2ece (patch)
treeb694af3e98810cea2a51815539030a6b7c807af1 /llvm/lib
parent0a64776cc0b2d8366cebc7ea00496ebb1e6b462b (diff)
downloadbcm5719-llvm-2e8a6219fc0159a6e95845e401ea67b720dc2ece.tar.gz
bcm5719-llvm-2e8a6219fc0159a6e95845e401ea67b720dc2ece.zip
Emit the entry block first and the exit block second, then all the blocks in between afterwards. This is what gcc always does, and some out of tree tools depend on that.
llvm-svn: 223193
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
index 220d7f8b490..685428ee952 100644
--- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
+++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
@@ -310,11 +310,15 @@ namespace {
Function *F = SP.getFunction();
DEBUG(dbgs() << "Function: " << getFunctionName(SP) << "\n");
- uint32_t i = 0;
- for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
+
+ Function::iterator BB = F->begin(), E = F->end();
+ Blocks[BB++] = new GCOVBlock(0, os);
+ ReturnBlock = new GCOVBlock(1, os);
+
+ uint32_t i = 2;
+ for (; BB != E; ++BB) {
Blocks[BB] = new GCOVBlock(i++, os);
}
- ReturnBlock = new GCOVBlock(i++, os);
std::string FunctionNameAndLine;
raw_string_ostream FNLOS(FunctionNameAndLine);
OpenPOWER on IntegriCloud