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

Unified Diff: src/IceFixups.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: Cleanup 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
Index: src/IceFixups.cpp
diff --git a/src/IceFixups.cpp b/src/IceFixups.cpp
index fc8069735ff2a8083fb43dabe4bc76fc375f30e6..b4a5b2b6b443a3c57da996933e5bdb8ba6654493 100644
--- a/src/IceFixups.cpp
+++ b/src/IceFixups.cpp
@@ -29,18 +29,15 @@ RelocOffsetT AssemblerFixup::offset() const {
return addend_;
}
-IceString AssemblerFixup::symbol(const GlobalContext *Ctx,
- const Assembler *Asm) const {
+IceString AssemblerFixup::symbol(const Assembler *Asm) const {
std::string Buffer;
llvm::raw_string_ostream Str(Buffer);
const Constant *C = value_;
assert(!isNullSymbol());
if (const auto *CR = llvm::dyn_cast<ConstantRelocatable>(C)) {
- if (CR->getSuppressMangling())
- Str << CR->getName();
- else
- Str << Ctx->mangleName(CR->getName());
- if (Asm && !Asm->fixupIsPCRel(kind()) && Ctx->getFlags().getUseNonsfi() &&
+ Str << CR->getName();
+ if (Asm && !Asm->fixupIsPCRel(kind()) &&
+ GlobalContext::getFlags().getUseNonsfi() &&
CR->getName() != GlobalOffsetTable) {
// TODO(jpp): remove the special GOT test.
Str << "@GOTOFF";
@@ -49,7 +46,7 @@ IceString AssemblerFixup::symbol(const GlobalContext *Ctx,
// NOTE: currently only float/doubles are put into constant pools. In the
// future we may put integers as well.
assert(llvm::isa<ConstantFloat>(C) || llvm::isa<ConstantDouble>(C));
- C->emitPoolLabel(Str, Ctx);
+ C->emitPoolLabel(Str);
}
return Str.str();
}
@@ -64,7 +61,7 @@ size_t AssemblerFixup::emit(GlobalContext *Ctx, const Assembler &Asm) const {
if (isNullSymbol()) {
Str << "__Sz_AbsoluteZero";
} else {
- Symbol = symbol(Ctx, &Asm);
+ Symbol = symbol(&Asm);
Str << Symbol;
}

Powered by Google App Engine
This is Rietveld 408576698