aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-12-07 23:16:57 +0000
committerBill Wendling <isanbard@gmail.com>2012-12-07 23:16:57 +0000
commit99faa3b4ec6d03ac7808fe4ff3fbf3d04e375502 (patch)
tree6239d55788f1895cdaf8f3d0c1ed96f66902b59d /lib/VMCore
parent550f0ade457c3b042fa099ecff2c022c7ab58b1e (diff)
downloadexternal_llvm-99faa3b4ec6d03ac7808fe4ff3fbf3d04e375502.zip
external_llvm-99faa3b4ec6d03ac7808fe4ff3fbf3d04e375502.tar.gz
external_llvm-99faa3b4ec6d03ac7808fe4ff3fbf3d04e375502.tar.bz2
s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169651 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/AsmWriter.cpp6
-rw-r--r--lib/VMCore/Attributes.cpp32
-rw-r--r--lib/VMCore/Core.cpp14
-rw-r--r--lib/VMCore/Function.cpp4
-rw-r--r--lib/VMCore/Instructions.cpp16
-rw-r--r--lib/VMCore/Module.cpp10
-rw-r--r--lib/VMCore/Verifier.cpp10
7 files changed, 46 insertions, 46 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index ffbdd2e..4ad08ff 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -1556,7 +1556,7 @@ void AssemblyWriter::printFunction(const Function *F) {
}
FunctionType *FT = F->getFunctionType();
- const AttrListPtr &Attrs = F->getAttributes();
+ const AttributeSet &Attrs = F->getAttributes();
Attributes RetAttrs = Attrs.getRetAttributes();
if (RetAttrs.hasAttributes())
Out << Attrs.getRetAttributes().getAsString() << ' ';
@@ -1849,7 +1849,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
PointerType *PTy = cast<PointerType>(Operand->getType());
FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
Type *RetTy = FTy->getReturnType();
- const AttrListPtr &PAL = CI->getAttributes();
+ const AttributeSet &PAL = CI->getAttributes();
if (PAL.getRetAttributes().hasAttributes())
Out << ' ' << PAL.getRetAttributes().getAsString();
@@ -1882,7 +1882,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
PointerType *PTy = cast<PointerType>(Operand->getType());
FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
Type *RetTy = FTy->getReturnType();
- const AttrListPtr &PAL = II->getAttributes();
+ const AttributeSet &PAL = II->getAttributes();
// Print the calling convention being used.
if (II->getCallingConv() != CallingConv::C) {
diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp
index 108e222..751ff85 100644
--- a/lib/VMCore/Attributes.cpp
+++ b/lib/VMCore/Attributes.cpp
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
//
// This file implements the Attributes, AttributeImpl, AttrBuilder,
-// AttributeListImpl, and AttrListPtr classes.
+// AttributeListImpl, and AttributeSet classes.
//
//===----------------------------------------------------------------------===//
@@ -355,11 +355,11 @@ uint64_t AttributesImpl::getStackAlignment() const {
// AttributeListImpl Definition
//===----------------------------------------------------------------------===//
-AttrListPtr AttrListPtr::get(LLVMContext &C,
+AttributeSet AttributeSet::get(LLVMContext &C,
ArrayRef<AttributeWithIndex> Attrs) {
// If there are no attributes then return a null AttributesList pointer.
if (Attrs.empty())
- return AttrListPtr();
+ return AttributeSet();
#ifndef NDEBUG
for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
@@ -387,14 +387,14 @@ AttrListPtr AttrListPtr::get(LLVMContext &C,
}
// Return the AttributesList that we found or created.
- return AttrListPtr(PA);
+ return AttributeSet(PA);
}
//===----------------------------------------------------------------------===//
-// AttrListPtr Method Implementations
+// AttributeSet Method Implementations
//===----------------------------------------------------------------------===//
-const AttrListPtr &AttrListPtr::operator=(const AttrListPtr &RHS) {
+const AttributeSet &AttributeSet::operator=(const AttributeSet &RHS) {
if (AttrList == RHS.AttrList) return *this;
AttrList = RHS.AttrList;
@@ -404,13 +404,13 @@ const AttrListPtr &AttrListPtr::operator=(const AttrListPtr &RHS) {
/// getNumSlots - Return the number of slots used in this attribute list.
/// This is the number of arguments that have an attribute set on them
/// (including the function itself).
-unsigned AttrListPtr::getNumSlots() const {
+unsigned AttributeSet::getNumSlots() const {
return AttrList ? AttrList->Attrs.size() : 0;
}
/// getSlot - Return the AttributeWithIndex at the specified slot. This
/// holds a number plus a set of attributes.
-const AttributeWithIndex &AttrListPtr::getSlot(unsigned Slot) const {
+const AttributeWithIndex &AttributeSet::getSlot(unsigned Slot) const {
assert(AttrList && Slot < AttrList->Attrs.size() && "Slot # out of range!");
return AttrList->Attrs[Slot];
}
@@ -418,7 +418,7 @@ const AttributeWithIndex &AttrListPtr::getSlot(unsigned Slot) const {
/// getAttributes - The attributes for the specified index are returned.
/// Attributes for the result are denoted with Idx = 0. Function notes are
/// denoted with idx = ~0.
-Attributes AttrListPtr::getAttributes(unsigned Idx) const {
+Attributes AttributeSet::getAttributes(unsigned Idx) const {
if (AttrList == 0) return Attributes();
const SmallVector<AttributeWithIndex, 4> &Attrs = AttrList->Attrs;
@@ -431,7 +431,7 @@ Attributes AttrListPtr::getAttributes(unsigned Idx) const {
/// hasAttrSomewhere - Return true if the specified attribute is set for at
/// least one parameter or for the return value.
-bool AttrListPtr::hasAttrSomewhere(Attributes::AttrVal Attr) const {
+bool AttributeSet::hasAttrSomewhere(Attributes::AttrVal Attr) const {
if (AttrList == 0) return false;
const SmallVector<AttributeWithIndex, 4> &Attrs = AttrList->Attrs;
@@ -442,17 +442,17 @@ bool AttrListPtr::hasAttrSomewhere(Attributes::AttrVal Attr) const {
return false;
}
-unsigned AttrListPtr::getNumAttrs() const {
+unsigned AttributeSet::getNumAttrs() const {
return AttrList ? AttrList->Attrs.size() : 0;
}
-Attributes &AttrListPtr::getAttributesAtIndex(unsigned i) const {
+Attributes &AttributeSet::getAttributesAtIndex(unsigned i) const {
assert(AttrList && "Trying to get an attribute from an empty list!");
assert(i < AttrList->Attrs.size() && "Index out of range!");
return AttrList->Attrs[i].Attrs;
}
-AttrListPtr AttrListPtr::addAttr(LLVMContext &C, unsigned Idx,
+AttributeSet AttributeSet::addAttr(LLVMContext &C, unsigned Idx,
Attributes Attrs) const {
Attributes OldAttrs = getAttributes(Idx);
#ifndef NDEBUG
@@ -497,7 +497,7 @@ AttrListPtr AttrListPtr::addAttr(LLVMContext &C, unsigned Idx,
return get(C, NewAttrList);
}
-AttrListPtr AttrListPtr::removeAttr(LLVMContext &C, unsigned Idx,
+AttributeSet AttributeSet::removeAttr(LLVMContext &C, unsigned Idx,
Attributes Attrs) const {
#ifndef NDEBUG
// FIXME it is not obvious how this should work for alignment.
@@ -505,7 +505,7 @@ AttrListPtr AttrListPtr::removeAttr(LLVMContext &C, unsigned Idx,
assert(!Attrs.hasAttribute(Attributes::Alignment) &&
"Attempt to exclude alignment!");
#endif
- if (AttrList == 0) return AttrListPtr();
+ if (AttrList == 0) return AttributeSet();
Attributes OldAttrs = getAttributes(Idx);
AttrBuilder NewAttrs =
@@ -536,7 +536,7 @@ AttrListPtr AttrListPtr::removeAttr(LLVMContext &C, unsigned Idx,
return get(C, NewAttrList);
}
-void AttrListPtr::dump() const {
+void AttributeSet::dump() const {
dbgs() << "PAL[ ";
for (unsigned i = 0; i < getNumSlots(); ++i) {
const AttributeWithIndex &PAWI = getSlot(i);
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp
index a15b987..0fb37cb 100644
--- a/lib/VMCore/Core.cpp
+++ b/lib/VMCore/Core.cpp
@@ -1380,27 +1380,27 @@ void LLVMSetGC(LLVMValueRef Fn, const char *GC) {
void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) {
Function *Func = unwrap<Function>(Fn);
- const AttrListPtr PAL = Func->getAttributes();
+ const AttributeSet PAL = Func->getAttributes();
AttrBuilder B(PA);
- const AttrListPtr PALnew =
- PAL.addAttr(Func->getContext(), AttrListPtr::FunctionIndex,
+ const AttributeSet PALnew =
+ PAL.addAttr(Func->getContext(), AttributeSet::FunctionIndex,
Attributes::get(Func->getContext(), B));
Func->setAttributes(PALnew);
}
void LLVMRemoveFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) {
Function *Func = unwrap<Function>(Fn);
- const AttrListPtr PAL = Func->getAttributes();
+ const AttributeSet PAL = Func->getAttributes();
AttrBuilder B(PA);
- const AttrListPtr PALnew =
- PAL.removeAttr(Func->getContext(), AttrListPtr::FunctionIndex,
+ const AttributeSet PALnew =
+ PAL.removeAttr(Func->getContext(), AttributeSet::FunctionIndex,
Attributes::get(Func->getContext(), B));
Func->setAttributes(PALnew);
}
LLVMAttribute LLVMGetFunctionAttr(LLVMValueRef Fn) {
Function *Func = unwrap<Function>(Fn);
- const AttrListPtr PAL = Func->getAttributes();
+ const AttributeSet PAL = Func->getAttributes();
Attributes attr = PAL.getFnAttributes();
return (LLVMAttribute)attr.Raw();
}
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 860787e..9b2046b 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -249,13 +249,13 @@ void Function::dropAllReferences() {
}
void Function::addAttribute(unsigned i, Attributes attr) {
- AttrListPtr PAL = getAttributes();
+ AttributeSet PAL = getAttributes();
PAL = PAL.addAttr(getContext(), i, attr);
setAttributes(PAL);
}
void Function::removeAttribute(unsigned i, Attributes attr) {
- AttrListPtr PAL = getAttributes();
+ AttributeSet PAL = getAttributes();
PAL = PAL.removeAttr(getContext(), i, attr);
setAttributes(PAL);
}
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 25c8e76..ded9534 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -331,23 +331,23 @@ CallInst::CallInst(const CallInst &CI)
}
void CallInst::addAttribute(unsigned i, Attributes attr) {
- AttrListPtr PAL = getAttributes();
+ AttributeSet PAL = getAttributes();
PAL = PAL.addAttr(getContext(), i, attr);
setAttributes(PAL);
}
void CallInst::removeAttribute(unsigned i, Attributes attr) {
- AttrListPtr PAL = getAttributes();
+ AttributeSet PAL = getAttributes();
PAL = PAL.removeAttr(getContext(), i, attr);
setAttributes(PAL);
}
bool CallInst::hasFnAttr(Attributes::AttrVal A) const {
- if (AttributeList.getParamAttributes(AttrListPtr::FunctionIndex)
+ if (AttributeList.getParamAttributes(AttributeSet::FunctionIndex)
.hasAttribute(A))
return true;
if (const Function *F = getCalledFunction())
- return F->getParamAttributes(AttrListPtr::FunctionIndex).hasAttribute(A);
+ return F->getParamAttributes(AttributeSet::FunctionIndex).hasAttribute(A);
return false;
}
@@ -572,11 +572,11 @@ void InvokeInst::setSuccessorV(unsigned idx, BasicBlock *B) {
}
bool InvokeInst::hasFnAttr(Attributes::AttrVal A) const {
- if (AttributeList.getParamAttributes(AttrListPtr::FunctionIndex).
+ if (AttributeList.getParamAttributes(AttributeSet::FunctionIndex).
hasAttribute(A))
return true;
if (const Function *F = getCalledFunction())
- return F->getParamAttributes(AttrListPtr::FunctionIndex).hasAttribute(A);
+ return F->getParamAttributes(AttributeSet::FunctionIndex).hasAttribute(A);
return false;
}
@@ -589,13 +589,13 @@ bool InvokeInst::paramHasAttr(unsigned i, Attributes::AttrVal A) const {
}
void InvokeInst::addAttribute(unsigned i, Attributes attr) {
- AttrListPtr PAL = getAttributes();
+ AttributeSet PAL = getAttributes();
PAL = PAL.addAttr(getContext(), i, attr);
setAttributes(PAL);
}
void InvokeInst::removeAttribute(unsigned i, Attributes attr) {
- AttrListPtr PAL = getAttributes();
+ AttributeSet PAL = getAttributes();
PAL = PAL.removeAttr(getContext(), i, attr);
setAttributes(PAL);
}
diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp
index 05e549f..78f4eb8 100644
--- a/lib/VMCore/Module.cpp
+++ b/lib/VMCore/Module.cpp
@@ -137,7 +137,7 @@ void Module::getMDKindNames(SmallVectorImpl<StringRef> &Result) const {
//
Constant *Module::getOrInsertFunction(StringRef Name,
FunctionType *Ty,
- AttrListPtr AttributeList) {
+ AttributeSet AttributeList) {
// See if we have a definition for the specified function already.
GlobalValue *F = getNamedValue(Name);
if (F == 0) {
@@ -170,7 +170,7 @@ Constant *Module::getOrInsertFunction(StringRef Name,
Constant *Module::getOrInsertTargetIntrinsic(StringRef Name,
FunctionType *Ty,
- AttrListPtr AttributeList) {
+ AttributeSet AttributeList) {
// See if we have a definition for the specified function already.
GlobalValue *F = getNamedValue(Name);
if (F == 0) {
@@ -187,7 +187,7 @@ Constant *Module::getOrInsertTargetIntrinsic(StringRef Name,
Constant *Module::getOrInsertFunction(StringRef Name,
FunctionType *Ty) {
- return getOrInsertFunction(Name, Ty, AttrListPtr());
+ return getOrInsertFunction(Name, Ty, AttributeSet());
}
// getOrInsertFunction - Look up the specified function in the module symbol
@@ -196,7 +196,7 @@ Constant *Module::getOrInsertFunction(StringRef Name,
// arguments, which makes it easier for clients to use.
//
Constant *Module::getOrInsertFunction(StringRef Name,
- AttrListPtr AttributeList,
+ AttributeSet AttributeList,
Type *RetTy, ...) {
va_list Args;
va_start(Args, RetTy);
@@ -229,7 +229,7 @@ Constant *Module::getOrInsertFunction(StringRef Name,
// Build the function type and chain to the other getOrInsertFunction...
return getOrInsertFunction(Name,
FunctionType::get(RetTy, ArgTys, false),
- AttrListPtr());
+ AttributeSet());
}
// getFunction - Look up the specified function in the module symbol table.
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index d21074b..0c9493e 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -299,7 +299,7 @@ namespace {
SmallVectorImpl<Type*> &ArgTys);
void VerifyParameterAttrs(Attributes Attrs, Type *Ty,
bool isReturnValue, const Value *V);
- void VerifyFunctionAttrs(FunctionType *FT, const AttrListPtr &Attrs,
+ void VerifyFunctionAttrs(FunctionType *FT, const AttributeSet &Attrs,
const Value *V);
void WriteValue(const Value *V) {
@@ -585,7 +585,7 @@ void Verifier::VerifyParameterAttrs(Attributes Attrs, Type *Ty,
// VerifyFunctionAttrs - Check parameter attributes against a function type.
// The value V is printed in error messages.
void Verifier::VerifyFunctionAttrs(FunctionType *FT,
- const AttrListPtr &Attrs,
+ const AttributeSet &Attrs,
const Value *V) {
if (Attrs.isEmpty())
return;
@@ -651,7 +651,7 @@ void Verifier::VerifyFunctionAttrs(FunctionType *FT,
"'noinline and alwaysinline' are incompatible!", V);
}
-static bool VerifyAttributeCount(const AttrListPtr &Attrs, unsigned Params) {
+static bool VerifyAttributeCount(const AttributeSet &Attrs, unsigned Params) {
if (Attrs.isEmpty())
return true;
@@ -687,7 +687,7 @@ void Verifier::visitFunction(Function &F) {
Assert1(!F.hasStructRetAttr() || F.getReturnType()->isVoidTy(),
"Invalid struct return type!", &F);
- const AttrListPtr &Attrs = F.getAttributes();
+ const AttributeSet &Attrs = F.getAttributes();
Assert1(VerifyAttributeCount(Attrs, FT->getNumParams()),
"Attributes after last parameter!", &F);
@@ -1200,7 +1200,7 @@ void Verifier::VerifyCallSite(CallSite CS) {
"Call parameter type does not match function signature!",
CS.getArgument(i), FTy->getParamType(i), I);
- const AttrListPtr &Attrs = CS.getAttributes();
+ const AttributeSet &Attrs = CS.getAttributes();
Assert1(VerifyAttributeCount(Attrs, CS.arg_size()),
"Attributes after last parameter!", I);