summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 831737d)
raw | patch | inline | side by side (parent: 831737d)
author | Bill Wendling <isanbard@gmail.com> | |
Sun, 30 Dec 2012 12:45:13 +0000 (12:45 +0000) | ||
committer | Bill Wendling <isanbard@gmail.com> | |
Sun, 30 Dec 2012 12:45:13 +0000 (12:45 +0000) |
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171255 91177308-0d34-0410-b5e6-96231b3b80d8
index ba04098dfe77cb208321dc601703ed648cf4c50a..1a65950aa80a3ba535fea4d6d92ef2d0a7156f6d 100644 (file)
--- a/include/llvm/Function.h
+++ b/include/llvm/Function.h
void setGC(const char *Str);
void clearGC();
-
/// getRetAttributes - Return the return attributes for querying.
Attribute getRetAttributes() const {
return AttributeList.getRetAttributes();
}
- /// getParamAttributes - Return the parameter attributes for querying.
- Attribute getParamAttributes(unsigned Idx) const {
- return AttributeList.getParamAttributes(Idx);
- }
-
/// addAttribute - adds the attribute to the list of attributes.
void addAttribute(unsigned i, Attribute attr);
/// @brief Determine if the function returns a structure through first
/// pointer argument.
bool hasStructRetAttr() const {
- return getParamAttributes(1).hasAttribute(Attribute::StructRet);
+ return AttributeList.getParamAttributes(1).
+ hasAttribute(Attribute::StructRet);
}
/// @brief Determine if the parameter does not alias other parameters.
/// @param n The parameter to check. 1 is the first parameter, 0 is the return
bool doesNotAlias(unsigned n) const {
- return getParamAttributes(n).hasAttribute(Attribute::NoAlias);
+ return AttributeList.getParamAttributes(n).
+ hasAttribute(Attribute::NoAlias);
}
void setDoesNotAlias(unsigned n) {
addAttribute(n, Attribute::get(getContext(), Attribute::NoAlias));
/// @brief Determine if the parameter can be captured.
/// @param n The parameter to check. 1 is the first parameter, 0 is the return
bool doesNotCapture(unsigned n) const {
- return getParamAttributes(n).hasAttribute(Attribute::NoCapture);
+ return AttributeList.getParamAttributes(n).
+ hasAttribute(Attribute::NoCapture);
}
void setDoesNotCapture(unsigned n) {
addAttribute(n, Attribute::get(getContext(), Attribute::NoCapture));
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 23f277ae80eb3edddc13b915f7f73ab2e5c8d5e2..98a8d32df37a02166724d51d1d819b8c999de120 100644 (file)
unsigned OriginalAlignment =
TD->getABITypeAlignment(ArgTy);
- if (F.getParamAttributes(Idx).hasAttribute(Attribute::ZExt))
+ if (F.getAttributes().hasAttribute(Idx, Attribute::ZExt))
Flags.setZExt();
- if (F.getParamAttributes(Idx).hasAttribute(Attribute::SExt))
+ if (F.getAttributes().hasAttribute(Idx, Attribute::SExt))
Flags.setSExt();
- if (F.getParamAttributes(Idx).hasAttribute(Attribute::InReg))
+ if (F.getAttributes().hasAttribute(Idx, Attribute::InReg))
Flags.setInReg();
- if (F.getParamAttributes(Idx).hasAttribute(Attribute::StructRet))
+ if (F.getAttributes().hasAttribute(Idx, Attribute::StructRet))
Flags.setSRet();
- if (F.getParamAttributes(Idx).hasAttribute(Attribute::ByVal)) {
+ if (F.getAttributes().hasAttribute(Idx, Attribute::ByVal)) {
Flags.setByVal();
PointerType *Ty = cast<PointerType>(I->getType());
Type *ElementTy = Ty->getElementType();
FrameAlign = TLI.getByValTypeAlignment(ElementTy);
Flags.setByValAlign(FrameAlign);
}
- if (F.getParamAttributes(Idx).hasAttribute(Attribute::Nest))
+ if (F.getAttributes().hasAttribute(Idx, Attribute::Nest))
Flags.setNest();
Flags.setOrigAlign(OriginalAlignment);
if (!I->use_empty()) {
ISD::NodeType AssertOp = ISD::DELETED_NODE;
- if (F.getParamAttributes(Idx).hasAttribute(Attribute::SExt))
+ if (F.getAttributes().hasAttribute(Idx, Attribute::SExt))
AssertOp = ISD::AssertSext;
- else if (F.getParamAttributes(Idx).hasAttribute(Attribute::ZExt))
+ else if (F.getAttributes().hasAttribute(Idx, Attribute::ZExt))
AssertOp = ISD::AssertZext;
ArgValues.push_back(getCopyFromParts(DAG, dl, &InVals[i],
diff --git a/lib/Target/Hexagon/HexagonRemoveSZExtArgs.cpp b/lib/Target/Hexagon/HexagonRemoveSZExtArgs.cpp
index 455b60ee5ae9c47ce0e9e84a9baaaa5e6167ade7..986bb37b97d3d6d50dcfb22024ff3afe48be7960 100644 (file)
unsigned Idx = 1;
for (Function::arg_iterator AI = F.arg_begin(), AE = F.arg_end(); AI != AE;
++AI, ++Idx) {
- if (F.getParamAttributes(Idx).hasAttribute(Attribute::SExt)) {
+ if (F.getAttributes().hasAttribute(Idx, Attribute::SExt)) {
Argument* Arg = AI;
if (!isa<PointerType>(Arg->getType())) {
for (Instruction::use_iterator UI = Arg->use_begin();
index 8fb19b09eedcfc657ec5c3bb73a9c27ea779b7c3..5ae12c272611dd037f932e28dfa78f445bcfba1a 100644 (file)
SmallPtrSet<Argument*, 8> ArgsToPromote;
SmallPtrSet<Argument*, 8> ByValArgsToTransform;
for (unsigned i = 0; i != PointerArgs.size(); ++i) {
- bool isByVal=F->getParamAttributes(PointerArgs[i].second+1).
- hasAttribute(Attribute::ByVal);
+ bool isByVal=F->getAttributes().
+ hasAttribute(PointerArgs[i].second+1, Attribute::ByVal);
Argument *PtrArg = PointerArgs[i].first;
Type *AgTy = cast<PointerType>(PtrArg->getType())->getElementType();
index 5ff088e7f5697979ea1e71d4761209f42eacbcd1..3cae4d4837c93f78c1dde26eb968cf724f06c3e4 100644 (file)
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
/// in its containing function.
bool Argument::hasByValAttr() const {
if (!getType()->isPointerTy()) return false;
- return getParent()->getParamAttributes(getArgNo()+1).
- hasAttribute(Attribute::ByVal);
+ return getParent()->getAttributes().
+ hasAttribute(getArgNo()+1, Attribute::ByVal);
}
unsigned Argument::getParamAlignment() const {
/// it in its containing function.
bool Argument::hasNestAttr() const {
if (!getType()->isPointerTy()) return false;
- return getParent()->getParamAttributes(getArgNo()+1).
- hasAttribute(Attribute::Nest);
+ return getParent()->getAttributes().
+ hasAttribute(getArgNo()+1, Attribute::Nest);
}
/// hasNoAliasAttr - Return true if this argument has the noalias attribute on
/// it in its containing function.
bool Argument::hasNoAliasAttr() const {
if (!getType()->isPointerTy()) return false;
- return getParent()->getParamAttributes(getArgNo()+1).
- hasAttribute(Attribute::NoAlias);
+ return getParent()->getAttributes().
+ hasAttribute(getArgNo()+1, Attribute::NoAlias);
}
/// hasNoCaptureAttr - Return true if this argument has the nocapture attribute
/// on it in its containing function.
bool Argument::hasNoCaptureAttr() const {
if (!getType()->isPointerTy()) return false;
- return getParent()->getParamAttributes(getArgNo()+1).
- hasAttribute(Attribute::NoCapture);
+ return getParent()->getAttributes().
+ hasAttribute(getArgNo()+1, Attribute::NoCapture);
}
/// hasSRetAttr - Return true if this argument has the sret attribute on
if (!getType()->isPointerTy()) return false;
if (this != getParent()->arg_begin())
return false; // StructRet param must be first param
- return getParent()->getParamAttributes(1).
- hasAttribute(Attribute::StructRet);
+ return getParent()->getAttributes().
+ hasAttribute(1, Attribute::StructRet);
}
/// addAttr - Add a Attribute to an argument
index bb659fc69e9733eba14a251d792c22e7c223a3e7..23db33646e58235f3ed5523d3714cd519108e4a8 100644 (file)
.hasAttribute(A))
return true;
if (const Function *F = getCalledFunction())
- return F->getParamAttributes(AttributeSet::FunctionIndex).hasAttribute(A);
+ return F->getAttributes().hasAttribute(AttributeSet::FunctionIndex, A);
return false;
}
if (AttributeList.getParamAttributes(i).hasAttribute(A))
return true;
if (const Function *F = getCalledFunction())
- return F->getParamAttributes(i).hasAttribute(A);
+ return F->getAttributes().hasAttribute(i, A);
return false;
}
hasAttribute(A))
return true;
if (const Function *F = getCalledFunction())
- return F->getParamAttributes(AttributeSet::FunctionIndex).hasAttribute(A);
+ return F->getAttributes().hasAttribute(AttributeSet::FunctionIndex, A);
return false;
}
if (AttributeList.getParamAttributes(i).hasAttribute(A))
return true;
if (const Function *F = getCalledFunction())
- return F->getParamAttributes(i).hasAttribute(A);
+ return F->getAttributes().hasAttribute(i, A);
return false;
}