summaryrefslogtreecommitdiffstats
path: root/llvm/docs/ProgrammersManual.rst
Commit message (Collapse)AuthorAgeFilesLines
* [docs] Simplify some language for Error/cantFail in the programmer's manual.Lang Hames2017-04-301-10/+9
| | | | llvm-svn: 301773
* Reverts commit r301424, r301425 and r301426Sanjoy Das2017-04-261-3/+3
| | | | | | | | | | | | Commits were: "Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts" "Add a new WeakVH value handle; NFC" "Rename WeakVH to WeakTrackingVH; NFC" The changes assumed pointers are 8 byte aligned on all architectures. llvm-svn: 301429
* Rename WeakVH to WeakTrackingVH; NFCSanjoy Das2017-04-261-3/+3
| | | | | | | | | | | | | | | | Summary: I plan to use WeakVH to mean "nulls itself out on deletion, but does not track RAUW" in a subsequent commit. Reviewers: dblaikie, davide Reviewed By: davide Subscribers: arsenm, mehdi_amini, mcrosier, mzolotukhin, jfb, llvm-commits, nhaehnle Differential Revision: https://reviews.llvm.org/D32266 llvm-svn: 301424
* Update stale doxygen links in ProgrammersManual.rstTim Northover2017-04-031-17/+17
| | | | | | Patch by Wei-Ren Chen. llvm-svn: 299395
* Fix some indenting and line-wrapping issues identified in ProgrammersManual. ↵Daniel Berlin2017-03-131-26/+28
| | | | | | Make description of debugCounters a little clearer llvm-svn: 297656
* Add documentation on debug counters to Programmers Manual.Daniel Berlin2017-03-121-0/+63
| | | | | | | | | | Reviewers: mehdi_amini Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D30842 llvm-svn: 297575
* Revert commit r296967, no typoSylvestre Ledru2017-03-051-1/+1
| | | | llvm-svn: 296984
* Fix a typo. Thanks to huangml. Reported here: ↵Sylvestre Ledru2017-03-041-1/+1
| | | | | | https://github.com/llvm-mirror/llvm/pull/6 llvm-svn: 296967
* [docs] Fix a think-o in the Programmer's Manual.Lang Hames2017-02-281-1/+1
| | | | llvm-svn: 296421
* [Support][Error] Add a 'cantFail' utility function for known-safe calls toLang Hames2017-02-271-4/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fallible functions. Some fallible functions (those returning Error or Expected<T>) may only fail for a subset of their inputs. For example, a "safe" square root function will succeed for all finite positive inputs: Expected<double> safeSqrt(double d) { if (d < 0 && !isnan(d) && !isinf(d)) return make_error<...>("Cannot sqrt -ve values, nans or infs"); return sqrt(d); } At a safe callsite for such a function, checking the error return value is redundant: if (auto ValOrErr = safeSqrt(42.0)) { // use *ValOrErr. } else llvm_unreachable("safeSqrt should always succeed for +ve values"); The cantFail function wraps this check and extracts the contained value, simplifying control flow: double Result = cantFail(safeSqrt(42.0)); This function should be used with care: it is a programmatic error to wrap a call with cantFail if it can in fact fail. For debug builds this will result in llvm_unreachable being called. For release builds the behavior is undefined. Use of this function is likely to be rare in library code, but more common for tool and unit-test code where inputs and mock functions may be known to be safe. llvm-svn: 296384
* [Doc] Modernize programmers manualPiotr Padlewski2017-02-251-28/+21
| | | | | | | | | | | | | | Summary: Fixed bunch of for loops to range based for loop and bunch of rendundat types with auto. Reviewers: echristo, silvas, chandlerc Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D30338 llvm-svn: 296251
* Update Bugzilla URLs in docsIsmail Donmez2017-02-171-1/+1
| | | | llvm-svn: 295432
* fix some typos in the docSylvestre Ledru2017-01-141-1/+1
| | | | llvm-svn: 292014
* Fix missing '>' in docs (hopefully fixes bot error... )David Blaikie2016-12-201-1/+1
| | | | llvm-svn: 290187
* Add some brief documentation about GDB pretty printersDavid Blaikie2016-12-201-0/+16
| | | | llvm-svn: 290186
* Simplify format member detection in FormatVariadicPavel Labath2016-12-151-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This replaces the format member search, which was quite complicated, with a more direct approach to detecting whether a class should be formatted using the format-member method. Instead we use a special type llvm::format_adapter, which every adapter must inherit from. Then the search can be simply implemented with the is_base_of type trait. Aside from the simplification, I like this way more because it makes it more explicit that you are supposed to use this type only for adapter-like formattings, and the other approach (format_provider overloads) should be used as a default (a mistake I made when first trying to use this library). The only slight change in behaviour here is that now choose the format-adapter branch even if the format member invocation will fail to compile (e.g. because it is a non-const member function and we are passing a const adapter), whereas previously we would have gone on to search for format_providers for the type. However, I think that is actually a good thing, as it probably means the programmer did something wrong. Reviewers: zturner, inglorion Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27679 llvm-svn: 289795
* IR: Move NumElements field from {Array,Vector}Type to SequentialType.Peter Collingbourne2016-12-021-3/+3
| | | | | | | | | | Now that PointerType is no longer a SequentialType, all SequentialTypes have an associated number of elements, so we can move that information to the base class, allowing for a number of simplifications. Differential Revision: https://reviews.llvm.org/D27122 llvm-svn: 288464
* IR: Change PointerType to derive from Type rather than SequentialType.Peter Collingbourne2016-12-021-2/+2
| | | | | | | | | | | | | | | | | | | As proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106640.html This is for a couple of reasons: - Values of type PointerType are unlike the other SequentialTypes (arrays and vectors) in that they do not hold values of the element type. By moving PointerType we can unify certain aspects of how the other SequentialTypes are handled. - PointerType will have no place in the SequentialType hierarchy once pointee types are removed, so this is a necessary step towards removing pointee types. Differential Revision: https://reviews.llvm.org/D26595 llvm-svn: 288462
* [Support] Introduce llvm::formatv() function.Zachary Turner2016-11-111-0/+130
| | | | | | | | | | | | | | | | | | This introduces a new type-safe general purpose formatting library. It provides compile-time type safety, does not require a format specifier (since the type is deduced), and provides mechanisms for extending the format capability to user defined types, and overriding the formatting behavior for existing types. This patch additionally adds documentation for the API to the LLVM programmer's manual. Mailing List Thread: http://lists.llvm.org/pipermail/llvm-dev/2016-October/105836.html Differential Revision: https://reviews.llvm.org/D25587 llvm-svn: 286682
* NFC ProgrammersManual fixPiotr Padlewski2016-11-111-1/+1
| | | | llvm-svn: 286645
* [docs] Add a pointer to ExitOnError to the discussion of handleErrors in theLang Hames2016-11-071-2/+9
| | | | | | | | | | | | programmer's manual. ExitOnError is often a better alternative to handleErrors for tool code. This patch makes it easier to find the ExitOnError discussion when reading the handleErrors section. Thanks to Peter Collingbourne for the suggestion. llvm-svn: 286167
* [docs] remove more non-ascii stuff in the hopes to fix the bot Kostya Serebryany2016-11-011-10/+10
| | | | llvm-svn: 285668
* docs: trying to fix the docs bot by removing non-ASCII characters. The docs ↵Kostya Serebryany2016-10-311-2/+2
| | | | | | build fine on my machine, bot fail on the bot (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/25/steps/docs-llvm-html/logs/stdio) llvm-svn: 285639
* [libFuzzer] remove large examples from the libFuzzer docs and link to the ↵Kostya Serebryany2016-10-271-0/+1
| | | | | | libFuzzer tutorial instead; also fix a build error in another file llvm-svn: 285337
* [docs] Avoid repetition of 'considerable' in Error docs.Lang Hames2016-10-251-10/+10
| | | | llvm-svn: 285141
* [docs] Use consistent style for "do more stuff" in Error docs examples.Lang Hames2016-10-251-5/+8
| | | | llvm-svn: 285138
* [docs] Fix yet another Error docs formatting issue...Lang Hames2016-10-251-1/+2
| | | | llvm-svn: 285137
* [docs] Fix a few more Error docs formatting issues.Lang Hames2016-10-251-5/+6
| | | | | | Thanks to Pete Cooper for the review. llvm-svn: 285136
* [docs] Fix a missing code-block in the new Error docs.Lang Hames2016-10-251-8/+10
| | | | llvm-svn: 285134
* [docs] Fix a couple of typos in the new Error docs.Lang Hames2016-10-251-2/+2
| | | | llvm-svn: 285133
* [docs] Add more Error documentation to the Programmer's Manual.Lang Hames2016-10-251-48/+356
| | | | | | | | This patch updates some of the existing Error examples, expands on the documentation for handleErrors, and includes new sections that cover a number of helpful utilities and common error usage idioms. llvm-svn: 285122
* Fixed a typo (LLVM/Support/CFG.h -> LLVM/IR/CFG.h)Andrey Bokhanko2016-09-021-1/+1
| | | | llvm-svn: 280481
* [Docs] Fix another typo in the Error/Expected docs.Lang Hames2016-09-021-2/+2
| | | | llvm-svn: 280461
* [Docs] Fix a couple of typos in the Error/Expected docs.Lang Hames2016-09-021-4/+4
| | | | llvm-svn: 280460
* fix incorrect xref in sphinx docEtienne Bergeron2016-07-131-1/+1
| | | | llvm-svn: 275255
* [docs] Fix up a broken link.Sean Silva2016-07-091-1/+1
| | | | llvm-svn: 275002
* Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini2016-04-141-5/+0
| | | | | | | | | | | At the same time, fixes InstructionsTest::CastInst unittest: yes you can leave the IR in an invalid state and exit when you don't destroy the context (like the global one), no longer now. This is the first part of http://reviews.llvm.org/D19094 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266379
* Try to fix ODR violation of ErrorInfo::IDReid Kleckner2016-03-241-0/+3
| | | | | | This implements my suggestion to Lang. llvm-svn: 264360
* [docs] Clarify Error example in Programmer's Manual.Lang Hames2016-03-241-4/+6
| | | | llvm-svn: 264314
* docs: Fix a missing language in a code-blockJustin Bogner2016-03-231-1/+1
| | | | | | | This should fix the docs build. Spotted by spstarr, thanks! llvm-svn: 264209
* [docs] Fix typo in ProgrammersManual.rstVedant Kumar2016-03-231-1/+1
| | | | | | Patch by Miod Vallat! llvm-svn: 264138
* [Docs] Clarify boolean conversion for Error and Expected<T> in the Programmer'sLang Hames2016-03-231-4/+16
| | | | | | Manual. llvm-svn: 264135
* [Support] Add the 'Error' class for structured error handling.Lang Hames2016-03-161-0/+168
| | | | | | | | | | | | | | | | | This patch introduces the Error classs for lightweight, structured, recoverable error handling. It includes utilities for creating, manipulating and handling errors. The scheme is similar to exceptions, in that errors are described with user-defined types. Unlike exceptions however, errors are represented as ordinary return types in the API (similar to the way std::error_code is used). For usage notes see the LLVM programmer's manual, and the Error.h header. Usage examples can be found in unittests/Support/ErrorTest.cpp. Many thanks to David Blaikie, Mehdi Amini, Kevin Enderby and others on the llvm-dev and llvm-commits lists for lots of discussion and review. llvm-svn: 263609
* Fix some typos in the llvm docSylvestre Ledru2016-02-141-2/+2
| | | | llvm-svn: 260855
* The --debug-only option now takes a comma separated list of debug types.Christof Douma2016-01-121-1/+5
| | | | | | | | | 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
* docs: Stop using DEBUG() without DEBUG_TYPE in the ProgrammersManualJustin Bogner2015-10-151-18/+10
| | | | | | | | The DEBUG() macro has required that a DEBUG_TYPE be set since r206822. Update the programmers manual to reflect that, and also update the wording to point out that DEBUG_TYPE should be defined after #includes. llvm-svn: 250436
* Reverting r243386 because it has serious post-commit concerns that have not ↵Aaron Ballman2015-07-291-2/+1
| | | | | | been addressed. Also reverts r243389, which relied on this commit. llvm-svn: 243527
* Adding ADT SortedVector; client patch will follow.Puyan Lotfi2015-07-281-1/+2
| | | | llvm-svn: 243386
* Fix PR24099 reported by Tomas Brukner.Yaron Keren2015-07-121-1/+1
| | | | llvm-svn: 241997
* Fix documentation for Set-Like ContainersArtyom Skrobov2015-05-191-10/+26
| | | | llvm-svn: 237677
OpenPOWER on IntegriCloud