Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: src/IceGlobalInits.h

Issue 1740033002: Force __pnacl_pso_root to be an external declaration. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Removing unused argument Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/PNaClTranslator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | src/PNaClTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698