summaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Debug.cpp
AgeCommit message (Collapse)Author
2025-03-30[llvm] Use llvm::append_range (NFC) (#133658)Kazu Hirata
2022-07-16Revert "[Support] Remove redundant declaration setCurrentDebugTypes (NFC)"Kazu Hirata
This reverts commit 52232abc230435d4c1e1273d4b857a11f2c7b45b. This patch breaks builds when NDEBUG is defined.
2022-07-16[Support] Remove redundant declaration setCurrentDebugTypes (NFC)Kazu Hirata
The function is declared in llvm/include/llvm/Support/Debug.h. Identified with readability-redundant-declaration.
2022-06-04Remove unneeded cl::ZeroOrMore for cl::opt optionsFangrui Song
Similar to 557efc9a8b68628c2c944678c6471dac30ed9e8e. This commit handles options where cl::ZeroOrMore is more than one line below cl::opt.
2022-04-03Revert "Apply clang-tidy fixes for readability-redundant-declaration in ↵Kazu Hirata
Debug.cpp (NFC)" This reverts commit 0fe01a9346658c0955b68b123f2b470b018114b1. The commit caused build failures like: llvm/lib/Support/Debug.cpp:65:3: error: ‘setCurrentDebugTypes’ was not declared in this scope; did you mean ‘setCurrentDebugType’?
2022-04-03Apply clang-tidy fixes for readability-redundant-declaration in Debug.cpp (NFC)Kazu Hirata
2021-07-16Use ManagedStatic and lazy initialization of cl::opt in libSupport to make ↵Mehdi Amini
it free of global initializer We can build it with -Werror=global-constructors now. This helps in situation where libSupport is embedded as a shared library, potential with dlopen/dlclose scenario, and when command-line parsing or other facilities may not be involved. Avoiding the implicit construction of these cl::opt can avoid double-registration issues and other kind of behavior. Reviewed By: lattner, jpienaar Differential Revision: https://reviews.llvm.org/D105959
2021-07-16Revert "Use ManagedStatic and lazy initialization of cl::opt in libSupport ↵Mehdi Amini
to make it free of global initializer" This reverts commit af9321739b20becf170e6bb5060b8d780e1dc8dd. Still some specific config broken in some way that requires more investigation.
2021-07-16Use ManagedStatic and lazy initialization of cl::opt in libSupport to make ↵Mehdi Amini
it free of global initializer We can build it with -Werror=global-constructors now. This helps in situation where libSupport is embedded as a shared library, potential with dlopen/dlclose scenario, and when command-line parsing or other facilities may not be involved. Avoiding the implicit construction of these cl::opt can avoid double-registration issues and other kind of behavior. Reviewed By: lattner, jpienaar Differential Revision: https://reviews.llvm.org/D105959
2021-07-16Revert "Use ManagedStatic and lazy initialization of cl::opt in libSupport ↵Mehdi Amini
to make it free of global initializer" This reverts commit 42f588f39c5ce6f521e3709b8871d1fdd076292f. Broke some buildbots
2021-07-16Use ManagedStatic and lazy initialization of cl::opt in libSupport to make ↵Mehdi Amini
it free of global initializer We can build it with -Werror=global-constructors now. This helps in situation where libSupport is embedded as a shared library, potential with dlopen/dlclose scenario, and when command-line parsing or other facilities may not be involved. Avoiding the implicit construction of these cl::opt can avoid double-registration issues and other kind of behavior. Reviewed By: lattner, jpienaar Differential Revision: https://reviews.llvm.org/D105959
2021-01-28[Support] Add some missing namespace closure comments. NFCI.Simon Pilgrim
Fixes some clang-tidy warnings.
2020-01-28Make llvm::StringRef to std::string conversions explicit.Benjamin Kramer
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here. This is mostly mechanical from a custom clang-tidy check, with a lot of manual fixups. It uncovers a lot of minor inefficiencies. This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth
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
2018-05-14Rename DEBUG macro to LLVM_DEBUG.Nicola Zaghen
The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM - Manual change to APInt - Manually chage DOCS as regex doesn't match it. In the transition period the DEBUG() macro is still present and aliased to the LLVM_DEBUG() one. Differential Revision: https://reviews.llvm.org/D43624 llvm-svn: 332240
2016-12-27Attempt to fix build bot after r290597Eugene Leviant
llvm-svn: 290602
2016-12-27Allow setting multiple debug typesEugene Leviant
Differential revision: https://reviews.llvm.org/D28109 llvm-svn: 290597
2016-01-12The --debug-only option now takes a comma separated list of debug types.Christof Douma
This means that the DEBUG_TYPE cannot take a comma anymore. All existing passes conform to this rule. Differential Revision: http://reviews.llvm.org/D15645 llvm-svn: 257466
2015-06-23Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko
Apparently, the style needs to be agreed upon first. llvm-svn: 240390
2015-06-19Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko
The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
2015-05-27Avoid creating and destroying a std::string on every iteration.Yaron Keren
llvm-svn: 238343
2015-04-09Misc cleanup. NFC.Rafael Espindola
These were lost when I reverted the raw_ostream changes. llvm-svn: 234504
2015-04-09This reverts commit r234460 and r234461.Rafael Espindola
Revert "Add classof implementations to the raw_ostream classes." Revert "Use the cast machinery to remove dummy uses of formatted_raw_ostream." The underlying issue can be fixed without classof. llvm-svn: 234495
2015-04-09Add classof implementations to the raw_ostream classes.Rafael Espindola
More uses to follow in a another patch. llvm-svn: 234460
2015-03-23Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used.Benjamin Kramer
llvm-svn: 232998
2015-02-19Provide the same ABI regardless of NDEBUGDmitri Gribenko
For projects depending on LLVM, I find it very useful to combine a release-no-asserts build of LLVM with a debug+asserts build of the dependent project. The motivation is that when developing a dependent project, you are debugging that project itself, not LLVM. In my usecase, a significant part of the runtime is spent in LLVM optimization passes, so I would like to build LLVM without assertions to get the best performance from this combination. Currently, `lib/Support/Debug.cpp` changes the set of symbols it provides depending on NDEBUG, while `include/llvm/Support/Debug.h` requires extra symbols when NDEBUG is not defined. Thus, it is not possible to enable assertions in an external project that uses facilities of `Debug.h`. This patch changes `Debug.cpp` and `Valgrind.cpp` to always define the symbols that other code may depend on when #including LLVM headers without NDEBUG. http://reviews.llvm.org/D7662 llvm-svn: 229819
2015-01-14[cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth
utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
2014-11-21Allow multiple -debug-only argsMatthias Braun
Debug output is shown if any of the -debug-only arguments match. llvm-svn: 222547
2014-09-03Removing static initializer from Debug.cpp by converting to a ManagedStatic.Chris Bieneman
This is part of our larger effort to remove static initializers from LLVM libraries. Reviewed by: chandlerc llvm-svn: 217053
2014-04-15[C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper
instead of comparing to nullptr. llvm-svn: 206252
2013-02-20Fix accidental concatenation for "outputuntil" in the -debug-buffer-size ↵Erik Verbruggen
option description. llvm-svn: 175682
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
2012-07-27Typos.Chad Rosier
llvm-svn: 160897
2012-07-26Make comments in Debug.cpp and Debug.h consistent. Rename SetCurrentDebugType;Chad Rosier
Function names should be camel case, and start with a lower case letter. No functional change intended. llvm-svn: 160813
2010-11-29Merge System into Support.Michael J. Spencer
llvm-svn: 120298
2010-04-15Fix a bunch of namespace polution.Dan Gohman
llvm-svn: 101376
2010-03-24Fix minor style issues.Dan Gohman
llvm-svn: 99414
2010-01-20Fix an infinite recursion problem. dbgs() should return errs() inDavid Greene
release mode. llvm-svn: 94001
2009-12-23Clarify how dbgs() operates.David Greene
llvm-svn: 92083
2009-12-23Provide dbgs(), a circular-buffering debug output stream. By default itDavid Greene
simply passes output to errs(). If -debug-buffer-size=N is set N > 0, dbgs() buffers its output until program termination and dumps the last N characters sent to it. This is handy when debugging very large inputs. llvm-svn: 92002
2009-11-09Make lib/Support/Debug.cpp SetCurrentDebugType implementation part of llvm ↵Xerxes Ranby
namespace to match function declaration in Debug.h. llvm-svn: 86544
2009-10-28add a new 'SetCurrentDebugType' API (requested by Andrew Haley for JITChris Lattner
stuff) to programmatically control the current debug flavor. While I'm at it, doxygenate Debug.h and clean it up. llvm-svn: 85395
2009-08-23Fix some refactos for iostream changes (in -Asserts mode).Daniel Dunbar
- The world needs better C++ refactoring tools, can I get an Amen!? llvm-svn: 79843
2009-08-23eliminate DOUT and make Debug.h not include Streams.h anymore, woo!Chris Lattner
llvm-svn: 79835
2009-07-20Hide the DOUT static variable behind a function interface.David Greene
llvm-svn: 76425
2008-04-23Make these variables static.Dan Gohman
llvm-svn: 50196
2007-12-29Remove attribution from file headers, per discussion on llvmdev.Chris Lattner
llvm-svn: 45418
2007-01-03The previous implementation of LLVM Streams wasn't removing symbols. ThisBill Wendling
one should. llvm-svn: 32845
2006-12-17Added an automatic cast to "std::ostream*" etc. from OStream. We then canBill Wendling
rework the hacks that had us passing OStream in. We pass in std::ostream* instead, check for null, and then dispatch to the correct print() method. llvm-svn: 32636
2006-12-07Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, areBill Wendling
now cerr, cout, and NullStream resp. llvm-svn: 32298