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

Side by Side Diff: src/PNaClTranslator.cpp

Issue 1359923002: Require that the module symbol table can't appear after function. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nit. Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests_lit/parse_errs/Inputs/symtab-after-fcn.tbc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/PNaClTranslator.cpp - ICE from bitcode -----------------===// 1 //===- subzero/src/PNaClTranslator.cpp - ICE from bitcode -----------------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 3140 matching lines...) Expand 10 before | Expand all | Expand 10 after
3151 return Parser.ParseThisBlock(); 3151 return Parser.ParseThisBlock();
3152 } 3152 }
3153 case naclbitc::GLOBALVAR_BLOCK_ID: { 3153 case naclbitc::GLOBALVAR_BLOCK_ID: {
3154 GlobalsParser Parser(BlockID, this); 3154 GlobalsParser Parser(BlockID, this);
3155 return Parser.ParseThisBlock(); 3155 return Parser.ParseThisBlock();
3156 } 3156 }
3157 case naclbitc::VALUE_SYMTAB_BLOCK_ID: { 3157 case naclbitc::VALUE_SYMTAB_BLOCK_ID: {
3158 if (FoundValuesymtab) 3158 if (FoundValuesymtab)
3159 Fatal("Duplicate valuesymtab in module"); 3159 Fatal("Duplicate valuesymtab in module");
3160 3160
3161 // If we have already processed a function block (i.e. we have already
3162 // installed global names and variable initializers) we can no longer accept
3163 // the value symbol table. Names have already been generated.
3164 if (GlobalDeclarationNamesAndInitializersInstalled)
3165 Fatal("Module valuesymtab not allowed after function blocks");
3166
3161 FoundValuesymtab = true; 3167 FoundValuesymtab = true;
3162 ModuleValuesymtabParser Parser(BlockID, this); 3168 ModuleValuesymtabParser Parser(BlockID, this);
3163 return Parser.ParseThisBlock(); 3169 return Parser.ParseThisBlock();
3164 } 3170 }
3165 case naclbitc::FUNCTION_BLOCK_ID: { 3171 case naclbitc::FUNCTION_BLOCK_ID: {
3166 installGlobalNamesAndGlobalVarInitializers(); 3172 installGlobalNamesAndGlobalVarInitializers();
3167 FunctionParser Parser(BlockID, this); 3173 FunctionParser Parser(BlockID, this);
3168 return Parser.convertFunction(); 3174 return Parser.convertFunction();
3169 } 3175 }
3170 default: 3176 default:
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
3286 raw_string_ostream StrBuf(Buffer); 3292 raw_string_ostream StrBuf(Buffer);
3287 StrBuf << IRFilename << ": Does not contain a module!"; 3293 StrBuf << IRFilename << ": Does not contain a module!";
3288 llvm::report_fatal_error(StrBuf.str()); 3294 llvm::report_fatal_error(StrBuf.str());
3289 } 3295 }
3290 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { 3296 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) {
3291 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); 3297 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes");
3292 } 3298 }
3293 } 3299 }
3294 3300
3295 } // end of namespace Ice 3301 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | tests_lit/parse_errs/Inputs/symtab-after-fcn.tbc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698