mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Add 'empty' query methods to the builder and use them in the verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174832 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b7cfac32f3
commit
87de71cb9f
@ -471,6 +471,8 @@ public:
|
|||||||
const_iterator begin() const { return Attrs.begin(); }
|
const_iterator begin() const { return Attrs.begin(); }
|
||||||
const_iterator end() const { return Attrs.end(); }
|
const_iterator end() const { return Attrs.end(); }
|
||||||
|
|
||||||
|
bool empty() const { return Attrs.empty(); }
|
||||||
|
|
||||||
// Iterators for target-dependent attributes.
|
// Iterators for target-dependent attributes.
|
||||||
typedef std::pair<std::string, std::string> td_type;
|
typedef std::pair<std::string, std::string> td_type;
|
||||||
typedef std::map<std::string, std::string>::iterator td_iterator;
|
typedef std::map<std::string, std::string>::iterator td_iterator;
|
||||||
@ -482,6 +484,8 @@ public:
|
|||||||
td_const_iterator td_begin() const { return TargetDepAttrs.begin(); }
|
td_const_iterator td_begin() const { return TargetDepAttrs.begin(); }
|
||||||
td_const_iterator td_end() const { return TargetDepAttrs.end(); }
|
td_const_iterator td_end() const { return TargetDepAttrs.end(); }
|
||||||
|
|
||||||
|
bool td_empty() const { return TargetDepAttrs.empty(); }
|
||||||
|
|
||||||
/// \brief Remove attributes that are used on functions only.
|
/// \brief Remove attributes that are used on functions only.
|
||||||
void removeFunctionOnlyAttrs() {
|
void removeFunctionOnlyAttrs() {
|
||||||
removeAttribute(Attribute::NoReturn)
|
removeAttribute(Attribute::NoReturn)
|
||||||
|
@ -744,7 +744,7 @@ void Verifier::VerifyFunctionAttrs(FunctionType *FT,
|
|||||||
|
|
||||||
AttrBuilder NotFn(Attrs, AttributeSet::FunctionIndex);
|
AttrBuilder NotFn(Attrs, AttributeSet::FunctionIndex);
|
||||||
NotFn.removeFunctionOnlyAttrs();
|
NotFn.removeFunctionOnlyAttrs();
|
||||||
Assert1(!NotFn.hasAttributes(), "Attribute '" +
|
Assert1(NotFn.empty(), "Attributes '" +
|
||||||
AttributeSet::get(V->getContext(),
|
AttributeSet::get(V->getContext(),
|
||||||
AttributeSet::FunctionIndex,
|
AttributeSet::FunctionIndex,
|
||||||
NotFn).getAsString(AttributeSet::FunctionIndex) +
|
NotFn).getAsString(AttributeSet::FunctionIndex) +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user