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

Unified Diff: src/PNaClTranslator.cpp

Issue 567703003: Allow ability to name unnamed global addresses in Subzero. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits in patch set 4. Created 6 years, 3 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/IceTranslator.cpp ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/PNaClTranslator.cpp
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index bb04d61ff04df4327c9b88f777ae779db0b14d7c..fcebeac05538052584630d7a32fc0c0ae8f9eb09 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -1887,11 +1887,14 @@ bool FunctionParser::ParseBlock(unsigned BlockID) {
class ModuleParser : public BlockParserBaseClass {
public:
ModuleParser(unsigned BlockID, TopLevelParser *Context)
- : BlockParserBaseClass(BlockID, Context) {}
+ : BlockParserBaseClass(BlockID, Context), FoundFirstFunctionBlock(false) {
+ }
virtual ~ModuleParser() LLVM_OVERRIDE {}
-protected:
+private:
+ // True if we have parsed a function block.
+ bool FoundFirstFunctionBlock;
virtual bool ParseBlock(unsigned BlockID) LLVM_OVERRIDE;
virtual void ProcessRecord() LLVM_OVERRIDE;
@@ -1950,6 +1953,10 @@ bool ModuleParser::ParseBlock(unsigned BlockID) LLVM_OVERRIDE {
return Parser.ParseThisBlock();
}
case naclbitc::FUNCTION_BLOCK_ID: {
+ if (!FoundFirstFunctionBlock) {
+ getTranslator().nameUnnamedGlobalAddresses(Context->getModule());
+ FoundFirstFunctionBlock = true;
+ }
FunctionParser Parser(BlockID, this);
return Parser.ParseThisBlock();
}
« no previous file with comments | « src/IceTranslator.cpp ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698