diff options
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 22 | ||||
-rw-r--r-- | lib/VMCore/Function.cpp | 16 | ||||
-rw-r--r-- | lib/VMCore/Type.cpp | 6 |
3 files changed, 22 insertions, 22 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index ad6b7e3b30..f9bac802ff 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -291,7 +291,7 @@ static void calcTypeName(const Type *Ty, if (I != FTy->param_begin()) Result += ", "; calcTypeName(*I, TypeStack, TypeNames, Result); - if (Attrs && Attrs->getParamAttrs(Idx) != NoAttributeSet) { + if (Attrs && Attrs->getParamAttrs(Idx) != ParamAttr::None) { Result += + " "; Result += Attrs->getParamAttrsTextByIndex(Idx); } @@ -302,7 +302,7 @@ static void calcTypeName(const Type *Ty, Result += "..."; } Result += ")"; - if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) { + if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) { Result += " "; Result += Attrs->getParamAttrsTextByIndex(0); } @@ -737,7 +737,7 @@ std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) { if (I != FTy->param_begin()) Out << ", "; printType(*I); - if (Attrs && Attrs->getParamAttrs(Idx) != NoAttributeSet) { + if (Attrs && Attrs->getParamAttrs(Idx) != ParamAttr::None) { Out << " " << Attrs->getParamAttrsTextByIndex(Idx); } Idx++; @@ -747,7 +747,7 @@ std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) { Out << "..."; } Out << ')'; - if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) + if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) Out << ' ' << Attrs->getParamAttrsTextByIndex(0); } else if (const StructType *STy = dyn_cast<StructType>(Ty)) { if (STy->isPacked()) @@ -974,7 +974,7 @@ void AssemblyWriter::printFunction(const Function *F) { // Insert commas as we go... the first arg doesn't get a comma if (I != F->arg_begin()) Out << ", "; printArgument(I, (Attrs ? Attrs->getParamAttrs(Idx) - : uint16_t(NoAttributeSet))); + : uint16_t(ParamAttr::None))); Idx++; } @@ -984,7 +984,7 @@ void AssemblyWriter::printFunction(const Function *F) { Out << "..."; // Output varargs portion of signature! } Out << ')'; - if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) + if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) Out << ' ' << Attrs->getParamAttrsTextByIndex(0); if (F->hasSection()) Out << " section \"" << F->getSection() << '"'; @@ -1013,7 +1013,7 @@ void AssemblyWriter::printArgument(const Argument *Arg, uint16_t Attrs) { // Output type... printType(Arg->getType()); - if (Attrs != NoAttributeSet) + if (Attrs != ParamAttr::None) Out << ' ' << ParamAttrsList::getParamAttrsText(Attrs); // Output name, if available... @@ -1188,11 +1188,11 @@ void AssemblyWriter::printInstruction(const Instruction &I) { if (op > 1) Out << ','; writeOperand(I.getOperand(op), true); - if (PAL && PAL->getParamAttrs(op) != NoAttributeSet) + if (PAL && PAL->getParamAttrs(op) != ParamAttr::None) Out << " " << PAL->getParamAttrsTextByIndex(op); } Out << " )"; - if (PAL && PAL->getParamAttrs(0) != NoAttributeSet) + if (PAL && PAL->getParamAttrs(0) != ParamAttr::None) Out << ' ' << PAL->getParamAttrsTextByIndex(0); } else if (const InvokeInst *II = dyn_cast<InvokeInst>(&I)) { const PointerType *PTy = cast<PointerType>(Operand->getType()); @@ -1228,12 +1228,12 @@ void AssemblyWriter::printInstruction(const Instruction &I) { if (op > 3) Out << ','; writeOperand(I.getOperand(op), true); - if (PAL && PAL->getParamAttrs(op-2) != NoAttributeSet) + if (PAL && PAL->getParamAttrs(op-2) != ParamAttr::None) Out << " " << PAL->getParamAttrsTextByIndex(op-2); } Out << " )"; - if (PAL && PAL->getParamAttrs(0) != NoAttributeSet) + if (PAL && PAL->getParamAttrs(0) != ParamAttr::None) Out << " " << PAL->getParamAttrsTextByIndex(0); Out << "\n\t\t\tto"; writeOperand(II->getNormalDest(), true); diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index c6bf331ccb..e2a015fabb 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -81,24 +81,24 @@ ParamAttrsList::getParamAttrs(uint16_t Index) const { for (unsigned i = 0; i < limit; ++i) if (attrs[i].index == Index) return attrs[i].attrs; - return NoAttributeSet; + return ParamAttr::None; } std::string ParamAttrsList::getParamAttrsText(uint16_t Attrs) { std::string Result; - if (Attrs & ZExtAttribute) + if (Attrs & ParamAttr::ZExt) Result += "zext "; - if (Attrs & SExtAttribute) + if (Attrs & ParamAttr::SExt) Result += "sext "; - if (Attrs & NoReturnAttribute) + if (Attrs & ParamAttr::NoReturn) Result += "noreturn "; - if (Attrs & NoUnwindAttribute) + if (Attrs & ParamAttr::NoUnwind) Result += "nounwind "; - if (Attrs & InRegAttribute) + if (Attrs & ParamAttr::InReg) Result += "inreg "; - if (Attrs & StructRetAttribute) + if (Attrs & ParamAttr::StructRet) Result += "sret "; return Result; } @@ -125,7 +125,7 @@ ParamAttrsList::removeAttributes(uint16_t Index, uint16_t Attrs) { for (unsigned i = 0; i < attrs.size(); ++i) if (attrs[i].index == Index) { attrs[i].attrs &= ~Attrs; - if (attrs[i].attrs == NoAttributeSet) + if (attrs[i].attrs == ParamAttr::None) attrs.erase(&attrs[i]); return; } diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index ace800dfb2..10063126e5 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -285,7 +285,7 @@ static std::string getTypeDescription(const Type *Ty, E = FTy->param_end(); I != E; ++I) { if (I != FTy->param_begin()) Result += ", "; - if (Attrs && Attrs->getParamAttrs(Idx) != NoAttributeSet) + if (Attrs && Attrs->getParamAttrs(Idx) != ParamAttr::None) Result += Attrs->getParamAttrsTextByIndex(Idx); Idx++; Result += getTypeDescription(*I, TypeStack); @@ -295,7 +295,7 @@ static std::string getTypeDescription(const Type *Ty, Result += "..."; } Result += ")"; - if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) { + if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) { Result += " " + Attrs->getParamAttrsTextByIndex(0); } break; @@ -1121,7 +1121,7 @@ FunctionType::~FunctionType() { bool FunctionType::isStructReturn() const { if (ParamAttrs) - return ParamAttrs->paramHasAttr(1, StructRetAttribute); + return ParamAttrs->paramHasAttr(1, ParamAttr::StructRet); return false; } |