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

Unified Diff: src/IceSwitchLowering.h

Issue 1860473002: Subzero. Refactors Switch Lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: git pull Created 4 years, 8 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.cpp ('k') | src/IceSwitchLowering.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceSwitchLowering.h
diff --git a/src/IceSwitchLowering.h b/src/IceSwitchLowering.h
index d4f5291d0601e673ca33302978b1762e521e5169..57dd8288079b9e173095b2ebcb073d927b7ea52a 100644
--- a/src/IceSwitchLowering.h
+++ b/src/IceSwitchLowering.h
@@ -18,6 +18,8 @@
#include "IceDefs.h"
#include "IceStringPool.h"
+#include <string>
+
namespace Ice {
class CaseCluster;
@@ -85,18 +87,27 @@ class JumpTableData {
public:
using TargetList = std::vector<intptr_t>;
- JumpTableData(GlobalString FuncName, SizeT Id,
+ JumpTableData(GlobalString Name, GlobalString FuncName, SizeT Id,
const TargetList &TargetOffsets)
- : FuncName(FuncName), Id(Id), TargetOffsets(TargetOffsets) {}
+ : Name(Name), FuncName(FuncName), Id(Id), TargetOffsets(TargetOffsets) {}
JumpTableData(const JumpTableData &) = default;
JumpTableData(JumpTableData &&) = default;
JumpTableData &operator=(JumpTableData &&) = default;
- const GlobalString getFunctionName() const { return FuncName; }
+ GlobalString getName() const { return Name; }
+ GlobalString getFunctionName() const { return FuncName; }
SizeT getId() const { return Id; }
const TargetList &getTargetOffsets() const { return TargetOffsets; }
+ static std::string createSectionName(const GlobalString Name) {
+ if (Name.hasStdString()) {
+ return Name.toString() + "$jumptable";
+ }
+ return std::to_string(Name.getID()) + "$jumptable";
+ }
+ std::string getSectionName() const { return createSectionName(FuncName); }
private:
+ GlobalString Name;
GlobalString FuncName;
SizeT Id;
TargetList TargetOffsets;
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceSwitchLowering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698