-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-cxxfilt] Add --quote option to quote demangled function names (#…
…111871) This is useful when looking at LLVM/MLIR assembly produced from C++ sources. For example cir.call @_ZN3aie4tileILi1ELi4EE7programIZ4mainE3$_0EEvOT_(%2, %7) : will be translated to cir.call @"void aie::tile<1, 4>::program<main::$_0>(main::$_0&&)"(%2, %7) : which can be parsed as valid MLIR by the right mlir-lsp-server. If a symbol is already quoted, do not quote it more. --------- Co-authored-by: James Henderson <[email protected]>
- Loading branch information
Showing
4 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 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,26 @@ | ||
// Show that llvm-cxxfilt --quote adds quotes around demangled symbols, unless | ||
// the symbol is already quoted. | ||
|
||
RUN: split-file %s %t | ||
|
||
RUN: llvm-cxxfilt --quote < %t/symbols-in-file.test | FileCheck --match-full-lines --check-prefix=CHECK-FILE %s | ||
CHECK-FILE: "bar()" "bar()" | ||
CHECK-FILE-NEXT: "bar()" "bar()" | ||
CHECK-FILE: log() | ||
CHECK-FILE: "import thunk for std::future<void>" | ||
|
||
// Check it works with CLI symbols too. Since a quoted mangled name is not a | ||
// mangled name, it should be unchanged. | ||
RUN: llvm-cxxfilt --quote _Z3firv '"_Z3barv"' 'saw()' | FileCheck --match-full-lines --check-prefix=CHECK-CLI %s | ||
CHECK-CLI: "fir()" | ||
CHECK-CLI-NEXT: "_Z3barv" | ||
CHECK-CLI-NEXT: saw() | ||
|
||
//--- symbols-in-file.test | ||
_Z3barv "_Z3barv" | ||
"_Z3barv" _Z3barv | ||
// This is not mangled, thus it should not be quoted. | ||
log() | ||
// Check that an "import thunk for" prefix can be quoted along the demangled | ||
// name. | ||
__imp__ZSt6futureIvE |
This file contains 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 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