Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
acc8cf44
Commit
acc8cf44
authored
11 years ago
by
Bill Wendling
Browse files
Options
Downloads
Patches
Plain Diff
Add helpful accessor methods to get the specified function attribute.
llvm-svn: 187088
parent
32359897
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/include/llvm/IR/Function.h
+14
-11
14 additions, 11 deletions
llvm/include/llvm/IR/Function.h
with
14 additions
and
11 deletions
llvm/include/llvm/IR/Function.h
+
14
−
11
View file @
acc8cf44
...
...
@@ -166,37 +166,32 @@ public:
(
static_cast
<
unsigned
>
(
CC
)
<<
1
));
}
/// getAttributes - Return the attribute list for this Function.
///
/// @brief Return the attribute list for this Function.
AttributeSet
getAttributes
()
const
{
return
AttributeSets
;
}
/// setAttributes - Set the attribute list for this Function.
///
/// @brief Set the attribute list for this Function.
void
setAttributes
(
AttributeSet
attrs
)
{
AttributeSets
=
attrs
;
}
/// addFnAttr - Add function attributes to this function.
///
/// @brief Add function attributes to this function.
void
addFnAttr
(
Attribute
::
AttrKind
N
)
{
setAttributes
(
AttributeSets
.
addAttribute
(
getContext
(),
AttributeSet
::
FunctionIndex
,
N
));
}
/// removeFnAttr - Remove function attributes from this function.
///
/// @brief Remove function attributes from this function.
void
removeFnAttr
(
Attribute
::
AttrKind
N
)
{
setAttributes
(
AttributeSets
.
removeAttribute
(
getContext
(),
AttributeSet
::
FunctionIndex
,
N
));
}
/// addFnAttr - Add function attributes to this function.
///
/// @brief Add function attributes to this function.
void
addFnAttr
(
StringRef
Kind
)
{
setAttributes
(
AttributeSets
.
addAttribute
(
getContext
(),
AttributeSet
::
FunctionIndex
,
Kind
));
}
///
\
brief Return true if the function has the attribute.
///
@
brief Return true if the function has the attribute.
bool
hasFnAttribute
(
Attribute
::
AttrKind
Kind
)
const
{
return
AttributeSets
.
hasAttribute
(
AttributeSet
::
FunctionIndex
,
Kind
);
}
...
...
@@ -204,6 +199,14 @@ public:
return
AttributeSets
.
hasAttribute
(
AttributeSet
::
FunctionIndex
,
Kind
);
}
/// @brief Return the attribute for the given attribute kind.
Attribute
getFnAttribute
(
Attribute
::
AttrKind
Kind
)
const
{
return
AttributeSets
.
getAttribute
(
AttributeSet
::
FunctionIndex
,
Kind
);
}
Attribute
getFnAttribute
(
StringRef
Kind
)
const
{
return
AttributeSets
.
getAttribute
(
AttributeSet
::
FunctionIndex
,
Kind
);
}
/// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm
/// to use during code generation.
bool
hasGC
()
const
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment