summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/AddDiscriminators.cpp8
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp10
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp25
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp2
4 files changed, 22 insertions, 23 deletions
diff --git a/llvm/lib/Transforms/Utils/AddDiscriminators.cpp b/llvm/lib/Transforms/Utils/AddDiscriminators.cpp
index 125aab2fe88..e9f62391a44 100644
--- a/llvm/lib/Transforms/Utils/AddDiscriminators.cpp
+++ b/llvm/lib/Transforms/Utils/AddDiscriminators.cpp
@@ -174,14 +174,14 @@ bool AddDiscriminators::runOnFunction(Function &F) {
for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
BasicBlock *B = I;
TerminatorInst *Last = B->getTerminator();
- const MDLocation *LastDIL = Last->getDebugLoc();
+ const DILocation *LastDIL = Last->getDebugLoc();
if (!LastDIL)
continue;
for (unsigned I = 0; I < Last->getNumSuccessors(); ++I) {
BasicBlock *Succ = Last->getSuccessor(I);
Instruction *First = Succ->getFirstNonPHIOrDbgOrLifetime();
- const MDLocation *FirstDIL = First->getDebugLoc();
+ const DILocation *FirstDIL = First->getDebugLoc();
if (!FirstDIL)
continue;
@@ -197,7 +197,7 @@ bool AddDiscriminators::runOnFunction(Function &F) {
auto *File = Builder.createFile(Filename, Scope->getDirectory());
// FIXME: Calculate the discriminator here, based on local information,
- // and delete MDLocation::computeNewDiscriminator(). The current
+ // and delete DILocation::computeNewDiscriminator(). The current
// solution gives different results depending on other modules in the
// same context. All we really need is to discriminate between
// FirstDIL and LastDIL -- a local map would suffice.
@@ -205,7 +205,7 @@ bool AddDiscriminators::runOnFunction(Function &F) {
auto *NewScope =
Builder.createLexicalBlockFile(Scope, File, Discriminator);
auto *NewDIL =
- MDLocation::get(Ctx, FirstDIL->getLine(), FirstDIL->getColumn(),
+ DILocation::get(Ctx, FirstDIL->getLine(), FirstDIL->getColumn(),
NewScope, FirstDIL->getInlinedAt());
DebugLoc newDebugLoc = NewDIL;
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index a9f476a669e..4f8d1dfbe5d 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -155,9 +155,9 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
}
// Find the MDNode which corresponds to the subprogram data that described F.
-static MDSubprogram *FindSubprogram(const Function *F,
+static DISubprogram *FindSubprogram(const Function *F,
DebugInfoFinder &Finder) {
- for (MDSubprogram *Subprogram : Finder.subprograms()) {
+ for (DISubprogram *Subprogram : Finder.subprograms()) {
if (Subprogram->describes(F))
return Subprogram;
}
@@ -166,7 +166,7 @@ static MDSubprogram *FindSubprogram(const Function *F,
// Add an operand to an existing MDNode. The new operand will be added at the
// back of the operand list.
-static void AddOperand(MDCompileUnit *CU, MDSubprogramArray SPs,
+static void AddOperand(DICompileUnit *CU, DISubprogramArray SPs,
Metadata *NewSP) {
SmallVector<Metadata *, 16> NewSPs;
NewSPs.reserve(SPs.size() + 1);
@@ -183,14 +183,14 @@ static void CloneDebugInfoMetadata(Function *NewFunc, const Function *OldFunc,
DebugInfoFinder Finder;
Finder.processModule(*OldFunc->getParent());
- const MDSubprogram *OldSubprogramMDNode = FindSubprogram(OldFunc, Finder);
+ const DISubprogram *OldSubprogramMDNode = FindSubprogram(OldFunc, Finder);
if (!OldSubprogramMDNode) return;
// Ensure that OldFunc appears in the map.
// (if it's already there it must point to NewFunc anyway)
VMap[OldFunc] = NewFunc;
auto *NewSubprogram =
- cast<MDSubprogram>(MapMetadata(OldSubprogramMDNode, VMap));
+ cast<DISubprogram>(MapMetadata(OldSubprogramMDNode, VMap));
for (auto *CU : Finder.compile_units()) {
auto Subprograms = CU->getSubprograms();
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 169ebcf5bfc..97bfae1003e 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -830,17 +830,16 @@ static bool hasLifetimeMarkers(AllocaInst *AI) {
/// Rebuild the entire inlined-at chain for this instruction so that the top of
/// the chain now is inlined-at the new call site.
static DebugLoc
-updateInlinedAtInfo(DebugLoc DL, MDLocation *InlinedAtNode,
- LLVMContext &Ctx,
- DenseMap<const MDLocation *, MDLocation *> &IANodes) {
- SmallVector<MDLocation*, 3> InlinedAtLocations;
- MDLocation *Last = InlinedAtNode;
- MDLocation *CurInlinedAt = DL;
+updateInlinedAtInfo(DebugLoc DL, DILocation *InlinedAtNode, LLVMContext &Ctx,
+ DenseMap<const DILocation *, DILocation *> &IANodes) {
+ SmallVector<DILocation *, 3> InlinedAtLocations;
+ DILocation *Last = InlinedAtNode;
+ DILocation *CurInlinedAt = DL;
// Gather all the inlined-at nodes
- while (MDLocation *IA = CurInlinedAt->getInlinedAt()) {
+ while (DILocation *IA = CurInlinedAt->getInlinedAt()) {
// Skip any we've already built nodes for
- if (MDLocation *Found = IANodes[IA]) {
+ if (DILocation *Found = IANodes[IA]) {
Last = Found;
break;
}
@@ -854,8 +853,8 @@ updateInlinedAtInfo(DebugLoc DL, MDLocation *InlinedAtNode,
// map of already-constructed inlined-at nodes.
for (auto I = InlinedAtLocations.rbegin(), E = InlinedAtLocations.rend();
I != E; ++I) {
- const MDLocation *MD = *I;
- Last = IANodes[MD] = MDLocation::getDistinct(
+ const DILocation *MD = *I;
+ Last = IANodes[MD] = DILocation::getDistinct(
Ctx, MD->getLine(), MD->getColumn(), MD->getScope(), Last);
}
@@ -873,18 +872,18 @@ static void fixupLineNumbers(Function *Fn, Function::iterator FI,
return;
auto &Ctx = Fn->getContext();
- MDLocation *InlinedAtNode = TheCallDL;
+ DILocation *InlinedAtNode = TheCallDL;
// Create a unique call site, not to be confused with any other call from the
// same location.
- InlinedAtNode = MDLocation::getDistinct(
+ InlinedAtNode = DILocation::getDistinct(
Ctx, InlinedAtNode->getLine(), InlinedAtNode->getColumn(),
InlinedAtNode->getScope(), InlinedAtNode->getInlinedAt());
// Cache the inlined-at nodes as they're built so they are reused, without
// this every instruction's inlined-at chain would become distinct from each
// other.
- DenseMap<const MDLocation *, MDLocation *> IANodes;
+ DenseMap<const DILocation *, DILocation *> IANodes;
for (; FI != Fn->end(); ++FI) {
for (BasicBlock::iterator BI = FI->begin(), BE = FI->end();
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 492dc07d1eb..4d40ba842a0 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -978,7 +978,7 @@ unsigned llvm::getOrEnforceKnownAlignment(Value *V, unsigned PrefAlign,
///
/// See if there is a dbg.value intrinsic for DIVar before I.
-static bool LdStHasDebugValue(const MDLocalVariable *DIVar, Instruction *I) {
+static bool LdStHasDebugValue(const DILocalVariable *DIVar, Instruction *I) {
// Since we can't guarantee that the original dbg.declare instrinsic
// is removed by LowerDbgDeclare(), we need to make sure that we are
// not inserting the same dbg.value intrinsic over and over.
OpenPOWER on IntegriCloud