summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-cxxfilt] Correctly demangle COFF import thunkSteven Wu2019-12-161-5/+6
| | | | | | | | | | | | | | | | | | | | Summary: llvm-cxxfilt wasn't correctly demangle COFF import thunk in those two cases before: * demangle in split mode (multiple words from commandline) * the import thunk prefix was added no matter the later part of the string can be demangled or not Now llvm-cxxfilt should handle both case correctly. Reviewers: compnerd, erik.pilkington, jhenderson Reviewed By: jhenderson Subscribers: jkorous, dexonsmith, ributzka, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71425
* [llvm-cxxfilt] Improve strip-underscore behaviorSteven Wu2019-11-181-1/+20
| | | | | | | | | | | | | | | | | | | | Summary: For platform that uses macho format, c++filt should be stripping the leading underscore by default. Introduce the binutil compatible "-n" option to control strip-undercore behaivor together with the existing "-_" option and fallback to system default if none of them are set. rdar://problem/57173514 Reviewers: compnerd, erik.pilkington, dexonsmith, mattd Reviewed By: compnerd, erik.pilkington Subscribers: jkorous, ributzka, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70250
* [binutils] Add response file option to help and docsJames Henderson2019-06-211-0/+3
| | | | | | | | | | | | | | | | | | | | | Many LLVM-based tools already support response files (i.e. files containing a list of options, specified with '@'). This change simply updates the documentation and help text for some of these tools to include it. I haven't attempted to fix all tools, just a selection that I am interested in. I've taken the opportunity to add some tests for --help behaviour, where they were missing. We could expand these tests, but I don't think that's within scope of this patch. This fixes https://bugs.llvm.org/show_bug.cgi?id=42233 and https://bugs.llvm.org/show_bug.cgi?id=42236. Reviewed by: grimar, MaskRay, jkorous Differential Revision: https://reviews.llvm.org/D63597 llvm-svn: 364036
* [llvm-cxxfilt] Fix -Wshadow warning. NFCI.Simon Pilgrim2019-05-091-9/+10
| | | | | | Local variable Decorated was shadowing the global variable Decorated llvm-svn: 360352
* [llvm-cxxfilt] Re-enable split and demangle stdin input on certain ↵Matt Davis2019-02-271-7/+38
| | | | | | | | | | | | | | | | non-alphanumerics. This restores the patch that splits demangled stdin input on non-alphanumerics. I had reverted this patch earlier because it broke Windows build-bots. I have updated the test so that it passes on Windows. I was running the test from powershell and never saw the issue until I switched to the mingw shell. This reverts commit 628ab5c6820bdf3bb5a8e494b0fd9e7312ce7150. llvm-svn: 355031
* Revert "[llvm-cxxfilt] Split and demangle stdin input on certain ↵Matt Davis2019-02-271-38/+7
| | | | | | | | | | | | | non-alphanumerics." This reverts commit 5cd5f8f2563395f8767f94604eb4c4bea8dcbea0. The test passes on linux, but fails on the windows build-bots. This test failure seems to be a quoting issue between my test and FileCheck on Windows. I'm reverting this patch until I can replicate and fix in my Windows environment. llvm-svn: 355021
* [llvm-cxxfilt] Split and demangle stdin input on certain non-alphanumerics.Matt Davis2019-02-271-7/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch attempts to replicate GNU c++-filt behavior when splitting stdin input for demangling. Previously, cxx-filt would split input only on spaces. Each delimited item is then demangled. From what I have tested, GNU c++filt also splits input on any character that does not make up the mangled name (notably commas, but also a large set of non-alphanumeric characters). This patch splits stdin input on any character that does not belong to the Itanium mangling format (since Itanium is currently the only supported format in llvm-cxxfilt). This is an update to PR39990 Reviewers: jhenderson, tejohnson, compnerd Reviewed By: compnerd Subscribers: erik.pilkington, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58416 llvm-svn: 354998
* [llvm-cxxfilt] Fix a comment typo. NFC.Matt Davis2019-02-151-1/+1
| | | | llvm-svn: 354094
* [llvm-cxxfilt] Split and demangle stdin inputMatt Davis2019-02-111-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Originally, llvm-cxxfilt would treat a line as a single mangled item to be demangled. If a mangled name appears in the middle of that string, that name would not be demangled. GNU c++filt splits and demangles every word in a string that is piped to it via stdin. Prior to this patch llvm-cxxfilt would never split strings piped to it. This patch replicates the GNU behavior and splits strings that are piped to it via stdin. This fixes PR39990 Reviewers: compnerd, jhenderson, davide Reviewed By: compnerd, jhenderson Subscribers: erik.pilkington, jhenderson, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57350 llvm-svn: 353743
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Define InitLLVM to do common initialization all at once.Rui Ueyama2018-04-131-4/+2
| | | | | | | | | | | We have a few functions that virtually all command wants to run on process startup/shutdown. This patch adds InitLLVM class to do that all at once, so that we don't need to copy-n-paste boilerplate code to each llvm command's main() function. Differential Revision: https://reviews.llvm.org/D45602 llvm-svn: 330046
* Add opt-viewer testingAdam Nemet2017-11-291-0/+1
| | | | | | | | | | | | | | | | | | | | Detects whether we have the Python modules (pygments, yaml) required by opt-viewer and hooks this up to REQUIRES. This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer testing). It's also related to https://github.com/apple/swift/pull/12938 and the idea is to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake. Differential Revision: https://reviews.llvm.org/D40202 Fixes since the first commit: 1. Disable syntax highlighting as different versions of pygments generate different HTML 2. Use llvm-cxxfilt from the build llvm-svn: 319324
* c++filt: support COFF import thunksSaleem Abdulrasool2017-03-221-0/+6
| | | | | | | The synthetic thunk for the import is prefixed with __imp_. Attempt to undecorate the names when they begin with the __imp_ prefix. llvm-svn: 298550
* llvm-cxxfilt: support `-_`Saleem Abdulrasool2017-01-221-6/+23
| | | | | | | | Add the `--strip-underscore` option to llvm-cxxfilt to strip the leading underscore. This is useful for when dealing with targets which add a leading underscore. llvm-svn: 292759
* llvm-cxxfilt: support the `-s` optionSaleem Abdulrasool2017-01-211-0/+19
| | | | | | | | | | This is a stub implementation of the `-s` or `--format` option that allows the user to specify the demangling style. Since we only support the Itanium (GNU) style demangling, auto is synonymous with `gnu`. Simply swallow the option to permit some level of commandline compatibility. llvm-svn: 292706
* llvm-cxxfilt: add missing includes from previous changeSaleem Abdulrasool2017-01-201-0/+2
| | | | llvm-svn: 292580
* llvm-cxxfilt: fix program descriptionSaleem Abdulrasool2017-01-201-1/+4
| | | | | | | | Fix a silly copy-paste error in the tool description. Take the opportunity to add crash stack printing which will hopefully never be needed. llvm-svn: 292579
* llvm-cxxfilt: support `-t` to demangle typesSaleem Abdulrasool2017-01-201-5/+18
| | | | | | | | By default c++filt demangles functions, though you can optionally pass `-t` to have it decode types as well, behaving nearly identical to `__cxa_demangle`. Add support for this mode. llvm-svn: 292576
* llvm-cxxfilt: filter out invalid manglingsSaleem Abdulrasool2017-01-191-3/+6
| | | | | | | | | | c++filt does not attempt to demangle symbols which do not match its expected format. This means that the symbol must start with _Z or ___Z (block invocation function extension). Any other symbols are returned as is. Note that this is different from the behaviour of __cxa_demangle which will demangle fragments. llvm-svn: 292467
* llvm-cxxfilt: support reading from stdinSaleem Abdulrasool2016-11-131-10/+17
| | | | | | | | `c++filt` when given no arguments runs as a REPL, decoding each line as a decorated name. Unify the test structure to be more uniform, with the tests for llvm-cxxfilt living under test/tools/llvm-cxxfilt. llvm-svn: 286777
* [llvm-cxxfilt] Use llvm::outs(). Simplify.Davide Italiano2016-09-271-5/+2
| | | | | | | This adds a dependency on Support/. As llvm-cxxfilt will grow support for options this will be needed anyway. llvm-svn: 282523
* Add an c++ itanium demangler to llvm.Rafael Espindola2016-09-061-0/+29
This adds a copy of the demangler in libcxxabi. The code also has no dependencies on anything else in LLVM. To enforce that I added it as another library. That way a BUILD_SHARED_LIBS will fail if anyone adds an use of StringRef for example. The no llvm dependency combined with the fact that this has to build on linux, OS X and Windows required a few changes to the code. In particular: No constexpr. No alignas On OS X at least this library has only one global symbol: __ZN4llvm16itanium_demangleEPKcPcPmPi My current plan is: Commit something like this Change lld to use it Change lldb to use it as the fallback Add a few #ifdefs so that exactly the same file can be used in libcxxabi to export abi::__cxa_demangle. Once the fast demangler in lldb can handle any names this implementation can be replaced with it and we will have the one true demangler. llvm-svn: 280732
OpenPOWER on IntegriCloud