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

Unified Diff: src/PNaClTranslator.cpp

Issue 667763002: Fix handling of relocation names, so that prefix mangling works. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 6 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
Index: src/PNaClTranslator.cpp
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index 6bef5701f15d366124692131f3c53b6472f8d3a3..46bbdb8c677148e8839e96d4b9964890d6da9ae6 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -286,22 +286,30 @@ public:
// If reached, no such constant exists, create one.
// TODO(kschimpf) Don't get addresses of intrinsic function declarations.
- std::string Name;
+ Ice::GlobalDeclaration *Decl = nullptr;
unsigned FcnIDSize = FunctionDeclarationList.size();
if (ID < FcnIDSize) {
- Name = FunctionDeclarationList[ID]->getName();
+ Decl = FunctionDeclarationList[ID];
} else if ((ID - FcnIDSize) < VariableDeclarations.size()) {
- Name = VariableDeclarations[ID - FcnIDSize]->getName();
+ Decl = VariableDeclarations[ID - FcnIDSize];
+ }
+ std::string Name;
+ bool SuppressMangling;
+ if (Decl) {
+ Name = Decl->getName();
+ SuppressMangling = Decl->getSuppressMangling();
} else {
std::string Buffer;
raw_string_ostream StrBuf(Buffer);
StrBuf << "Reference to global not defined: " << ID;
Error(StrBuf.str());
+ // TODO(kschimpf) Remove error recovery once implementation complete.
Name = "??";
+ SuppressMangling = false;
}
const Ice::RelocOffsetT Offset = 0;
C = getTranslator().getContext()->getConstantSym(
- getIcePointerType(), Offset, Name);
+ getIcePointerType(), Offset, Name, SuppressMangling);
ValueIDConstants[ID] = C;
return C;
}

Powered by Google App Engine
This is Rietveld 408576698