diff options
Diffstat (limited to 'lib/CodeGen/Analysis.cpp')
| -rw-r--r-- | lib/CodeGen/Analysis.cpp | 18 | 
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/CodeGen/Analysis.cpp b/lib/CodeGen/Analysis.cpp index 447f3981b521..5162ad762e73 100644 --- a/lib/CodeGen/Analysis.cpp +++ b/lib/CodeGen/Analysis.cpp @@ -21,7 +21,7 @@  #include "llvm/Module.h"  #include "llvm/CodeGen/MachineFunction.h"  #include "llvm/CodeGen/SelectionDAG.h" -#include "llvm/Target/TargetData.h" +#include "llvm/DataLayout.h"  #include "llvm/Target/TargetLowering.h"  #include "llvm/Target/TargetOptions.h"  #include "llvm/Support/ErrorHandling.h" @@ -79,7 +79,7 @@ void llvm::ComputeValueVTs(const TargetLowering &TLI, Type *Ty,                             uint64_t StartingOffset) {    // Given a struct type, recursively traverse the elements.    if (StructType *STy = dyn_cast<StructType>(Ty)) { -    const StructLayout *SL = TLI.getTargetData()->getStructLayout(STy); +    const StructLayout *SL = TLI.getDataLayout()->getStructLayout(STy);      for (StructType::element_iterator EB = STy->element_begin(),                                        EI = EB,                                        EE = STy->element_end(); @@ -91,7 +91,7 @@ void llvm::ComputeValueVTs(const TargetLowering &TLI, Type *Ty,    // Given an array type, recursively traverse the elements.    if (ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {      Type *EltTy = ATy->getElementType(); -    uint64_t EltSize = TLI.getTargetData()->getTypeAllocSize(EltTy); +    uint64_t EltSize = TLI.getDataLayout()->getTypeAllocSize(EltTy);      for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i)        ComputeValueVTs(TLI, EltTy, ValueVTs, Offsets,                        StartingOffset + i * EltSize); @@ -314,11 +314,13 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, Attributes CalleeRetAttr,    // the return. Ignore noalias because it doesn't affect the call sequence.    const Function *F = ExitBB->getParent();    Attributes CallerRetAttr = F->getAttributes().getRetAttributes(); -  if ((CalleeRetAttr ^ CallerRetAttr) & ~Attribute::NoAlias) +  if (AttrBuilder(CalleeRetAttr).removeAttribute(Attributes::NoAlias) != +      AttrBuilder(CallerRetAttr).removeAttribute(Attributes::NoAlias))      return false;    // It's not safe to eliminate the sign / zero extension of the return value. -  if ((CallerRetAttr & Attribute::ZExt) || (CallerRetAttr & Attribute::SExt)) +  if (CallerRetAttr.hasAttribute(Attributes::ZExt) || +      CallerRetAttr.hasAttribute(Attributes::SExt))      return false;    // Otherwise, make sure the unmodified return value of I is the return value. @@ -354,11 +356,13 @@ bool llvm::isInTailCallPosition(SelectionDAG &DAG, SDNode *Node,    // Conservatively require the attributes of the call to match those of    // the return. Ignore noalias because it doesn't affect the call sequence.    Attributes CallerRetAttr = F->getAttributes().getRetAttributes(); -  if (CallerRetAttr & ~Attribute::NoAlias) +  if (AttrBuilder(CallerRetAttr) +      .removeAttribute(Attributes::NoAlias).hasAttributes())      return false;    // It's not safe to eliminate the sign / zero extension of the return value. -  if ((CallerRetAttr & Attribute::ZExt) || (CallerRetAttr & Attribute::SExt)) +  if (CallerRetAttr.hasAttribute(Attributes::ZExt) || +      CallerRetAttr.hasAttribute(Attributes::SExt))      return false;    // Check if the only use is a function return node.  | 
