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

Unified Diff: src/IceConverter.cpp

Issue 1387963002: Make sure that all globals are internal, except for "start" functions. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix new tests. Created 5 years, 2 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 | « src/IceClFlags.cpp ('k') | src/IceELFSection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceConverter.cpp
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp
index a4d4f53366289d7edadcfd69164d93fe4992aeec..349fde54f676cabee6ff034bd856d333db6d1439 100644
--- a/src/IceConverter.cpp
+++ b/src/IceConverter.cpp
@@ -867,6 +867,13 @@ void Converter::installGlobalDeclarations(Module *Mod) {
FunctionDeclaration *IceFunc = FunctionDeclaration::create(
Ctx, Signature, Func.getCallingConv(), Func.getLinkage(), Func.empty());
IceFunc->setName(Func.getName());
+ if (!IceFunc->verifyLinkageCorrect(Ctx)) {
+ std::string Buffer;
+ raw_string_ostream StrBuf(Buffer);
+ StrBuf << "Function " << IceFunc->getName()
+ << " has incorrect linkage: " << IceFunc->getLinkageName();
+ report_fatal_error(StrBuf.str());
+ }
GlobalDeclarationMap[&Func] = IceFunc;
}
// Install global variable declarations.
@@ -879,6 +886,13 @@ void Converter::installGlobalDeclarations(Module *Mod) {
Var->setAlignment(GV->getAlignment());
Var->setIsConstant(GV->isConstant());
Var->setLinkage(GV->getLinkage());
+ if (!Var->verifyLinkageCorrect(Ctx)) {
+ std::string Buffer;
+ raw_string_ostream StrBuf(Buffer);
+ StrBuf << "Global " << Var->getName()
+ << " has incorrect linkage: " << Var->getLinkageName();
+ report_fatal_error(StrBuf.str());
+ }
GlobalDeclarationMap[GV] = Var;
}
}
« no previous file with comments | « src/IceClFlags.cpp ('k') | src/IceELFSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698