Transforms: Use the new DebugLoc API, NFC

Update lib/Analysis and lib/Transforms to use the new `DebugLoc` API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233587 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-03-30 19:49:49 +00:00
parent 39acf8f243
commit f175439a2b
8 changed files with 35 additions and 36 deletions

View File

@@ -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);