Index: src/IceGlobalInits.h |
diff --git a/src/IceGlobalInits.h b/src/IceGlobalInits.h |
index 711a563d88430f2cdcedd57ed2fa5f4ffaac417b..9c201fabdf3b8a30f5a0ef096832a5a6e6d6c041 100644 |
--- a/src/IceGlobalInits.h |
+++ b/src/IceGlobalInits.h |
@@ -21,6 +21,7 @@ |
#include "IceDefs.h" |
#include "IceGlobalContext.h" |
+#include "IceOperand.h" |
Jim Stichnoth
2016/02/04 16:25:26
alphabetize includes
John
2016/02/04 16:37:02
Done.
|
#include "IceIntrinsics.h" |
#include "IceTypes.h" |
@@ -318,11 +319,19 @@ public: |
public: |
static std::unique_ptr<RelocInitializer> |
- create(const GlobalDeclaration *Declaration, RelocOffsetT Offset) { |
- return makeUnique<RelocInitializer>(Declaration, Offset); |
+ create(const GlobalDeclaration *Declaration, |
+ const RelocOffsetArray &OffsetExpr) { |
+ return makeUnique<RelocInitializer>(Declaration, OffsetExpr); |
+ } |
+ |
+ RelocOffsetT getOffset() const { |
+ RelocOffsetT Offset = 0; |
+ for (const auto *RelocOffset : OffsetExpr) { |
+ Offset += RelocOffset->getOffset(); |
+ } |
+ return Offset; |
} |
- RelocOffsetT getOffset() const { return Offset; } |
const GlobalDeclaration *getDeclaration() const { return Declaration; } |
SizeT getNumBytes() const final { return RelocAddrSize; } |
void dump(GlobalContext *Ctx, Ostream &Stream) const final; |
@@ -334,13 +343,16 @@ public: |
private: |
ENABLE_MAKE_UNIQUE; |
- RelocInitializer(const GlobalDeclaration *Declaration, RelocOffsetT Offset) |
- : Initializer(RelocInitializerKind), Declaration(Declaration), |
- Offset(Offset) {} // The global declaration used in the relocation. |
+ RelocInitializer(const GlobalDeclaration *Declaration, |
+ const RelocOffsetArray &OffsetExpr) |
+ : Initializer(RelocInitializerKind), |
+ Declaration( |
+ Declaration), // The global declaration used in the relocation. |
Jim Stichnoth
2016/02/04 16:25:26
optional: ick, can the comment be shortened or som
Karl
2016/02/04 16:29:30
Can this be made less ugly.
John
2016/02/04 16:37:02
Done.
|
+ OffsetExpr(OffsetExpr) {} |
const GlobalDeclaration *Declaration; |
/// The offset to add to the relocation. |
- const RelocOffsetT Offset; |
+ const RelocOffsetArray OffsetExpr; |
}; |
/// Models the list of initializers. |