| Index: src/PNaClTranslator.cpp
|
| diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
|
| index 5d889ff9a83b612a5c939b42f69511fce9139a0d..abb0d455b35914e238ad5ddad19021d1d2860289 100644
|
| --- a/src/PNaClTranslator.cpp
|
| +++ b/src/PNaClTranslator.cpp
|
| @@ -1841,11 +1841,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;
|
| @@ -1904,6 +1907,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();
|
| }
|
|
|