Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2019-05-28 16:51:42 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2019-05-28 16:51:42 +0300
commit48a7da4f4dfb53b1edf0d3672e2fc12b4d4483eb (patch)
treebfd2f5553c75eaa0f59bd055f283537e65eb71bd /spirv_parser.cpp
parent65af09d2d14c4f997c2eaeb467ee8d6d13e12c29 (diff)
Fixup OpLine parsing comments.
Diffstat (limited to 'spirv_parser.cpp')
-rw-r--r--spirv_parser.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/spirv_parser.cpp b/spirv_parser.cpp
index c75fa1b6..af0b2b35 100644
--- a/spirv_parser.cpp
+++ b/spirv_parser.cpp
@@ -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)