aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/ASTContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/ASTContext.h')
-rw-r--r--include/clang/AST/ASTContext.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index 684feb2402..a01199d4b2 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -394,8 +394,8 @@ public:
return getTypeInfo(T).first;
}
- /// getTypeAlign - Return the alignment of the specified type, in bits. This
- /// method does not work on incomplete types.
+ /// getTypeAlign - Return the ABI-specified alignment of a type, in bits.
+ /// This method does not work on incomplete types.
unsigned getTypeAlign(QualType T) {
return getTypeInfo(T).second;
}
@@ -403,6 +403,12 @@ public:
return getTypeInfo(T).second;
}
+ /// getPreferredTypeAlign - Return the "preferred" alignment of the specified
+ /// type for the current target in bits. This can be different than the ABI
+ /// alignment in cases where it is beneficial for performance to overalign
+ /// a data type.
+ unsigned getPreferredTypeAlign(const Type *T);
+
/// getDeclAlign - Return the alignment of the specified decl that should be
/// returned by __alignof(). Note that bitfields do not have a valid
/// alignment, so this method will assert on them.