diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-27 22:43:04 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-27 22:43:04 +0000 |
commit | 4bbe9db48fc636fb8a32199065217a9c6fc03e91 (patch) | |
tree | 2226eb4492d55d6a1aaed29cf609890a7e0a3628 /llvm/lib/IR/Attributes.cpp | |
parent | 038d24f90cc57d92172a736977a7cb5e024fe6bb (diff) | |
download | bcm5719-llvm-4bbe9db48fc636fb8a32199065217a9c6fc03e91.tar.gz bcm5719-llvm-4bbe9db48fc636fb8a32199065217a9c6fc03e91.zip |
Add special 'get' methods to create an Attribute with an alignment. Also do some random cleanup. No functionality change.
llvm-svn: 173635
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index b982b05d656..1b057bbbb97 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -62,6 +62,17 @@ Attribute Attribute::get(LLVMContext &Context, AttrBuilder &B) { return Attribute(PA); } +Attribute Attribute::getWithAlignment(LLVMContext &Context, uint64_t Align) { + AttrBuilder B; + return get(Context, B.addAlignmentAttr(Align)); +} + +Attribute Attribute::getWithStackAlignment(LLVMContext &Context, + uint64_t Align) { + AttrBuilder B; + return get(Context, B.addStackAlignmentAttr(Align)); +} + bool Attribute::hasAttribute(AttrKind Val) const { return pImpl && pImpl->hasAttribute(Val); } |