diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-16 21:26:11 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-16 21:26:11 +0000 |
commit | 3778f21b17e675c2fd1600901361fa4a73888eba (patch) | |
tree | e975284da0629a07af5221e21342860c2678c4c4 /include | |
parent | face41a4de759e881bea1769d86c4cfda2cd1545 (diff) | |
download | external_llvm-3778f21b17e675c2fd1600901361fa4a73888eba.zip external_llvm-3778f21b17e675c2fd1600901361fa4a73888eba.tar.gz external_llvm-3778f21b17e675c2fd1600901361fa4a73888eba.tar.bz2 |
Add a getOffsetOf, for building a target-independent expression for
offsetof, similar to getSizeOf for sizeof.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79208 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Constants.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index e26bb62..a66773c 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -602,6 +602,11 @@ public: /// independent way (Note: the return type is an i64). /// static Constant* getSizeOf(const Type* Ty); + + /// getOffsetOf constant expr - computes the offset of a field in a target + /// independent way (Note: the return type is an i64). + /// + static Constant* getOffsetOf(const StructType* Ty, unsigned FieldNo); static Constant* getNeg(Constant* C); static Constant* getFNeg(Constant* C); |