Skip to content

Commit

Permalink
Fixup OpLine parsing comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKristian-Work committed May 28, 2019
1 parent 65af09d commit 48a7da4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spirv_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,11 +1038,14 @@ void Parser::parse(const Instruction &instruction)
{
// OpLine might come at global scope, but we don't care about those since they will not be declared in any
// meaningful correct order.
// For OpLine statements which
// Ignore all OpLine directives which live outside a function.
if (current_block)
current_block->ops.push_back(instruction);

if (current_function) // Line directives may arrive before first OpLabel.
// Line directives may arrive before first OpLabel.
// Treat this as the line of the function declaration,
// so warnings for arguments can propagate properly.
if (current_function)
{
// Store the first one we find and emit it before creating the function prototype.
if (current_function->entry_line.file_id == 0)
Expand Down

0 comments on commit 48a7da4

Please sign in to comment.