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

Unified Diff: src/IceInst.cpp

Issue 1257283004: Iasm and obj lowering for advanced switch lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 5 years, 5 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/IceInst.h ('k') | src/IceInstX86Base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.cpp
diff --git a/src/IceInst.cpp b/src/IceInst.cpp
index 7f498358322a4cd6fc04de96f5db2b4776a83958..900b408e65990c942144759585e80f3e314d9e8c 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -516,8 +516,7 @@ InstFakeKill::InstFakeKill(Cfg *Func, const Inst *Linked)
InstJumpTable::InstJumpTable(Cfg *Func, SizeT NumTargets, CfgNode *Default)
: InstHighLevel(Func, Inst::JumpTable, 1, nullptr),
- LabelNumber(Func->getTarget()->makeNextLabelNumber()),
- NumTargets(NumTargets) {
+ Id(Func->getTarget()->makeNextJumpTableNumber()), NumTargets(NumTargets) {
Targets = Func->allocateArrayOf<CfgNode *>(NumTargets);
for (SizeT I = 0; I < NumTargets; ++I)
Targets[I] = Default;
@@ -534,11 +533,6 @@ bool InstJumpTable::repointEdges(CfgNode *OldNode, CfgNode *NewNode) {
return Found;
}
-IceString InstJumpTable::getName(const Cfg *Func) const {
- return ".L" + Func->getFunctionName() + "$jumptable$__" +
- std::to_string(LabelNumber);
-}
-
Type InstCall::getReturnType() const {
if (Dest == nullptr)
return IceType_void;
@@ -952,29 +946,6 @@ void InstFakeKill::dump(const Cfg *Func) const {
Str << "kill.pseudo scratch_regs";
}
-void InstJumpTable::emit(const Cfg *Func) const {
- // TODO(ascull): should this be a target specific lowering (with access built
- // in?) and just have InstJumpTable as a high level, similar to br? or should
- // this follow the same path as emitIAS i.e. put it in global context and
- // produce this code later?
- if (!BuildDefs::dump())
- return;
- Ostream &Str = Func->getContext()->getStrEmit();
- // TODO(ascull): softcode pointer size of 4
- // TODO(ascull): is .long portable?
- Str << "\n\t.section\t.rodata." << Func->getFunctionName()
- << "$jumptable,\"a\",@progbits\n"
- << "\t.align 4\n" << getName(Func) << ":";
- for (SizeT I = 0; I < NumTargets; ++I)
- Str << "\n\t.long\t" << Targets[I]->getAsmName();
- Str << "\n\n\t.text";
-}
-
-void InstJumpTable::emitIAS(const Cfg *Func) const {
- // TODO(ascull): put jump table in the global context for emission later
- (void)Func;
-}
-
void InstJumpTable::dump(const Cfg *Func) const {
if (!BuildDefs::dump())
return;
« no previous file with comments | « src/IceInst.h ('k') | src/IceInstX86Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698