Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add some convenience methods for querying function attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175469 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
isanbard committed Feb 18, 2013
1 parent 9d7c53a commit 5b0a8d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/llvm/IR/Function.h
Expand Up @@ -175,6 +175,14 @@ class Function : public GlobalValue,
AttributeSet::FunctionIndex, N));
}

/// \brief Return true if the function has the attribute.
bool hasFnAttribute(Attribute::AttrKind Kind) const {
return AttributeSets.hasAttribute(AttributeSet::FunctionIndex, Kind);
}
bool hasFnAttribute(StringRef Kind) const {
return AttributeSets.hasAttribute(AttributeSet::FunctionIndex, Kind);
}

/// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm
/// to use during code generation.
bool hasGC() const;
Expand Down

0 comments on commit 5b0a8d9

Please sign in to comment.