Skip to content

Conversation

scorpion-26
Copy link
Contributor

Fixes #1748.
A proper bug explanation is provided in the above mentioned issue.

Since we need to differentiate between header and source for PCH compilation, we store the file type information (header vs source) and then pass that along to clang/gcc via -x. Since .h ("GenericHeader") can be either a header or a source, the -x will be omitted for .h unless manually specified by the user, so the compiler can decide what to do.

@sylvestre
Copy link
Collaborator

it would need tests, could you please add some? thanks

@scorpion-26
Copy link
Contributor Author

Okay, I added some tests. Let me know if I should add another specific test.

@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2023

Codecov Report

Patch coverage: 45.19% and project coverage change: +0.19 🎉

Comparison is base (af6e381) 29.39% compared to head (c87bda2) 29.58%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1802      +/-   ##
==========================================
+ Coverage   29.39%   29.58%   +0.19%     
==========================================
  Files          49       49              
  Lines       17713    17781      +68     
  Branches     8547     8577      +30     
==========================================
+ Hits         5206     5260      +54     
- Misses       7348     7350       +2     
- Partials     5159     5171      +12     
Impacted Files Coverage Δ
src/compiler/nvcc.rs 36.44% <0.00%> (-0.33%) ⬇️
src/compiler/gcc.rs 55.04% <37.97%> (+0.58%) ⬆️
src/compiler/c.rs 38.34% <94.11%> (+1.63%) ⬆️
src/compiler/clang.rs 52.09% <100.00%> (ø)

... and 9 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@scorpion-26
Copy link
Contributor Author

scorpion-26 commented Jun 8, 2023

I force pushed to address the failing lint CI

@sylvestre sylvestre merged commit c85d6e0 into mozilla:main Jun 13, 2023
Language::C => "c",
Language::Cxx => "c++",
Language::C | Language::CHeader => "c",
Language::Cxx | Language::CxxHeader => "c++",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this led to issue #1851 and to commit b881869 to remediate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong output when generating PCH with -c -x c++-header

4 participants