From: Bill Wendling Date: Tue, 9 Oct 2012 09:17:28 +0000 (+0000) Subject: Use the enum value of the attributes when removing them from the attributes builder. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c1b324ccf37a0c1001bce1958bb601e9cdd083c;p=platform%2Fupstream%2Fllvm.git Use the enum value of the attributes when removing them from the attributes builder. llvm-svn: 165495 --- diff --git a/llvm/include/llvm/Attributes.h b/llvm/include/llvm/Attributes.h index 00eb325..11c0437 100644 --- a/llvm/include/llvm/Attributes.h +++ b/llvm/include/llvm/Attributes.h @@ -212,35 +212,6 @@ public: void addStackAlignmentAttr(unsigned Align); void removeAttributes(const Attributes &A); - - void removeAddressSafetyAttr(); - void removeAlwaysInlineAttr(); - void removeByValAttr(); - void removeInlineHintAttr(); - void removeInRegAttr(); - void removeNakedAttr(); - void removeNestAttr(); - void removeNoAliasAttr(); - void removeNoCaptureAttr(); - void removeNoImplicitFloatAttr(); - void removeNoInlineAttr(); - void removeNonLazyBindAttr(); - void removeNoRedZoneAttr(); - void removeNoReturnAttr(); - void removeNoUnwindAttr(); - void removeOptimizeForSizeAttr(); - void removeReadNoneAttr(); - void removeReadOnlyAttr(); - void removeReturnsTwiceAttr(); - void removeSExtAttr(); - void removeStackProtectAttr(); - void removeStackProtectReqAttr(); - void removeStructRetAttr(); - void removeUWTableAttr(); - void removeZExtAttr(); - - void removeAlignmentAttr(); - void removeStackAlignmentAttr(); }; /// get - Return a uniquified Attributes object. This takes the uniquified diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 76ac0f7..86bc7ac 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -2757,7 +2757,7 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) { // If the alignment was parsed as an attribute, move to the alignment field. if (FuncAttrs.hasAlignmentAttr()) { Alignment = FuncAttrs.getAlignment(); - FuncAttrs.removeAlignmentAttr(); + FuncAttrs.removeAttribute(Attributes::Alignment); } // Okay, if we got here, the function is syntactically valid. Convert types diff --git a/llvm/lib/VMCore/Attributes.cpp b/llvm/lib/VMCore/Attributes.cpp index 6e68973..f6906d7 100644 --- a/llvm/lib/VMCore/Attributes.cpp +++ b/llvm/lib/VMCore/Attributes.cpp @@ -236,89 +236,6 @@ void Attributes::Builder::removeAttributes(const Attributes &A) { Bits &= ~A.Raw(); } -void Attributes::Builder::removeAddressSafetyAttr() { - Bits &= ~Attribute::AddressSafety_i; -} -void Attributes::Builder::removeAlwaysInlineAttr() { - Bits &= ~Attribute::AlwaysInline_i; -} -void Attributes::Builder::removeByValAttr() { - Bits &= ~Attribute::ByVal_i; -} -void Attributes::Builder::removeInlineHintAttr() { - Bits &= ~Attribute::InlineHint_i; -} -void Attributes::Builder::removeInRegAttr() { - Bits &= ~Attribute::InReg_i; -} -void Attributes::Builder::removeNakedAttr() { - Bits &= ~Attribute::Naked_i; -} -void Attributes::Builder::removeNestAttr() { - Bits &= ~Attribute::Nest_i; -} -void Attributes::Builder::removeNoAliasAttr() { - Bits &= ~Attribute::NoAlias_i; -} -void Attributes::Builder::removeNoCaptureAttr() { - Bits &= ~Attribute::NoCapture_i; -} -void Attributes::Builder::removeNoImplicitFloatAttr() { - Bits &= ~Attribute::NoImplicitFloat_i; -} -void Attributes::Builder::removeNoInlineAttr() { - Bits &= ~Attribute::NoInline_i; -} -void Attributes::Builder::removeNonLazyBindAttr() { - Bits &= ~Attribute::NonLazyBind_i; -} -void Attributes::Builder::removeNoRedZoneAttr() { - Bits &= ~Attribute::NoRedZone_i; -} -void Attributes::Builder::removeNoReturnAttr() { - Bits &= ~Attribute::NoReturn_i; -} -void Attributes::Builder::removeNoUnwindAttr() { - Bits &= ~Attribute::NoUnwind_i; -} -void Attributes::Builder::removeOptimizeForSizeAttr() { - Bits &= ~Attribute::OptimizeForSize_i; -} -void Attributes::Builder::removeReadNoneAttr() { - Bits &= ~Attribute::ReadNone_i; -} -void Attributes::Builder::removeReadOnlyAttr() { - Bits &= ~Attribute::ReadOnly_i; -} -void Attributes::Builder::removeReturnsTwiceAttr() { - Bits &= ~Attribute::ReturnsTwice_i; -} -void Attributes::Builder::removeSExtAttr() { - Bits &= ~Attribute::SExt_i; -} -void Attributes::Builder::removeStackProtectAttr() { - Bits &= ~Attribute::StackProtect_i; -} -void Attributes::Builder::removeStackProtectReqAttr() { - Bits &= ~Attribute::StackProtectReq_i; -} -void Attributes::Builder::removeStructRetAttr() { - Bits &= ~Attribute::StructRet_i; -} -void Attributes::Builder::removeUWTableAttr() { - Bits &= ~Attribute::UWTable_i; -} -void Attributes::Builder::removeZExtAttr() { - Bits &= ~Attribute::ZExt_i; -} - -void Attributes::Builder::removeAlignmentAttr() { - Bits &= ~Attribute::Alignment_i; -} -void Attributes::Builder::removeStackAlignmentAttr() { - Bits &= ~Attribute::StackAlignment_i; -} - bool Attributes::Builder::hasAttributes() const { return Bits != 0; }