From 8f0895e0f8257da2fd10b6325931627a9a1792ba Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 11 Nov 2020 09:56:50 -0500 Subject: Include hierarchy output (#1595) * #include an absolute path didn't work - because paths were taken to always be relative. * Improve diagnostic for token pasting. * Token paste location test. * Output include hierarchy. * WIP on includes hierarchy. * Improved include hierarchy output - to handle source files without tokens. Improved test case. * Small comment improvements. Fixed a typo with not returning a reference. * Slight simplification of the ViewInitiatingHierarchy, by adding GetOrAddValue to Dictionary. * Remove the need for ViewInitiatingHierarchy type. * Improve output of path in diagnostic for includes hierarchy. * Remove comment in diagnostic for token-paste-location.slang * Update command line docs to include `-output-includes` Co-authored-by: Yong He --- tests/diagnostics/token-paste-location.slang | 14 ++++++++++++++ tests/diagnostics/token-paste-location.slang.expected | 7 +++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/diagnostics/token-paste-location.slang create mode 100644 tests/diagnostics/token-paste-location.slang.expected (limited to 'tests/diagnostics') diff --git a/tests/diagnostics/token-paste-location.slang b/tests/diagnostics/token-paste-location.slang new file mode 100644 index 000000000..4da66bab3 --- /dev/null +++ b/tests/diagnostics/token-paste-location.slang @@ -0,0 +1,14 @@ +//DIAGNOSTIC_TEST:SIMPLE: + + +#define SOME % +#define THING % + +#define A SOME +#define B THING + +#define PASTE2(x, y) x##y +#define PASTE(x, y) PASTE2(x, y) + + +PASTE(A, B) diff --git a/tests/diagnostics/token-paste-location.slang.expected b/tests/diagnostics/token-paste-location.slang.expected new file mode 100644 index 000000000..e8f689a45 --- /dev/null +++ b/tests/diagnostics/token-paste-location.slang.expected @@ -0,0 +1,7 @@ +result code = -1 +standard error = { +token paste(1): error 20001: unexpected '%', expected identifier +tests/diagnostics/token-paste-location.slang(10): note: see token pasted location +} +standard output = { +} -- cgit v1.2.3