[LVI] Add Datalayout to the class LazyValueInfo since all its Impls require it. NFC

llvm-svn: 297583
This commit is contained in:
Anna Thomas 2017-03-12 14:06:41 +00:00
parent 473b75c3d5
commit a10e3e4c34
2 changed files with 6 additions and 4 deletions

View File

@ -32,6 +32,7 @@ namespace llvm {
class LazyValueInfo {
friend class LazyValueInfoWrapperPass;
AssumptionCache *AC = nullptr;
const DataLayout *DL = nullptr;
class TargetLibraryInfo *TLI = nullptr;
DominatorTree *DT = nullptr;
void *PImpl = nullptr;
@ -40,16 +41,17 @@ class LazyValueInfo {
public:
~LazyValueInfo();
LazyValueInfo() {}
LazyValueInfo(AssumptionCache *AC_, TargetLibraryInfo *TLI_,
LazyValueInfo(AssumptionCache *AC_, const DataLayout *DL_, TargetLibraryInfo *TLI_,
DominatorTree *DT_)
: AC(AC_), TLI(TLI_), DT(DT_) {}
: AC(AC_), DL(DL_), TLI(TLI_), DT(DT_) {}
LazyValueInfo(LazyValueInfo &&Arg)
: AC(Arg.AC), TLI(Arg.TLI), DT(Arg.DT), PImpl(Arg.PImpl) {
: AC(Arg.AC), DL(Arg.DL), TLI(Arg.TLI), DT(Arg.DT), PImpl(Arg.PImpl) {
Arg.PImpl = nullptr;
}
LazyValueInfo &operator=(LazyValueInfo &&Arg) {
releaseMemory();
AC = Arg.AC;
DL = Arg.DL;
TLI = Arg.TLI;
DT = Arg.DT;
PImpl = Arg.PImpl;

View File

@ -1554,7 +1554,7 @@ LazyValueInfo LazyValueAnalysis::run(Function &F, FunctionAnalysisManager &FAM)
auto &TLI = FAM.getResult<TargetLibraryAnalysis>(F);
auto *DT = FAM.getCachedResult<DominatorTreeAnalysis>(F);
return LazyValueInfo(&AC, &TLI, DT);
return LazyValueInfo(&AC, &F.getParent()->getDataLayout(), &TLI, DT);
}
/// Returns true if we can statically tell that this value will never be a