Index: src/IceGlobalInits.h |
diff --git a/src/IceGlobalInits.h b/src/IceGlobalInits.h |
index a11153648fb0d4c9a716d773e38947d15d84c9fb..ee2bc9e55a32bd3c72bdb4f05f13fefc067cefce 100644 |
--- a/src/IceGlobalInits.h |
+++ b/src/IceGlobalInits.h |
@@ -198,7 +198,7 @@ private: |
bool isPNaClABIExternalName() const { |
const char *Name = getName().c_str(); |
- return strcmp(Name, "_start") == 0 || strcmp(Name, "__pnacl_pso_root") == 0; |
+ return strcmp(Name, "_start") == 0; |
} |
bool isIntrinsicName(const GlobalContext *Ctx) const { |
@@ -416,9 +416,22 @@ public: |
/// Returns true if linkage is correct for the variable declaration. |
bool verifyLinkageCorrect(const GlobalContext *Ctx) const { |
+ if (isPNaClABIExternalName()) { |
+ return Linkage == llvm::GlobalValue::ExternalLinkage; |
+ } |
return verifyLinkageDefault(Ctx); |
} |
+ /// Returns true if the linkage was updated. |
+ bool forcePNaClABILinkage() { |
+ if (isPNaClABIExternalName()) { |
+ /// Force Linkage to be External for PNaCl ABI. |
Mark Seaborn
2016/02/26 01:56:56
Nit: Just "//"
Also you probably don't want to ca
Sean Klein
2016/02/26 02:28:06
Updated. Re: "//", I was just trying to match the
|
+ setLinkage(llvm::GlobalValue::ExternalLinkage); |
Mark Seaborn
2016/02/26 01:56:57
A comment about why this is necessary would be goo
Sean Klein
2016/02/26 02:28:06
Comment added. Where would you recommend doing tha
|
+ return true; |
+ } |
+ return false; |
+ } |
+ |
static bool classof(const GlobalDeclaration *Addr) { |
return Addr->getKind() == VariableDeclarationKind; |
} |
@@ -434,6 +447,11 @@ public: |
void discardInitializers() { Initializers = nullptr; } |
private: |
+ bool isPNaClABIExternalName() const { |
+ const char *Name = getName().c_str(); |
+ return strcmp(Name, "__pnacl_pso_root") == 0; |
+ } |
+ |
/// List of initializers for the declared variable. |
std::unique_ptr<InitializerListType> Initializers; |
bool HasInitializer; |