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

Unified Diff: src/IceConverter.cpp

Issue 1766233002: Subzero: Fix symbol name mangling. Make flags global. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 4 years, 9 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/IceCompileServer.cpp ('k') | src/IceELFObjectWriter.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 387128909b51d393744878ce0e9e31a119356390..e69fd7a3a15106467839b9f9a08c204e128f079c 100644
--- a/src/IceConverter.cpp
+++ b/src/IceConverter.cpp
@@ -21,6 +21,7 @@
#include "IceGlobalContext.h"
#include "IceGlobalInits.h"
#include "IceInst.h"
+#include "IceMangling.h"
#include "IceOperand.h"
#include "IceTargetLowering.h"
#include "IceTypes.h"
@@ -101,7 +102,7 @@ public:
VarMap.clear();
NodeMap.clear();
- Func->setFunctionName(F->getName());
+ Func->setFunctionName(Ice::mangleName(F->getName()));
Func->setReturnType(convertToIceType(F->getReturnType()));
Func->setInternal(F->hasInternalLinkage());
Ice::TimerMarker T(Ice::TimerStack::TT_llvmConvert, Func.get());
@@ -141,8 +142,7 @@ public:
return Ctx->getConstantExternSym(Decl->getName());
else {
const Ice::RelocOffsetT Offset = 0;
- return Ctx->getConstantSym(Offset, Decl->getName(),
- Decl->getSuppressMangling());
+ return Ctx->getConstantSym(Offset, Decl->getName());
}
} else if (const auto CI = dyn_cast<ConstantInt>(Const)) {
Ice::Type Ty = convertToIceType(CI->getType());
@@ -889,11 +889,12 @@ void Converter::installGlobalDeclarations(Module *Mod) {
E = Mod->global_end();
I != E; ++I) {
const GlobalVariable *GV = I;
- auto *Var = VariableDeclaration::create(Ctx);
- Var->setName(GV->getName());
+ constexpr bool NoSuppressMangling = false;
+ auto *Var =
+ VariableDeclaration::create(Ctx, NoSuppressMangling, GV->getLinkage());
Var->setAlignment(GV->getAlignment());
Var->setIsConstant(GV->isConstant());
- Var->setLinkage(GV->getLinkage());
+ Var->setName(GV->getName());
if (!Var->verifyLinkageCorrect(Ctx)) {
std::string Buffer;
raw_string_ostream StrBuf(Buffer);
« no previous file with comments | « src/IceCompileServer.cpp ('k') | src/IceELFObjectWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698