aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-01-03 19:26:07 +0000
committerXinliang David Li <davidxl@google.com>2016-01-03 19:26:07 +0000
commit5205ca0c703e757a7b86a8577a12b7c40a791df7 (patch)
tree1622e189a119228ccef2b1628763e8562b009506 /llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
parent20b188c09c4e22d8bd03bc466a3cc4c05d14196d (diff)
downloadllvm-5205ca0c703e757a7b86a8577a12b7c40a791df7.zip
llvm-5205ca0c703e757a7b86a8577a12b7c40a791df7.tar.gz
llvm-5205ca0c703e757a7b86a8577a12b7c40a791df7.tar.bz2
[PGO] Cleanup: Use covmap header definition in the template file
This is one last remaining instrumentatation related structure that needs to be migrate to use the centralized template definition. With this change, instrumentation code related to coverage module header will be kept in sync with the coverage mapping reader. The remaining code which makes implicit assumption about covmap control structure layout in the the lowering pass will cleaned up in a different patch. This patch is not intended to have no functional change. llvm-svn: 256715
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
index 92e41ee..7a51fda 100644
--- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -238,12 +238,12 @@ void InstrProfiling::lowerCoverageData(GlobalVariable *CoverageData) {
CoverageData->setAlignment(8);
Constant *Init = CoverageData->getInitializer();
- // We're expecting { i32, i32, i32, i32, [n x { i8*, i32, i32 }], [m x i8] }
+ // We're expecting { [4 x 32], [n x { i8*, i32, i32 }], [m x i8] }
// for some C. If not, the frontend's given us something broken.
- assert(Init->getNumOperands() == 6 && "bad number of fields in coverage map");
- assert(isa<ConstantArray>(Init->getAggregateElement(4)) &&
+ assert(Init->getNumOperands() == 3 && "bad number of fields in coverage map");
+ assert(isa<ConstantArray>(Init->getAggregateElement(1)) &&
"invalid function list in coverage map");
- ConstantArray *Records = cast<ConstantArray>(Init->getAggregateElement(4));
+ ConstantArray *Records = cast<ConstantArray>(Init->getAggregateElement(1));
for (unsigned I = 0, E = Records->getNumOperands(); I < E; ++I) {
Constant *Record = Records->getOperand(I);
Value *V = const_cast<Value *>(Record->getOperand(0))->stripPointerCasts();