summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/SampleProfile.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-30 19:49:49 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-30 19:49:49 +0000
commitec819c096b9babe09ccf93db1709f6b04c706a3c (patch)
tree67a413cf878c6d12135ad1a8286693b13c9c0937 /llvm/lib/Transforms/Scalar/SampleProfile.cpp
parente50adcb6b1b7e8317cca7ed5f8860a40ca6b7196 (diff)
downloadbcm5719-llvm-ec819c096b9babe09ccf93db1709f6b04c706a3c.tar.gz
bcm5719-llvm-ec819c096b9babe09ccf93db1709f6b04c706a3c.zip
Transforms: Use the new DebugLoc API, NFC
Update lib/Analysis and lib/Transforms to use the new `DebugLoc` API. llvm-svn: 233587
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SampleProfile.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/SampleProfile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/SampleProfile.cpp b/llvm/lib/Transforms/Scalar/SampleProfile.cpp
index 3e7cf04001f..f56e2f1d87c 100644
--- a/llvm/lib/Transforms/Scalar/SampleProfile.cpp
+++ b/llvm/lib/Transforms/Scalar/SampleProfile.cpp
@@ -217,14 +217,14 @@ void SampleProfileLoader::printBlockWeight(raw_ostream &OS, BasicBlock *BB) {
/// \returns The profiled weight of I.
unsigned SampleProfileLoader::getInstWeight(Instruction &Inst) {
DebugLoc DLoc = Inst.getDebugLoc();
- if (DLoc.isUnknown())
+ if (!DLoc)
return 0;
unsigned Lineno = DLoc.getLine();
if (Lineno < HeaderLineno)
return 0;
- DILocation DIL(DLoc.getAsMDNode(*Ctx));
+ DILocation DIL = DLoc.get();
int LOffset = Lineno - HeaderLineno;
unsigned Discriminator = DIL.getDiscriminator();
unsigned Weight = Samples->samplesAt(LOffset, Discriminator);
OpenPOWER on IntegriCloud