IncluderInterface should know line number of the directive
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 445
- Avg merge
- 11h 6m
- Merged PRs (30d)
- 6
Description
We would find extremely useful if `shaderc::CompileOptions::IncluderInterface::GetInclude` were getting line number in requesting source where preprocessor found `#include` directive.
Why? For specific reasons we're inserting a few lines at the beginning (and at the end as well in fact, but doesnt really matter) of each included source. What I'm getting as a result is for example:
```
#line 1 "requested_source"
those
few
extra
inserted
lines
***actual contents of requested source***
```
This results in potential errors being reported with biased line of occurance (compared to original source, without extra inserted lines). Simplest possible case is actually easy to fix by just inserting `#line 1 "requested_source` between extra lines and actual contents. Real problems starts in case when "requested_source" also `#include`s other sources. Then we have result like
```
#line 1 "requested_source"
those
few
extra
inserted
lines
***actual contents of requested_source pt 1***
#line 1 "recursively_requested_source"
those
few
extra
inserted
lines
***actual contents of resursively_requsted_source***
#line 47 "requested_source"
***actual contents of requested_source pt 2***
```
Line 47 is obviously where `#include "resursively_requsted_source"` was BUT while taking into account those extra inserted lines. This probably would also be somehow relatively easily fixable, but if I knew the line number.
Contributor guide
Assessment
This issue has not been assessed yet.