aboutsummaryrefslogtreecommitdiffstats
path: root/lib/IR
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-27 22:43:04 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-27 22:43:04 +0000
commitc08a5ef6581f2c7550e92d31f63cd65ec29c39e0 (patch)
tree121609d00713195ea54144a8e971145da96bde8e /lib/IR
parent970a479c02a418726950580e13136acd2a2dc13f (diff)
downloadexternal_llvm-c08a5ef6581f2c7550e92d31f63cd65ec29c39e0.zip
external_llvm-c08a5ef6581f2c7550e92d31f63cd65ec29c39e0.tar.gz
external_llvm-c08a5ef6581f2c7550e92d31f63cd65ec29c39e0.tar.bz2
Add special 'get' methods to create an Attribute with an alignment. Also do some random cleanup. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/Attributes.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index b982b05..1b057bb 100644
--- a/lib/IR/Attributes.cpp
+++ b/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);
}