diff options
author | Duncan Sands <baldrick@free.fr> | 2008-01-29 06:23:44 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-01-29 06:23:44 +0000 |
commit | d102593b425da27fa96359300ff0e3d547d0ac8d (patch) | |
tree | 1e1c378b5a251371647bbaac306a9a2ea3873d21 /include/llvm/Target/TargetData.h | |
parent | a34d8a0d83bb39f4058e5dea4558e69cc4eda37c (diff) |
Use getPreferredAlignmentLog or getPreferredAlignment
to get the alignment of global variables, rather than
using hand-made versions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetData.h')
-rw-r--r-- | include/llvm/Target/TargetData.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index 0bcd4019b7..2d9dc076e2 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -200,7 +200,7 @@ public: /// getPrefTypeAlignment - Return the preferred stack/global alignment for - /// the specified type. + /// the specified type. This is always at least as good as the ABI alignment. unsigned char getPrefTypeAlignment(const Type *Ty) const; /// getPreferredTypeAlignmentShift - Return the preferred alignment for the @@ -230,6 +230,11 @@ public: /// avoid a dangling pointer in this cache. void InvalidateStructLayoutInfo(const StructType *Ty) const; + /// getPreferredAlignment - Return the preferred alignment of the specified + /// global. This includes an explicitly requested alignment (if the global + /// has one). + unsigned getPreferredAlignment(const GlobalVariable *GV) const; + /// getPreferredAlignmentLog - Return the preferred alignment of the /// specified global, returned in log form. This includes an explicitly /// requested alignment (if the global has one). |