| Index: src/IceGlobalContext.cpp
|
| diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
|
| index 349db7cc4ff4bb7db75c5233ce3d3ec1f318a91b..678c521ddf462f48f2362c9de99903a90283410b 100644
|
| --- a/src/IceGlobalContext.cpp
|
| +++ b/src/IceGlobalContext.cpp
|
| @@ -23,6 +23,7 @@
|
| #include "IceGlobalInits.h"
|
| #include "IceLiveness.h"
|
| #include "IceOperand.h"
|
| +#include "IceRevision.h"
|
| #include "IceTargetLowering.h"
|
| #include "IceTimerTree.h"
|
| #include "IceTypes.def"
|
| @@ -357,6 +358,18 @@ GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit, Ostream *OsError,
|
| #undef X
|
|
|
| TargetLowering::staticInit(this);
|
| +
|
| + if (getFlags().getEmitRevision()) {
|
| + // Embed the Subzero revision into the compiled binary by creating a special
|
| + // global variable initialized with the revision string.
|
| + auto *Revision = VariableDeclaration::create(&Globals, true);
|
| + Revision->setName(this, "__Sz_revision");
|
| + Revision->setIsConstant(true);
|
| + const char *RevisionString = getSubzeroRevision();
|
| + Revision->addInitializer(VariableDeclaration::DataInitializer::create(
|
| + &Globals, RevisionString, 1 + strlen(RevisionString)));
|
| + Globals.push_back(Revision);
|
| + }
|
| }
|
|
|
| void GlobalContext::translateFunctions() {
|
|
|