Add a getOffsetOf, for building a target-independent expression for
[oota-llvm.git] / include / llvm / Constants.h
index e26bb62c357ba4d774b7c59a0b75c8a8a9ab71ce..a66773c0b5301d89fb64abf661ee75480e44f3d9 100644 (file)
@@ -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);