-
Notifications
You must be signed in to change notification settings - Fork 816
Do not generate debug info for declarations in system header files #11544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
9a4fd2d
Move -fno-system-debug option to DebugOptions.def
04eeba8
Do not implement unnecessary -fsystem-debug
2a54ad0
Also do not generate debug info for system declarations if they are n…
9c55626
Also restrict generation of debug info for namespace aliases in syste…
f6fc3ac
Be more conservative about eliminating debug info for unreferenced de…
f20396f
Apply clang-format
0bf8904
Do annotate file as a system file since this can reduce debug info ge…
82233d0
Use correct option macro
e3368b9
Address formatting feedback
49112e7
Add testcase exercising non-generation of system header debug info
f6a0226
Generate for x86_64-unknown-linux since test checks for mangled names
6fca30e
Remove unnecessary blank line
ad8524d
Test when a templated class in system header is explicitly instantiat…
ae117d5
Use clangxx driver
66e991c
Replace all instances of %clang with %clangxx
de7b43b
Check for Windows mangled function names
6d01798
Fix Windows match strings
76eb7a9
Also generate debug info if decl isUsed. Make comments clearer.
a8115c9
isReferenced is always true if isUsed
73f8108
Add comment explaining why unreferenced explicit instantiations still…
e9e7dde
Rename cc1 option to -fno-system-debug to be same as the driver
132d9a3
Do not rely on IsReferenced for Using*Decls. It is not calculated.
94a7f2e
Enhance testcase to also check -fno-system-debug.
8094f9c
Apply clang-format
eccdd8b
Windows does not generate debug info for sin. Adapt test to this.
b207bea
Only stop debug generation if -fno-system-debug is used.
73ff530
Apply clang-format
557fe11
Debug generation not modified without -fno-system-debug. Update test…
048c1e0
Old tests do not need to adapt to this change since all changes are g…
7a5c985
Do not run debug-sin.cpp on Windows since Windows does not generate d…
321c2fd
More cleanly handle different expected mangled names for Linux/Windows.
227afc2
Explain purpose of test more clearly.
92c6995
Use correct pre-defined macro.
e96307c
Add driver test
7f1c06a
Remove unnecessary newlines
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| //////////////////////////////////////////////////////////////////////////////////////// | ||
|
|
||
| // With default options, ensure that declarations obtained by a using declaration have | ||
| // debug info generated. sin() is declared through cmath with: using ::sin; | ||
| // | ||
| // Also ensure that no debug info for sin() is generated if -fno-system-debug is used. | ||
|
|
||
| // Debug info for math library functions is not generated on Windows | ||
| // UNSUPPORTED: system-windows | ||
|
|
||
| // RUN: %clang -emit-llvm -S -g %s -o %t.default.ll | ||
| // RUN: %clang -fno-system-debug -emit-llvm -S -g %s -o %t.no_system_debug.ll | ||
|
|
||
| // Check for debug info for "sin" with default option | ||
| // RUN: FileCheck --check-prefix=CHECK-DEFAULT %s < %t.default.ll | ||
|
|
||
| // No debug information for "sin" should be generated with -fno-system-debug | ||
| // RUN: FileCheck --check-prefix=CHECK-NO-SYSTEM-DEBUG %s < %t.no_system_debug.ll | ||
|
|
||
| // CHECK-DEFAULT: DISubprogram(name: "sin", | ||
| // CHECK-NO-SYSTEM-DEBUG-NOT: DISubprogram(name: "sin", | ||
|
|
||
| //////////////////////////////////////////////////////////////////////////////////////// | ||
|
|
||
|
|
||
| #include <math.h> | ||
|
|
||
| int main() { | ||
| float f; | ||
|
|
||
| f=sin(1.32); | ||
| return 0; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.