diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:44:32 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:44:32 +0000 | 
| commit | 5a5ac124e1efaf208671f01c46edb15f29ed2a0b (patch) | |
| tree | a6140557876943cdd800ee997c9317283394b22c /lib/Analysis/IPA/GlobalsModRef.cpp | |
| parent | f03b5bed27d0d2eafd68562ce14f8b5e3f1f0801 (diff) | |
Notes
Diffstat (limited to 'lib/Analysis/IPA/GlobalsModRef.cpp')
| -rw-r--r-- | lib/Analysis/IPA/GlobalsModRef.cpp | 14 | 
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp index 607c06810123..018ae99d6618 100644 --- a/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/lib/Analysis/IPA/GlobalsModRef.cpp @@ -96,7 +96,7 @@ namespace {      }      bool runOnModule(Module &M) override { -      InitializeAliasAnalysis(this); +      InitializeAliasAnalysis(this, &M.getDataLayout());        // Find non-addr taken globals.        AnalyzeGlobals(M); @@ -269,7 +269,7 @@ bool GlobalsModRef::AnalyzeUsesOfPointer(Value *V,      } else if (Operator::getOpcode(I) == Instruction::BitCast) {        if (AnalyzeUsesOfPointer(I, Readers, Writers, OkayStoreDest))          return true; -    } else if (CallSite CS = I) { +    } else if (auto CS = CallSite(I)) {        // Make sure that this is just the function being called, not that it is        // passing into the function.        if (!CS.isCallee(&U)) { @@ -322,7 +322,8 @@ bool GlobalsModRef::AnalyzeIndirectGlobalMemory(GlobalValue *GV) {          continue;        // Check the value being stored. -      Value *Ptr = GetUnderlyingObject(SI->getOperand(0)); +      Value *Ptr = GetUnderlyingObject(SI->getOperand(0), +                                       GV->getParent()->getDataLayout());        if (!isAllocLikeFn(Ptr, TLI))          return false;  // Too hard to analyze. @@ -481,8 +482,8 @@ AliasAnalysis::AliasResult  GlobalsModRef::alias(const Location &LocA,                       const Location &LocB) {    // Get the base object these pointers point to. -  const Value *UV1 = GetUnderlyingObject(LocA.Ptr); -  const Value *UV2 = GetUnderlyingObject(LocB.Ptr); +  const Value *UV1 = GetUnderlyingObject(LocA.Ptr, *DL); +  const Value *UV2 = GetUnderlyingObject(LocB.Ptr, *DL);    // If either of the underlying values is a global, they may be non-addr-taken    // globals, which we can answer queries about. @@ -540,8 +541,9 @@ GlobalsModRef::getModRefInfo(ImmutableCallSite CS,    // If we are asking for mod/ref info of a direct call with a pointer to a    // global we are tracking, return information if we have it. +  const DataLayout &DL = CS.getCaller()->getParent()->getDataLayout();    if (const GlobalValue *GV = -        dyn_cast<GlobalValue>(GetUnderlyingObject(Loc.Ptr))) +          dyn_cast<GlobalValue>(GetUnderlyingObject(Loc.Ptr, DL)))      if (GV->hasLocalLinkage())        if (const Function *F = CS.getCalledFunction())          if (NonAddressTakenGlobals.count(GV))  | 
