-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[TableGen] correctly escape dependency filenames #160834
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
base: main
Are you sure you want to change the base?
Changes from 6 commits
7c74a05
a8d9a90
b6183f5
e742379
17cf52b
7718c55
edec47b
12a3c93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||||||||||||||||
| // RUN: rm -rf %t; split-file %s %t | ||||||||||||||||||||
|
|
||||||||||||||||||||
| //--- normal-file.td | ||||||||||||||||||||
| class NormalClass {} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| //--- file with spaces.td | ||||||||||||||||||||
| class SpaceClass {} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| //--- file#with#hash.td | ||||||||||||||||||||
| class HashClass {} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| //--- file$with$dollar.td | ||||||||||||||||||||
| class DollarClass {} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| //--- file with escape\ before spaces.td | ||||||||||||||||||||
| class EscapeBeforeSpacesClass {} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| //--- main.td | ||||||||||||||||||||
| include "normal-file.td" | ||||||||||||||||||||
| include "file with spaces.td" | ||||||||||||||||||||
| include "file#with#hash.td" | ||||||||||||||||||||
| include "file$with$dollar.td" | ||||||||||||||||||||
| include "file with escape\\ before spaces.td" // backslash itself needs escaping | ||||||||||||||||||||
|
|
||||||||||||||||||||
| def Normal : NormalClass; | ||||||||||||||||||||
| def Spaces : SpaceClass; | ||||||||||||||||||||
| def Hash : HashClass; | ||||||||||||||||||||
| def Dollar : DollarClass; | ||||||||||||||||||||
| def EscapeBeforeSpaces : EscapeBeforeSpacesClass; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| // RUN: llvm-tblgen -I %t -d %t.d -o %t.out %t/main.td | ||||||||||||||||||||
| // RUN: FileCheck --input-file=%t.d %s | ||||||||||||||||||||
|
|
||||||||||||||||||||
| // CHECK-DAG: normal-file.td | ||||||||||||||||||||
| // CHECK-DAG: file\ with\ spaces.td | ||||||||||||||||||||
| // CHECK-DAG: file\#with\#hash.td | ||||||||||||||||||||
| // CHECK-DAG: file$$with$$dollar.td | ||||||||||||||||||||
| // CHECK-DAG: file\ with\ escape\\\ before\ spaces.td | ||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test ( llvm-project/llvm/lib/Support/Path.cpp Line 564 in 2cacf71
So if the test case actually makes sense, I believe it's more correct to only transform the path to its native form using llvm-project/llvm/include/llvm/Support/Path.h Lines 258 to 265 in 2cacf71
As for Clang and lld (as mentioned in the PR description), this also seems to be an issue that's worth checking. $ echo '#include <a\ b>' | gcc-15 -M -MG -xc -
-: a\\\ b
$ echo '#include <a\ b>' | clang-21 -M -MG -xc -
-.o: a/\ bThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Proposed the same change in Clang and lld, respectively:
If these changes are accepted we can probably DRY this up into a new |
||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.