diff options
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r-- | llvm/lib/VMCore/AsmWriter.cpp | 12 | ||||
-rw-r--r-- | llvm/lib/VMCore/Attributes.cpp (renamed from llvm/lib/VMCore/ParameterAttributes.cpp) | 30 | ||||
-rw-r--r-- | llvm/lib/VMCore/Function.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/VMCore/Instructions.cpp | 14 | ||||
-rw-r--r-- | llvm/lib/VMCore/Verifier.cpp | 18 |
5 files changed, 42 insertions, 42 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index 32c468b4809..68335974d45 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -1006,7 +1006,7 @@ public: void write(const Type *Ty) { printType(Ty); } void writeOperand(const Value *Op, bool PrintType); - void writeParamOperand(const Value *Operand, ParameterAttributes Attrs); + void writeParamOperand(const Value *Operand, Attributes Attrs); const Module* getModule() { return TheModule; } @@ -1016,7 +1016,7 @@ private: void printGlobal(const GlobalVariable *GV); void printAlias(const GlobalAlias *GV); void printFunction(const Function *F); - void printArgument(const Argument *FA, ParameterAttributes Attrs); + void printArgument(const Argument *FA, Attributes Attrs); void printBasicBlock(const BasicBlock *BB); void printInstruction(const Instruction &I); @@ -1126,7 +1126,7 @@ void AssemblyWriter::writeOperand(const Value *Operand, bool PrintType) { } void AssemblyWriter::writeParamOperand(const Value *Operand, - ParameterAttributes Attrs) { + Attributes Attrs) { if (Operand == 0) { Out << "<null operand!>"; } else { @@ -1386,7 +1386,7 @@ void AssemblyWriter::printFunction(const Function *F) { // Output type... printType(FT->getParamType(i)); - ParameterAttributes ArgAttrs = Attrs.getParamAttrs(i+1); + Attributes ArgAttrs = Attrs.getParamAttrs(i+1); if (ArgAttrs != ParamAttr::None) Out << ' ' << ParamAttr::getAsString(ArgAttrs); } @@ -1398,7 +1398,7 @@ void AssemblyWriter::printFunction(const Function *F) { Out << "..."; // Output varargs portion of signature! } Out << ')'; - ParameterAttributes RetAttrs = Attrs.getParamAttrs(0); + Attributes RetAttrs = Attrs.getParamAttrs(0); if (RetAttrs != ParamAttr::None) Out << ' ' << ParamAttr::getAsString(Attrs.getParamAttrs(0)); if (F->hasSection()) @@ -1454,7 +1454,7 @@ void AssemblyWriter::printFunction(const Function *F) { /// the function. Simply print it out /// void AssemblyWriter::printArgument(const Argument *Arg, - ParameterAttributes Attrs) { + Attributes Attrs) { // Output type... printType(Arg->getType()); diff --git a/llvm/lib/VMCore/ParameterAttributes.cpp b/llvm/lib/VMCore/Attributes.cpp index f1a38c4a91a..690eb485a7a 100644 --- a/llvm/lib/VMCore/ParameterAttributes.cpp +++ b/llvm/lib/VMCore/Attributes.cpp @@ -1,4 +1,4 @@ -//===-- ParameterAttributes.cpp - Implement ParamAttrsList ----------------===// +//===-- Attributes.cpp - Implement ParamAttrsList ----------------===// // // The LLVM Compiler Infrastructure // @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/ParameterAttributes.h" +#include "llvm/Attributes.h" #include "llvm/Type.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/FoldingSet.h" @@ -23,7 +23,7 @@ using namespace llvm; // ParamAttr Function Definitions //===----------------------------------------------------------------------===// -std::string ParamAttr::getAsString(ParameterAttributes Attrs) { +std::string ParamAttr::getAsString(Attributes Attrs) { std::string Result; if (Attrs & ParamAttr::ZExt) Result += "zeroext "; @@ -57,8 +57,8 @@ std::string ParamAttr::getAsString(ParameterAttributes Attrs) { return Result; } -ParameterAttributes ParamAttr::typeIncompatible(const Type *Ty) { - ParameterAttributes Incompatible = None; +Attributes ParamAttr::typeIncompatible(const Type *Ty) { + Attributes Incompatible = None; if (!Ty->isInteger()) // Attributes that only apply to integers. @@ -187,7 +187,7 @@ const ParamAttrsWithIndex &PAListPtr::getSlot(unsigned Slot) const { /// getParamAttrs - The parameter attributes for the specified parameter are /// returned. Parameters for the result are denoted with Idx = 0. /// Function notes are denoted with idx = ~0. -ParameterAttributes PAListPtr::getParamAttrs(unsigned Idx) const { +Attributes PAListPtr::getParamAttrs(unsigned Idx) const { if (PAList == 0) return ParamAttr::None; const SmallVector<ParamAttrsWithIndex, 4> &Attrs = PAList->Attrs; @@ -199,7 +199,7 @@ ParameterAttributes PAListPtr::getParamAttrs(unsigned Idx) const { /// hasAttrSomewhere - Return true if the specified attribute is set for at /// least one parameter or for the return value. -bool PAListPtr::hasAttrSomewhere(ParameterAttributes Attr) const { +bool PAListPtr::hasAttrSomewhere(Attributes Attr) const { if (PAList == 0) return false; const SmallVector<ParamAttrsWithIndex, 4> &Attrs = PAList->Attrs; @@ -210,18 +210,18 @@ bool PAListPtr::hasAttrSomewhere(ParameterAttributes Attr) const { } -PAListPtr PAListPtr::addAttr(unsigned Idx, ParameterAttributes Attrs) const { - ParameterAttributes OldAttrs = getParamAttrs(Idx); +PAListPtr PAListPtr::addAttr(unsigned Idx, Attributes Attrs) const { + Attributes OldAttrs = getParamAttrs(Idx); #ifndef NDEBUG // FIXME it is not obvious how this should work for alignment. // For now, say we can't change a known alignment. - ParameterAttributes OldAlign = OldAttrs & ParamAttr::Alignment; - ParameterAttributes NewAlign = Attrs & ParamAttr::Alignment; + Attributes OldAlign = OldAttrs & ParamAttr::Alignment; + Attributes NewAlign = Attrs & ParamAttr::Alignment; assert((!OldAlign || !NewAlign || OldAlign == NewAlign) && "Attempt to change alignment!"); #endif - ParameterAttributes NewAttrs = OldAttrs | Attrs; + Attributes NewAttrs = OldAttrs | Attrs; if (NewAttrs == OldAttrs) return *this; @@ -251,7 +251,7 @@ PAListPtr PAListPtr::addAttr(unsigned Idx, ParameterAttributes Attrs) const { return get(&NewAttrList[0], NewAttrList.size()); } -PAListPtr PAListPtr::removeAttr(unsigned Idx, ParameterAttributes Attrs) const { +PAListPtr PAListPtr::removeAttr(unsigned Idx, Attributes Attrs) const { #ifndef NDEBUG // FIXME it is not obvious how this should work for alignment. // For now, say we can't pass in alignment, which no current use does. @@ -259,8 +259,8 @@ PAListPtr PAListPtr::removeAttr(unsigned Idx, ParameterAttributes Attrs) const { #endif if (PAList == 0) return PAListPtr(); - ParameterAttributes OldAttrs = getParamAttrs(Idx); - ParameterAttributes NewAttrs = OldAttrs & ~Attrs; + Attributes OldAttrs = getParamAttrs(Idx); + Attributes NewAttrs = OldAttrs & ~Attrs; if (NewAttrs == OldAttrs) return *this; diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp index 93e39df8307..d1e577ed7d8 100644 --- a/llvm/lib/VMCore/Function.cpp +++ b/llvm/lib/VMCore/Function.cpp @@ -112,12 +112,12 @@ bool Argument::hasStructRetAttr() const { } /// addAttr - Add a ParamAttr to an argument -void Argument::addAttr(ParameterAttributes attr) { +void Argument::addAttr(Attributes attr) { getParent()->addParamAttr(getArgNo() + 1, attr); } /// removeAttr - Remove a ParamAttr from an argument -void Argument::removeAttr(ParameterAttributes attr) { +void Argument::removeAttr(Attributes attr) { getParent()->removeParamAttr(getArgNo() + 1, attr); } @@ -229,13 +229,13 @@ void Function::dropAllReferences() { BasicBlocks.clear(); // Delete all basic blocks... } -void Function::addParamAttr(unsigned i, ParameterAttributes attr) { +void Function::addParamAttr(unsigned i, Attributes attr) { PAListPtr PAL = getParamAttrs(); PAL = PAL.addAttr(i, attr); setParamAttrs(PAL); } -void Function::removeParamAttr(unsigned i, ParameterAttributes attr) { +void Function::removeParamAttr(unsigned i, Attributes attr) { PAListPtr PAL = getParamAttrs(); PAL = PAL.removeAttr(i, attr); setParamAttrs(PAL); @@ -356,7 +356,7 @@ const FunctionType *Intrinsic::getType(ID id, const Type **Tys, } PAListPtr Intrinsic::getParamAttrs(ID id) { - ParameterAttributes Attr = ParamAttr::None; + Attributes Attr = ParamAttr::None; #define GET_INTRINSIC_ATTRIBUTES #include "llvm/Intrinsics.gen" diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index 881c23975a1..1366d304d42 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -53,7 +53,7 @@ void CallSite::setParamAttrs(const PAListPtr &PAL) { else cast<InvokeInst>(I)->setParamAttrs(PAL); } -bool CallSite::paramHasAttr(uint16_t i, ParameterAttributes attr) const { +bool CallSite::paramHasAttr(uint16_t i, Attributes attr) const { if (CallInst *CI = dyn_cast<CallInst>(I)) return CI->paramHasAttr(i, attr); else @@ -402,19 +402,19 @@ CallInst::CallInst(const CallInst &CI) OL[i] = InOL[i]; } -void CallInst::addParamAttr(unsigned i, ParameterAttributes attr) { +void CallInst::addParamAttr(unsigned i, Attributes attr) { PAListPtr PAL = getParamAttrs(); PAL = PAL.addAttr(i, attr); setParamAttrs(PAL); } -void CallInst::removeParamAttr(unsigned i, ParameterAttributes attr) { +void CallInst::removeParamAttr(unsigned i, Attributes attr) { PAListPtr PAL = getParamAttrs(); PAL = PAL.removeAttr(i, attr); setParamAttrs(PAL); } -bool CallInst::paramHasAttr(unsigned i, ParameterAttributes attr) const { +bool CallInst::paramHasAttr(unsigned i, Attributes attr) const { if (ParamAttrs.paramHasAttr(i, attr)) return true; if (const Function *F = getCalledFunction()) @@ -473,7 +473,7 @@ void InvokeInst::setSuccessorV(unsigned idx, BasicBlock *B) { return setSuccessor(idx, B); } -bool InvokeInst::paramHasAttr(unsigned i, ParameterAttributes attr) const { +bool InvokeInst::paramHasAttr(unsigned i, Attributes attr) const { if (ParamAttrs.paramHasAttr(i, attr)) return true; if (const Function *F = getCalledFunction()) @@ -481,13 +481,13 @@ bool InvokeInst::paramHasAttr(unsigned i, ParameterAttributes attr) const { return false; } -void InvokeInst::addParamAttr(unsigned i, ParameterAttributes attr) { +void InvokeInst::addParamAttr(unsigned i, Attributes attr) { PAListPtr PAL = getParamAttrs(); PAL = PAL.addAttr(i, attr); setParamAttrs(PAL); } -void InvokeInst::removeParamAttr(unsigned i, ParameterAttributes attr) { +void InvokeInst::removeParamAttr(unsigned i, Attributes attr) { PAListPtr PAL = getParamAttrs(); PAL = PAL.removeAttr(i, attr); setParamAttrs(PAL); diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index f4a59c25242..046c4463acd 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/lib/VMCore/Verifier.cpp @@ -268,7 +268,7 @@ namespace { void VerifyCallSite(CallSite CS); void VerifyIntrinsicPrototype(Intrinsic::ID ID, Function *F, unsigned Count, ...); - void VerifyAttrs(ParameterAttributes Attrs, const Type *Ty, + void VerifyAttrs(Attributes Attrs, const Type *Ty, bool isReturnValue, const Value *V); void VerifyFunctionAttrs(const FunctionType *FT, const PAListPtr &Attrs, const Value *V); @@ -406,33 +406,33 @@ void Verifier::verifyTypeSymbolTable(TypeSymbolTable &ST) { // VerifyAttrs - Check the given parameter attributes for an argument or return // value of the specified type. The value V is printed in error messages. -void Verifier::VerifyAttrs(ParameterAttributes Attrs, const Type *Ty, +void Verifier::VerifyAttrs(Attributes Attrs, const Type *Ty, bool isReturnValue, const Value *V) { if (Attrs == ParamAttr::None) return; if (isReturnValue) { - ParameterAttributes RetI = Attrs & ParamAttr::ParameterOnly; + Attributes RetI = Attrs & ParamAttr::ParameterOnly; Assert1(!RetI, "Attribute " + ParamAttr::getAsString(RetI) + " does not apply to return values!", V); } else { - ParameterAttributes ParmI = Attrs & ParamAttr::ReturnOnly; + Attributes ParmI = Attrs & ParamAttr::ReturnOnly; Assert1(!ParmI, "Attribute " + ParamAttr::getAsString(ParmI) + " only applies to return values!", V); } for (unsigned i = 0; i < array_lengthof(ParamAttr::MutuallyIncompatible); ++i) { - ParameterAttributes MutI = Attrs & ParamAttr::MutuallyIncompatible[i]; + Attributes MutI = Attrs & ParamAttr::MutuallyIncompatible[i]; Assert1(!(MutI & (MutI - 1)), "Attributes " + ParamAttr::getAsString(MutI) + " are incompatible!", V); } - ParameterAttributes TypeI = Attrs & ParamAttr::typeIncompatible(Ty); + Attributes TypeI = Attrs & ParamAttr::typeIncompatible(Ty); Assert1(!TypeI, "Wrong type for attribute " + ParamAttr::getAsString(TypeI), V); - ParameterAttributes ByValI = Attrs & ParamAttr::ByVal; + Attributes ByValI = Attrs & ParamAttr::ByVal; if (const PointerType *PTy = dyn_cast<PointerType>(Ty)) { Assert1(!ByValI || PTy->getElementType()->isSized(), "Attribute " + ParamAttr::getAsString(ByValI) + @@ -976,11 +976,11 @@ void Verifier::VerifyCallSite(CallSite CS) { if (FTy->isVarArg()) // Check attributes on the varargs part. for (unsigned Idx = 1 + FTy->getNumParams(); Idx <= CS.arg_size(); ++Idx) { - ParameterAttributes Attr = Attrs.getParamAttrs(Idx); + Attributes Attr = Attrs.getParamAttrs(Idx); VerifyAttrs(Attr, CS.getArgument(Idx-1)->getType(), false, I); - ParameterAttributes VArgI = Attr & ParamAttr::VarArgsIncompatible; + Attributes VArgI = Attr & ParamAttr::VarArgsIncompatible; Assert1(!VArgI, "Attribute " + ParamAttr::getAsString(VArgI) + " cannot be used for vararg call arguments!", I); } |