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

Unified Diff: src/IceTargetLowering.cpp

Issue 1129263005: Convert Constant->emit() definitions to allow multiple targets to define them. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: report fatal Created 5 years, 7 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/IceTargetLowering.h ('k') | src/IceTargetLoweringARM32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLowering.cpp
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp
index 22f698acd6d8d0874c42241c415a9fad64b5a2d2..d0929a01ec56bd9c99f8aca4fbaa39b4e26e3be6 100644
--- a/src/IceTargetLowering.cpp
+++ b/src/IceTargetLowering.cpp
@@ -234,6 +234,30 @@ InstCall *TargetLowering::makeHelperCall(const IceString &Name, Variable *Dest,
return Call;
}
+void TargetLowering::emitWithoutPrefix(const ConstantRelocatable *C) const {
+ if (!ALLOW_DUMP)
+ return;
+ Ostream &Str = Ctx->getStrEmit();
+ if (C->getSuppressMangling())
+ Str << C->getName();
+ else
+ Str << Ctx->mangleName(C->getName());
+ RelocOffsetT Offset = C->getOffset();
+ if (Offset) {
+ if (Offset > 0)
+ Str << "+";
+ Str << Offset;
+ }
+}
+
+void TargetLowering::emit(const ConstantRelocatable *C) const {
+ if (!ALLOW_DUMP)
+ return;
+ Ostream &Str = Ctx->getStrEmit();
+ Str << getConstantPrefix();
+ emitWithoutPrefix(C);
+}
+
std::unique_ptr<TargetDataLowering>
TargetDataLowering::createLowering(GlobalContext *Ctx) {
TargetArch Target = Ctx->getFlags().getTargetArch();
« no previous file with comments | « src/IceTargetLowering.h ('k') | src/IceTargetLoweringARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698