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

Unified Diff: src/IceInst.h

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/IceGlobalContext.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.h
diff --git a/src/IceInst.h b/src/IceInst.h
index 48b18f4415b88db94c09a3cd9c8a091663e262e3..6bfd7af171f140db67b2b8390855b59f0be58ebf 100644
--- a/src/IceInst.h
+++ b/src/IceInst.h
@@ -914,17 +914,24 @@ public:
return new (Func->allocate<InstJumpTable>())
InstJumpTable(Func, NumTargets, Default);
}
- void emit(const Cfg *Func) const override;
- void emitIAS(const Cfg *Func) const override;
void addTarget(SizeT TargetIndex, CfgNode *Target) {
assert(TargetIndex < NumTargets);
Targets[TargetIndex] = Target;
}
bool repointEdges(CfgNode *OldNode, CfgNode *NewNode) override;
- IceString getName(const Cfg *Func) const;
+ SizeT getId() const { return Id; }
+ SizeT getNumTargets() const { return NumTargets; }
+ CfgNode *getTarget(SizeT I) const {
+ assert(I < NumTargets);
+ return Targets[I];
+ }
void dump(const Cfg *Func) const override;
static bool classof(const Inst *Inst) { return Inst->getKind() == JumpTable; }
+ static IceString makeName(const IceString &FuncName, SizeT Id) {
+ return ".L" + FuncName + "$jumptable$__" + std::to_string(Id);
+ }
+
private:
InstJumpTable(Cfg *Func, SizeT NumTargets, CfgNode *Default);
void destroy(Cfg *Func) override {
@@ -932,7 +939,7 @@ private:
Inst::destroy(Func);
}
- const SizeT LabelNumber;
+ const SizeT Id;
const SizeT NumTargets;
CfgNode **Targets;
};
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698