diff options
| author | Mehdi Amini <mehdi.amini@apple.com> | 2015-03-03 22:01:13 +0000 |
|---|---|---|
| committer | Mehdi Amini <mehdi.amini@apple.com> | 2015-03-03 22:01:13 +0000 |
| commit | 9a9738f6e5ecbd45bb2bc105d37570f045717152 (patch) | |
| tree | 607649fe7f2d6f54383c72f31b0b4648c7cca6e7 /llvm/lib/Analysis/IPA | |
| parent | 1dbe2e3dc4368a1985decfb180bd8e7290cd9f8e (diff) | |
| download | bcm5719-llvm-9a9738f6e5ecbd45bb2bc105d37570f045717152.tar.gz bcm5719-llvm-9a9738f6e5ecbd45bb2bc105d37570f045717152.zip | |
Remove getDataLayout() from Instruction/GlobalValue/BasicBlock/Function
Summary:
This does not conceptually belongs here. Instead provide a shortcut
getModule() that provides access to the DataLayout.
Reviewers: chandlerc, echristo
Reviewed By: echristo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8027
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231147
Diffstat (limited to 'llvm/lib/Analysis/IPA')
| -rw-r--r-- | llvm/lib/Analysis/IPA/InlineCost.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/IPA/InlineCost.cpp b/llvm/lib/Analysis/IPA/InlineCost.cpp index cd494ba84c9..eb02b80c94a 100644 --- a/llvm/lib/Analysis/IPA/InlineCost.cpp +++ b/llvm/lib/Analysis/IPA/InlineCost.cpp @@ -396,7 +396,7 @@ bool CallAnalyzer::visitBitCast(BitCastInst &I) { } bool CallAnalyzer::visitPtrToInt(PtrToIntInst &I) { - const DataLayout *DL = I.getDataLayout(); + const DataLayout *DL = I.getModule()->getDataLayout(); // Propagate constants through ptrtoint. Constant *COp = dyn_cast<Constant>(I.getOperand(0)); if (!COp) @@ -433,7 +433,7 @@ bool CallAnalyzer::visitPtrToInt(PtrToIntInst &I) { } bool CallAnalyzer::visitIntToPtr(IntToPtrInst &I) { - const DataLayout *DL = I.getDataLayout(); + const DataLayout *DL = I.getModule()->getDataLayout(); // Propagate constants through ptrtoint. Constant *COp = dyn_cast<Constant>(I.getOperand(0)); if (!COp) @@ -1333,7 +1333,7 @@ InlineCost InlineCostAnalysis::getInlineCost(CallSite CS, Function *Callee, DEBUG(llvm::dbgs() << " Analyzing call of " << Callee->getName() << "...\n"); - CallAnalyzer CA(Callee->getDataLayout(), TTIWP->getTTI(*Callee), + CallAnalyzer CA(Callee->getParent()->getDataLayout(), TTIWP->getTTI(*Callee), ACT, *Callee, Threshold); bool ShouldInline = CA.analyzeCall(CS); |

