summaryrefslogtreecommitdiff
path: root/lib/Support/CommandLine.cpp
Commit message (Collapse)AuthorAge
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-19
| | | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. The memory leaks in this version have been fixed. Thanks Alexey for pointing them out. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195064 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r194865 and r194874.Alexey Samsonov2013-11-18
| | | | | | | | | | | | | This change is incorrect. If you delete virtual destructor of both a base class and a subclass, then the following code: Base *foo = new Child(); delete foo; will not cause the destructor for members of Child class. As a result, I observe plently of memory leaks. Notable examples I investigated are: ObjectBuffer and ObjectBufferStream, AttributeImpl and StringSAttributeImpl. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194997 91177308-0d34-0410-b5e6-96231b3b80d8
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-15
| | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194865 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement TokenizeWindowsCommandLine.Rui Ueyama2013-07-30
| | | | | | | | | | This is a follow up patch for r187390 to implement the parser for the Windows-style command line. This should follow the rule as described at http://msdn.microsoft.com/en-us/library/windows/desktop/17w5ykft(v=vs.85).aspx Differential Revision: http://llvm-reviews.chandlerc.com/D1235 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187430 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't leak when expanding response files.Rafael Espindola2013-07-24
| | | | | | | | | | | | | | Before this patch we would strdup each argument. If one was a response file, we would replace it with the response file contents, leaking the original strdup result. We now don't strdup the originals and let StringSaver free any memory it allocated. This also saves a bit of malloc traffic when response files are not used. Leak found by the valgrind build bot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187042 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Beef up and expose the response file parsing in llvm::clReid Kleckner2013-07-18
| | | | | | | | | | | | | | | | | | | The plan is to use it for clang and lld. Major behavior changes: - We can now parse UTF-16 files that have a byte order mark. - PR16209: Don't drop backslashes on the floor if they don't escape anything. The actual parsing loop was based on code from Clang's driver.cpp, although it's been rewritten to track its state with control flow rather than state variables. Reviewers: hans Differential Revision: http://llvm-reviews.chandlerc.com/D1170 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186587 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PathV1 in CommandLine.cpp.Rafael Espindola2013-06-12
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183842 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix 'gcc -flto' builds for unittest binaries (undefined reference toPatrik Hagglund2013-06-12
| | | | | | | | | `typeinfo for llvm::cl::GenericOptionValue'). Remove an "anchor" method for an abstract class. (This does not increase the number of vtables.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183830 91177308-0d34-0410-b5e6-96231b3b80d8
* Include PathV1.h in files that use it.Rafael Espindola2013-06-11
| | | | | | This is preparation for replacing Path.h with PathV2.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183782 91177308-0d34-0410-b5e6-96231b3b80d8
* Better output for long help strings for command-line options.Alexander Kornienko2013-05-10
| | | | | | | | | | | | | | | | | | | | | Summary: This patch allows using \n inside long help strings for command-line options, so that all lines are equally indented. This is not a perfect solution, as we don't (and probably don't want to) know about terminal width, but it allows to format long help strings somehow readable without manually padding them with spaces. A motivating example is -help output from clang-format (source code in tools/clang-format/ClangFormat.cpp, see cl options offset, length, style, and dump-config). Reviewers: atrick, alexfh Reviewed By: alexfh CC: llvm-commits, rafael Differential Revision: http://llvm-reviews.chandlerc.com/D779 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181608 91177308-0d34-0410-b5e6-96231b3b80d8
* Implemented public interface for modifying registered (not positional or ↵Andrew Trick2013-05-06
| | | | | | | | sink options) command line options at runtime. Patch by Dan Liew! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181254 91177308-0d34-0410-b5e6-96231b3b80d8
* Support command line option categories.Andrew Trick2013-05-06
| | | | | | Patch by Dan Liew! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181253 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unused member variable from HelpPrinter. Move another member ↵Craig Topper2013-03-09
| | | | | | variable to be a local variable in the only method that uses it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176778 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | 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. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable response files in all tools. Patch by Liu, Yaxun (Sam). I have simplifiedRafael Espindola2012-10-09
| | | | | | the test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165535 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove tabs.Bill Wendling2012-07-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160479 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't cast away constant qualifier.Duncan Sands2012-03-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152553 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct use of const in ParseCommandLineOptionsDavid Blaikie2012-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149999 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up. s/Low Level Virtual Machine/LLVM/.Jim Grosbach2012-01-25
| | | | | | LLVM isn't an acronym anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148985 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead default.David Blaikie2012-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148738 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing unused default switch cases in switches over enums that already ↵David Blaikie2012-01-16
| | | | | | | | account for all enumeration values explicitly. (This time I believe I've checked all the -Wreturn-type warnings from GCC & added the couple of llvm_unreachables necessary to silence them. If I've missed any, I'll happily fix them as soon as I know about them) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148262 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r147542 after comments from Joerg SonnenbergerSebastian Pop2012-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147608 91177308-0d34-0410-b5e6-96231b3b80d8
* use getHostTriple instead of getDefaultTargetTriple in getClosestTargetForJITSebastian Pop2012-01-04
| | | | | | | | | | Get back getHostTriple. For JIT compilation, use the host triple instead of the default target: this fixes some JIT testcases that used to fail when the compiler has been configured as a cross compiler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147542 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some missing anchors.David Blaikie2011-12-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145578 91177308-0d34-0410-b5e6-96231b3b80d8
* rename getHostTriple into getDefaultTargetTripleSebastian Pop2011-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143502 91177308-0d34-0410-b5e6-96231b3b80d8
* CommandLine: Add support for 64 bit unsigned integer options.Benjamin Kramer2011-09-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139848 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the registered target printing in version strings completely out ofChandler Carruth2011-07-22
| | | | | | | | | | | | | | | | | the Support library. Now its part of the TargetRegistry, and the three commands that care about this explicitly register this extra bit of version information. The set of commands which care was computed by intersecting those which use the Support library's version string printing and those that initialize all the registered targets in a way that produces a meaningful list. The only odd ball out is that 'clang -cc1as -version' no longer prints the registered targets. I don't think anyone is really interested in that (especially as the fact that llvm-mc does so is under a FIXME), but if someone really does want this back I'll happily apply the same patch there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135757 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the logic for printing the registered targets into a staticChandler Carruth2011-07-22
| | | | | | | function on the TargetRegistry. Also clean it up and use the modern LLVM utility libraries available instead of rolling a few things manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135756 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an extension point to the CommandLine library where clients canChandler Carruth2011-07-22
| | | | | | | | | | | | register extra version information to be printed. This is designed to allow those tools which link in various targets to also print those registered targets under --version. Currently this printing logic is embedded into the Support library directly; a huge layering violation. This is the first step to hoisting it out into the tools without adding lots of duplicated code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135755 91177308-0d34-0410-b5e6-96231b3b80d8
* Aliased flag options should be directed to stdout, not stderr to be ↵Evan Cheng2011-06-13
| | | | | | consistent. Patch by Julien Lerouge. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132931 91177308-0d34-0410-b5e6-96231b3b80d8
* In option typo correction, consider -foo=VALUE flags as two distinct parts. TheNick Lewycky2011-05-02
| | | | | | | | | | | comments claimed it did this, but the LHS value was actually an unused variable. The new system considers only the '-foo' part when comparing it for typos against flags that have values, but still look at the whole string for flags that don't. That way, we'll still correct '-inst=combine' to '-instcombine'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130685 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a few instances of "warning: extra ';' outside of a function [-pedantic]".Frits van Bommel2011-04-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129002 91177308-0d34-0410-b5e6-96231b3b80d8
* Added *hidden* flags -print-options and -print-all-options soAndrew Trick2011-04-05
| | | | | | | | | | | | | | | | | | | | developers can see if their driver changed any cl::Option's. The current implementation isn't perfect but handles most kinds of options. This is nice to have when decomposing the stages of compilation and moving between different drivers. It's also a good sanity check when comparing results produced by different command line invocations that are expected to produce the comparable results. Note: This is not an attempt to prolong the life of cl::Option. On the contrary, it's a placeholder for a feature that must exist when cl::Option is replaced by a more appropriate framework. A new framework needs: a central option registry, dynamic name lookup, non-global containers of option values (e.g. per-module, per-function), *and* the ability to print options values and their defaults at any point during compilation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128910 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/CommandLine: Fix LookupNearestOption to also search extra option names.Daniel Dunbar2011-01-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124124 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/CommandLine: Add "Did you mean" print for mismatched operands.Daniel Dunbar2011-01-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123717 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/PathV1: Deprecate getLast.Michael J. Spencer2010-12-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122116 91177308-0d34-0410-b5e6-96231b3b80d8
* MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵Michael J. Spencer2010-12-16
| | | | | | via an out parm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with ↵Michael J. Spencer2010-12-09
| | | | | | error_code &ec. And fix clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a use after free. Patch by Frits van Bommel.Rafael Espindola2010-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119842 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new configure option, --disable-timestamps, intended to turn off ↵Daniel Dunbar2010-05-10
| | | | | | | | | anything which would mess up binary/object comparisons. Currently: - Disables 'Built on ...' in 'foo --version'. - Disables timestamps from being embedded into .dir files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103423 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix minor style issues.Dan Gohman2010-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99414 91177308-0d34-0410-b5e6-96231b3b80d8
* Refer to -help instead of --help since this is what tools themselves say.Duncan Sands2010-02-18
| | | | | | | | | Also, have tools output -help-hidden rather than refer to --help-hidden, for consistency, and likewise adjust documentation. This doesn't change every mention of --help, only those which seemed clearly safe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96578 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace strcpy with memcpy when we have the length around anyway.Benjamin Kramer2010-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94746 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress use of uninitialized variable warning.Duncan Sands2010-01-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93046 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92646 91177308-0d34-0410-b5e6-96231b3b80d8
* Print a newline after the Args: line so that unrelated errs() output doesn'tDan Gohman2009-12-03
| | | | | | | end up on the same line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90473 91177308-0d34-0410-b5e6-96231b3b80d8
* Perform explicit instantiations in the proper namespace, since Clang ↵Douglas Gregor2009-11-25
| | | | | | diagnoses this ill-formity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89846 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the handling of CommaSeparated options into ProvideOption.Mikhail Glushenkov2009-11-20
| | | | | | | | Makes '--comma-separated val1,val2' mean the same thing as '--comma-separated=val1,val2' (that is, 'val1' and 'val2' are not lumped together as 'val1,val2'). Also declutters the main loop a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89463 91177308-0d34-0410-b5e6-96231b3b80d8
* Trailing whitespace.Mikhail Glushenkov2009-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89364 91177308-0d34-0410-b5e6-96231b3b80d8