Subzero: Don't store std::string objects inside Variable.
Instead, extend 668a7a333d6ddc3102b5b7c7c07448f6d259113c to include both CfgNode and Variable, keeping a pool of strings in the Cfg.
BUG= none
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/798693003
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index 8f1f99d..639c062 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -1086,8 +1086,6 @@
return;
}
-class FunctionValuesymtabParser;
-
/// Parses function blocks in the bitcode file.
class FunctionParser : public BlockParserBaseClass {
FunctionParser(const FunctionParser &) = delete;
@@ -2663,8 +2661,10 @@
return;
Ice::Operand *Op = getFunctionParser()->getOperand(Index);
if (Ice::Variable *V = dyn_cast<Ice::Variable>(Op)) {
- std::string Nm(Name.data(), Name.size());
- V->setName(Nm);
+ if (ALLOW_DUMP) {
+ std::string Nm(Name.data(), Name.size());
+ V->setName(getFunctionParser()->getFunc(), Nm);
+ }
} else {
reportUnableToAssign("variable", Index, Name);
}