Commit Graph

969 Commits

Author SHA1 Message Date
Daniel Jasper 97292843d0 Support for modular module-map-files
This patch is the first step to make module-map-files modular (instead
of requiring a single "module.map"-file per include directory). This
step adds a new "extern module" declaration that enables
module-map-files to reference one another along with a very basic
implementation.

The next steps are:

* Combine this with the use-declaration (from
  http://llvm-reviews.chandlerc.com/D1546) in order to only load module
  map files required for a specific compilation.
* Add an additional flag to start with a specific module-map-file (instead
  of requiring there to be at least one "module.map").

Review: http://llvm-reviews.chandlerc.com/D1637
llvm-svn: 190497
2013-09-11 07:20:44 +00:00
Nico Rieck 7857d46c64 Add -fansi-escape-codes option
Some build systems use pipes for stdin/stderr. On nix-ish platforms colored
output can be forced by -fcolor-diagnostics. On Windows this option has
no effect in these cases because LLVM uses the console API (which only
operates on the console buffer) even if a console wrapper capable of
interpreting ANSI escape codes is used.

The -fansi-escape-codes option allows switching from the console API to
ANSI escape codes. It has no effect on other platforms.

llvm-svn: 190464
2013-09-11 00:38:02 +00:00
Hans Wennborg 9f6581bb88 Allow _clang-format as alternative to .clang-format config filename
Dotfiles are impractical on Windows. This makes clang-format search
for the style configuration file as '_clang-format' in addition to
the usual '.clang-format'. This is similar to how VIM searches for
'_vimrc' on Windows.

Differential Revision: http://llvm-reviews.chandlerc.com/D1629

llvm-svn: 190413
2013-09-10 15:41:12 +00:00
Sean Silva 98c64d4dca [docs] Prominently note modules are experimental.
It was really hard to tell that modules are experimental. This makes it
really clear by

* Noting the experimental status in the title.
* Moving the "warning" above the table of contents.

llvm-svn: 190340
2013-09-09 19:57:49 +00:00
Sean Silva fcb46a0dec [docs] End users should see just "Clang"
Half the internet has wildly incorrect ideas about what LLVM is (in
particular, many get the impression that LLVM is some magical
cross-platform runtime), so saying "LLVM" near "cross-compilation" in a
user-facing doc might provoke confusion.

llvm-svn: 190338
2013-09-09 19:50:47 +00:00
Sean Silva 3c53673b50 [docs] Fix Sphinx toctree warning.
Last I heard LSan is getting close to prime-time, but for now keep
LeakSanitizer.rst hidden (especially since it contains so little
content).

llvm-svn: 190337
2013-09-09 19:50:46 +00:00
Sean Silva a928c24984 [docs] Fix some finicky Sphinx warnings.
llvm-svn: 190336
2013-09-09 19:50:40 +00:00
Sean Silva 7a8b6ca2d1 [docs] Typographical and rewording fixes.
llvm-svn: 190333
2013-09-09 19:30:44 +00:00
Benjamin Kramer 60509af49a Fix constructor-related typos.
Noticed by Roman Divacky.

llvm-svn: 190311
2013-09-09 14:48:42 +00:00
Renato Golin f70e35ddc4 Adding cross-compilation instructions to Clang
llvm-svn: 190281
2013-09-08 20:44:39 +00:00
Reid Kleckner 725b7b3786 manual: Fix RST reference to MS extension support
llvm-svn: 190101
2013-09-05 21:29:35 +00:00
Alexander Kornienko 472d27aa22 A minor fix in the documentation.
llvm-svn: 189947
2013-09-04 15:14:18 +00:00
Alexander Kornienko d278e0eee3 Added documentation for clang-format style options.
Summary:
The main contents is in the ClangFormatStyleOptions.rst, which can be
updated from the Format.h by the dump_format_style.py script.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1597

llvm-svn: 189946
2013-09-04 15:09:13 +00:00
Alexander Kornienko e3648fbe1a Added WebKit style to the BasedOnStyle handling and to the relevant help messages.
llvm-svn: 189765
2013-09-02 16:39:23 +00:00
Alexander Kornienko d83adf30c6 Whitespace changes in help messages + updated help output in .rst file.
llvm-svn: 189762
2013-09-02 15:30:26 +00:00
Michael Gottesman 043c53b5a8 [doxygen] Add a few missing variables to the doxygen.cfg.in for external search and cleaned up external_search_map.
llvm-svn: 189523
2013-08-28 21:55:41 +00:00
Michael Gottesman 22a351d314 [doxygen] Added support for doxygen external search.
llvm-svn: 189509
2013-08-28 20:29:44 +00:00
Michael Gottesman 8f897af39c [doxygen] Added code for generating doxygen documentation for clang for cmake.
llvm-svn: 189508
2013-08-28 20:29:40 +00:00
Ted Kremenek 1aab6834fa Remove comment on the availability of boxed expressions. They have been available for a while.
llvm-svn: 189446
2013-08-28 06:03:59 +00:00
Samuel Benzaquen 85ec25d21c Rewrite eachOf/allOf/anyOf to use a variadic operator.
Summary:
Rewrite eachOf/allOf/anyOf to use a variadic operator, instead of hand-written calls to Polymorphic matchers.
This simplifies their definition and future changes to add them to the dynamic registry.

Reviewers: klimek

CC: cfe-commits, revane

Differential Revision: http://llvm-reviews.chandlerc.com/D1427

llvm-svn: 189357
2013-08-27 15:11:16 +00:00
Shuxin Yang 0e61122bb3 Add note about following two commands are no longer equivalent.
- "clang -O3 -flto a.c -c", and 
 - "clang -emit-llvm a.c -c" 

Thank Rafael for tips.

llvm-svn: 189150
2013-08-23 22:01:03 +00:00
Rafael Espindola 493f045e75 Don't imply -flto with -O4.
We now saturate at -O3.

llvm-svn: 189149
2013-08-23 21:49:00 +00:00
DeLesley Hutchins c2ecf0d815 Update to consumed analysis.
Patch by chris.wailes@gmail.com.  The following functionality was added:

* The same functionality is now supported for both CXXOperatorCallExprs and CXXMemberCallExprs.
* Factored out some code in StmtVisitor.
* Removed variables from the state map when their destructors are encountered.
* Started adding documentation for the consumed analysis attributes.

llvm-svn: 189059
2013-08-22 20:44:47 +00:00
Peter Collingbourne 730f3c8574 DataFlowSanitizer: Add a design doc paragraph on checking ABI consistency.
Differential Revision: http://llvm-reviews.chandlerc.com/D1443

llvm-svn: 189055
2013-08-22 20:08:20 +00:00
Samuel Benzaquen bd7d887f18 Refactor ArgumentAdaptativeMatcher matchers to remove the template from their declaration.
Summary:
Refactor ArgumentAdaptativeMatcher matchers to remove the template from their declaration.
This facilitates dynamic registration. Change the registry code to use the regular overload resolution mechanism for adaptative matchers.

Reviewers: klimek

CC: cfe-commits, revane

Differential Revision: http://llvm-reviews.chandlerc.com/D1402

llvm-svn: 188560
2013-08-16 16:19:42 +00:00
Evgeniy Stepanov fd75a2ca37 Update sanitizer attribute documentation to match behaviour change in r187967.
llvm-svn: 188459
2013-08-15 13:57:11 +00:00
Peter Collingbourne 276be3c57c Add support for -fsanitize-blacklist and default blacklists for DFSan.
Also add some documentation.

Differential Revision: http://llvm-reviews.chandlerc.com/D1346

llvm-svn: 188403
2013-08-14 18:54:18 +00:00
Richard Trieu 98ca59ed3b Fix typo in template diffing docs.
llvm-svn: 188120
2013-08-09 22:52:48 +00:00
Peter Collingbourne c377275a4a DataFlowSanitizer; Clang changes.
DataFlowSanitizer is a generalised dynamic data flow analysis.

Unlike other Sanitizer tools, this tool is not designed to detect a
specific class of bugs on its own.  Instead, it provides a generic
dynamic data flow analysis framework to be used by clients to help
detect application-specific issues within their own code.

Differential Revision: http://llvm-reviews.chandlerc.com/D966

llvm-svn: 187925
2013-08-07 22:47:34 +00:00
Alexey Samsonov 2de6833809 Documentation for sanitizer special case list format and -f(no-)?sanitize-blacklist flag
llvm-svn: 187871
2013-08-07 08:23:32 +00:00
Daniel Jasper 07e6c407bc Add option to disable module loading.
This patch was created by Lawrence Crowl and reviewed in:
http://llvm-reviews.chandlerc.com/D963

llvm-svn: 187738
2013-08-05 20:26:17 +00:00
Craig Topper 50ad5b7354 Add support for passing -1 to __builtin_shufflevector to signify an undefined element value to match IR capabilities.
llvm-svn: 187694
2013-08-03 17:40:38 +00:00
Eli Friedman f24bd3bdba Fix GNU ObjC ABI for a message returning a struct.
This allows the ObjFW runtime to correctly implement message forwarding
for messages which return a struct.

Patch by Jonathan Schleifer.

llvm-svn: 187174
2013-07-26 00:53:29 +00:00
Manuel Klimek dba64f1aff Fix incorrect documentation generation for type matchers.
llvm-svn: 187104
2013-07-25 06:05:50 +00:00
Richard Smith 4fb09720cf Rename feature test for lambda init-captures from cxx_generalized_capture to
cxx_init_capture. "generalized" is neither descriptive nor future-proof. No
compatibility problems expected, since we've never advertised having this
feature.

llvm-svn: 187058
2013-07-24 17:51:13 +00:00
Richard Smith c0f7b81d89 Update documentation to match current C++1y feature set.
llvm-svn: 187055
2013-07-24 17:41:31 +00:00
Manuel Klimek e88204c4ce Update docs.
llvm-svn: 187022
2013-07-24 05:46:07 +00:00
Eli Friedman a54333264a Fix bug in computing POD-for-layout.
A class with a field of non-POD-for-layout type is not POD-for-layout.
This computation should not depend on whether the field is of POD type
in the language sense.

Fixes PR16537.

Patch by Josh Magee.

llvm-svn: 186741
2013-07-20 01:06:31 +00:00
Richard Smith 83c728b581 Update users manual to indicate:
1) clang++ must be used when linking C++ programs using -fsanitize=undefined, and
  2) MSan can't be combined with TSan or ASan.

llvm-svn: 186711
2013-07-19 19:06:48 +00:00
Alexey Samsonov 492c7bc8ff Revert r186672 - turns out ASan supports Mac OS 10.6 yet.
llvm-svn: 186673
2013-07-19 12:53:04 +00:00
Alexey Samsonov 32f071a1d6 [ASan] Reflect the dropped Mac OS 10.6 support in docs
llvm-svn: 186672
2013-07-19 12:33:30 +00:00
Tim Northover 6aacd49094 ARM: implement low-level intrinsics for the atomic exclusive operations.
This adds three overloaded intrinsics to Clang:
    T __builtin_arm_ldrex(const volatile T *addr)
    int __builtin_arm_strex(T val, volatile T *addr)
    void __builtin_arm_clrex()

The intent is that these do what users would expect when given most sensible
types. Currently, "sensible" translates to ints, floats and pointers.

llvm-svn: 186394
2013-07-16 09:47:53 +00:00
Samuel Benzaquen 79656e19c8 Add support for type traversal matchers.
Summary:
Fixup the type traversal macros/matchers to specify the supported types.
Make the marshallers a little more generic to support any variadic function.
Update the doc script.

Reviewers: klimek

CC: cfe-commits, revane

Differential Revision: http://llvm-reviews.chandlerc.com/D1023

llvm-svn: 186340
2013-07-15 19:25:06 +00:00
Richard Smith 6cbd65d84d Add a __builtin_addressof that performs the same functionality as the built-in
& operator (ignoring any overloaded operator& for the type). The purpose of
this builtin is for use in std::addressof, to allow it to be made constexpr;
the existing implementation technique (reinterpret_cast to some reference type,
take address, reinterpert_cast back) does not permit this because
reinterpret_cast between reference types is not permitted in a constant
expression in C++11 onwards.

llvm-svn: 186053
2013-07-11 02:27:57 +00:00
Richard Smith 36ee4fc329 Fix some grammar errors.
llvm-svn: 186048
2013-07-11 00:34:42 +00:00
Richard Smith ccfc9ffcbe Fix documentation:
#if defined(__has_foo("X")) && __has_foo("X")

is not a correct way to portably use __has_foo, because it is expanded to

  #if 0 && 0("X")

... which is ill-formed.

Also add a missing ')'.

llvm-svn: 186047
2013-07-11 00:27:05 +00:00
Anna Zaks 7925e3db63 [analyzer] Add a debug checker that prints Exploded Graph
Add a debug checker that is useful to understand how the ExplodedGraph is
built; it can be triggered using the following command:

 clang -cc1 -analyze -analyzer-checker=debug.ViewExplodedGraph my_program.c

A patch by Béatrice Creusillet!

llvm-svn: 184768
2013-06-24 18:12:12 +00:00
Sean Silva 4c280bd3de [docs] `-fno-sanitize=` is accepted too.
llvm-svn: 184611
2013-06-21 23:50:58 +00:00
Samuel Benzaquen c6f2c9b566 Add support for polymorphic matchers. Use runtime type checking to determine the right polymorphic overload to use.
llvm-svn: 184558
2013-06-21 15:51:31 +00:00
Manuel Klimek cd5e799833 Improve documentation for AST matchers.
llvm-svn: 184538
2013-06-21 09:59:59 +00:00
Sean Silva 8d5ec19730 [docs] Add link to presentation slides.
llvm-svn: 184518
2013-06-21 02:09:29 +00:00
Michael Gottesman 930ecdb77b [checked-arithmetic builtins] Added builtins to enable users to perform checked-arithmetic in c.
This will enable users in security critical applications to perform
checked-arithmetic in a fast safe manner that is amenable to c.

Tests/an update to Language Extensions is included as well.

rdar://13421498.

llvm-svn: 184497
2013-06-20 23:28:10 +00:00
Lawrence Crowl b53e5483b0 This patch adds new private headers to the module map. Private
headers may be included from within the module, but not from outside
the module.

llvm-svn: 184471
2013-06-20 21:14:14 +00:00
Manuel Klimek bbb758577f Adds the equalsBoundNode matcher.
Most of the tests contributed by Edwin Vane.

llvm-svn: 184427
2013-06-20 14:06:32 +00:00
Manuel Klimek c16c652ca5 Implements declaratorDecl, parmVarDecl and hassTypeLoc matchers.
llvm-svn: 184419
2013-06-20 13:08:29 +00:00
Michael Gottesman 1534399059 [multiprecision-builtins] Added missing builtin __builtin_{add,sub}cb for {add,sub} with carry for bytes.
I have had several people ask me about why this builtin was not available in
clang (since it seems like a logical conclusion). This patch implements said
builtins.

Relevant tests are included as well. I also updated the Clang language extension reference.

rdar://14192664.

llvm-svn: 184227
2013-06-18 20:40:40 +00:00
Richard Smith 26eed76ec7 Point link at correct location for Clang 3.3 release notes.
llvm-svn: 184148
2013-06-17 23:53:08 +00:00
Rui Ueyama a6239aef11 [docs] Fix wrong clang-format example.
llvm-svn: 183963
2013-06-14 02:12:06 +00:00
Manuel Klimek f30b17d8c3 Fixes the comment for hasDeclaration.
llvm-svn: 183640
2013-06-10 08:52:15 +00:00
Bill Wendling 61f44ccc50 Reset the release notes for the 3.4 release.
llvm-svn: 183211
2013-06-04 06:17:46 +00:00
Richard Smith b7f7faafd4 Document -fno-sanitize-recover and -fsanitize-undefined-trap-on-error and attempt to explain the difference between them.
llvm-svn: 182890
2013-05-29 22:57:31 +00:00
Tim Northover bfe2e5f778 Add caveat to __builtin_readcyclecounter documentation.
The ARM cycle-counter can be restricted by the operating system; it's
worth warning potential users of this issue.

llvm-svn: 182604
2013-05-23 19:14:12 +00:00
Hans Wennborg b3ad90d52d ReleaseNotes.rst: typo
llvm-svn: 182294
2013-05-20 15:59:04 +00:00
Hans Wennborg 3cb56a4f34 ReleaseNotes: add note about ASTContext::WCharTy and WideCharTy
llvm-svn: 182280
2013-05-20 14:53:06 +00:00
Alexander Kornienko 006b5c89ce Clang-format: allow -style="{yaml/json}" on command line
Summary: + improved handling of default style and predefined styles.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D813

llvm-svn: 182205
2013-05-19 00:53:30 +00:00
Manuel Klimek bf2d568900 Add embedded video for the AST tutorial.
As asked for by Sean, putting the video into the docs.

llvm-svn: 182081
2013-05-17 08:40:22 +00:00
Sergey Matveev f4633ac740 Add LeakSanitizer.rst to docs.
llvm-svn: 181798
2013-05-14 15:48:54 +00:00
Richard Smith 9155be1e54 C++1y: provide full 'auto' return type deduction for lambda expressions. This
completes the implementation of N3638.

llvm-svn: 181669
2013-05-12 03:09:35 +00:00
Alexander Kornienko 88a0d939de Reformat clang-format help strings, filter out irrelevant options.
Summary: +updated ClangFormat.rst

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D780

llvm-svn: 181617
2013-05-10 18:12:00 +00:00
Edwin Vane fc4f7dc0a6 Adding isConst() ASTMatcher for CXXMethodDecl nodes
Updated reference and unit tests.

llvm-svn: 181522
2013-05-09 17:00:17 +00:00
Edwin Vane c50e730d6e Updating LibASTMatchersReference to include namespaceDecl()
The namespaceDecl() ASTMatcher was added in r179027.

llvm-svn: 181519
2013-05-09 16:42:37 +00:00
Reid Kleckner 78fb10f194 Document Clang's support for #pragma comment(lib/linker) with -fms-extensions
As suggested by Dmitri Gribenko.

llvm-svn: 181433
2013-05-08 14:40:51 +00:00
Bill Wendling 3067ec8777 We're in 3.4 land now.
llvm-svn: 181351
2013-05-07 20:31:37 +00:00
Richard Smith 0a715429b9 C++1y: Update __cplusplus to temporary value 201305L to allow detection of provisional C++1y support.
Add __has_feature and __has_extension checks for C++1y features (based on the provisional names from
the C++ features study group), and update documentation to match.

llvm-svn: 181342
2013-05-07 19:32:56 +00:00
Daniel Jasper 5f99742632 Basic clang-format integration for BBEdit.
Thanks to Avi Drissman!

llvm-svn: 180933
2013-05-02 17:37:36 +00:00
Dmitri Gribenko b8f9f3ef0b Documentation: Change UTF-8 ellipsis character to ASCII ... sequence
Patch by Dimitry Andric

llvm-svn: 180674
2013-04-27 16:26:29 +00:00
Dmitri Gribenko d3c5a51e9d Documentation: add an idea for a cpp14-migrate transform for N3421
llvm-svn: 180672
2013-04-27 13:41:02 +00:00
Dmitri Gribenko 148fdf2ed1 Documentation: improve description of make_shared transformation, as suggested by David Blaikie
llvm-svn: 180627
2013-04-26 20:20:30 +00:00
Ted Kremenek 004e823539 Further wordsmith release notes for the static analyzer.
llvm-svn: 180585
2013-04-26 00:01:34 +00:00
Anna Zaks b6219a9f0e Add Static Analyzer section to the Release Notes for clang 3.3
llvm-svn: 180582
2013-04-25 23:14:38 +00:00
Dmitri Gribenko 046a8ece54 Add an idea for cpp11-migrate and cpp14-migrate
llvm-svn: 180266
2013-04-25 16:07:10 +00:00
Ted Kremenek 3a2291b837 Release note the change to clang_CXCursorSet_contains().
llvm-svn: 180178
2013-04-24 07:33:52 +00:00
Richard Smith 25b555a6bf C++11 support is now feature-complete.
llvm-svn: 179861
2013-04-19 17:00:31 +00:00
Manuel Klimek f5a0ae82e9 Multiple improvements to the AST matcher tutorial.
Patch by Jochen Eisinger.

llvm-svn: 179758
2013-04-18 14:30:45 +00:00
Bob Wilson fd4f39e893 Add description of -Ofast optimization option to the man page. <rdar://13660458>
llvm-svn: 179733
2013-04-17 22:32:43 +00:00
Andy Gibbs 9c2ccd622f Implemented #pragma GCC warning/error in the same mould as #pragma message.
llvm-svn: 179687
2013-04-17 16:16:16 +00:00
Manuel Klimek 21ae2519bb This corrects problems in the LibASTMatchers tutorial.
Patch by Jochen Eisinger.

llvm-svn: 179683
2013-04-17 15:02:12 +00:00
Daniel Jasper dd77743af8 Small improvements to clang-format documentation and integration
scripts.

llvm-svn: 179676
2013-04-17 07:55:02 +00:00
Daniel Dunbar e246fbe40b [Modules] Convert module specific -fno-modules-autolink into -fno-autolink.
- There is no reason to have a modules specific flag for disabling
   autolinking. Instead, convert the existing flag into -fno-autolink (which
   should cover other autolinking code generation paths like #pragmas if and
   when we support them).

llvm-svn: 179612
2013-04-16 18:21:19 +00:00
Dmitri Gribenko a7d16ceee6 Add an option to parse all comments as documentation comments
Patch by Amin Shali.

llvm-svn: 179180
2013-04-10 15:35:17 +00:00
Edwin Vane 9fbb842c6d Updating cpp11-migrate transform list in ClangTools docs
Author: Philip Dunstan <phil@phildunstan.com>
llvm-svn: 179128
2013-04-09 20:51:47 +00:00
Edwin Vane 37ee1d7b80 Adding new AST Matchers isVirtual and isOverride
isVirtual - matches CXXMethodDecl nodes for virtual methods
isOverride - matches CXXMethodDecl nodes for methods that override virtual methods from a base class.

Author: Philip Dunstan <phil@philipdunstan.com>
llvm-svn: 179126
2013-04-09 20:46:36 +00:00
Rafael Espindola 9ca6e810b7 Mention the changes in the handling of language linkage in the release notes.
llvm-svn: 179094
2013-04-09 12:51:24 +00:00
Peter Collingbourne 54d770cb1f If the user requested a zero-base-shadow sanitizer, infer -pie and -fPIC when appropriate.
Differential Revision: http://llvm-reviews.chandlerc.com/D502

llvm-svn: 179082
2013-04-09 04:35:11 +00:00
Jordan Rose 2de3daa0a2 [analyzer] Enable destructor inlining by default (c++-inlining=destructors).
This turns on not only destructor inlining, but inlining of constructors
for types with non-trivial destructors. Per r178516, we will still not
inline the constructor or destructor of anything that looks like a
container unless the analyzer-config option 'c++-container-inlining' is
set to 'true'.

In addition to the more precise path-sensitive model, this allows us to
catch simple smart pointer issues:

  #include <memory>

  void test() {
    std::auto_ptr<int> releaser(new int[4]);
  } // memory allocated with 'new[]' should not be deleted with 'delete'

<rdar://problem/12295363>

llvm-svn: 178805
2013-04-04 23:10:29 +00:00
Rafael Espindola 6ae7e50be4 Add 178663 back.
http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green
before it processed the reverted 178663, so it could not have been the culprit.

Revert "Revert 178663."

This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41.

llvm-svn: 178682
2013-04-03 19:27:57 +00:00
Rafael Espindola 985a3abee4 Revert 178663.
Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb

Revert "Don't compute a patched/semantic storage class."

This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05.

llvm-svn: 178681
2013-04-03 19:22:20 +00:00
Rafael Espindola adea16bd9e Don't compute a patched/semantic storage class.
For variables and functions clang used to store two storage classes. The one
"as written" in the code and a patched one, which, for example, propagates
static to the following decls.

This apparently is from the days clang lacked linkage computation. It is now
redundant and this patch removes it.

llvm-svn: 178663
2013-04-03 15:50:00 +00:00
Edwin Vane 119d3dfcba Adding a hasLocalQualifiers() AST Matcher.
Updated tests and docs.

llvm-svn: 178556
2013-04-02 18:15:55 +00:00
Edwin Vane ec0748068e Adding parenType() and innerType() AST Matchers
Updated docs and tests.

llvm-svn: 178487
2013-04-01 18:33:34 +00:00
Edwin Vane 584da4043e Updating LibASTMatchersReference
The generator for LibASTMatchersReference.html didn't get run last time
ASTMatchers changes were made. Here are up-to-date docs.

llvm-svn: 178234
2013-03-28 13:50:22 +00:00
Douglas Gregor bf7fc9c542 <rdar://problem/13509689> Introduce -module-file-info option that provides information about a particular module file.
This option can be useful for end users who want to know why they
ended up with a ton of different variants of the "std" module in their
module cache. This problem should go away over time, as we reduce the
need for module variants, but it will never go away entirely.

llvm-svn: 178148
2013-03-27 16:47:18 +00:00
Douglas Gregor 527b1c95df <rdar://problem/13434605> Periodically prune the module cache so that it does not grow forever.
llvm-svn: 177918
2013-03-25 21:19:16 +00:00
Daniel Jasper 4172375713 Update docs after moving clang-format from clang-tools-extra to cfe.
llvm-svn: 177729
2013-03-22 12:44:20 +00:00
Dmitri Gribenko 22ee0c17a6 Documentation: fix a typo and formatting
llvm-svn: 177722
2013-03-22 10:25:15 +00:00
Douglas Gregor aeb2a3c3a2 Add future directions for modules
llvm-svn: 177707
2013-03-22 07:08:56 +00:00
Douglas Gregor 485996c696 More modules documentation, including the straw-man import declaration syntax and "how to modularize a platform".
llvm-svn: 177706
2013-03-22 07:05:07 +00:00
Douglas Gregor de0beaa8f8 More documentation on the module map language.
llvm-svn: 177704
2013-03-22 06:21:35 +00:00
Sean Silva 99c9d9810b [docs] Point inquisitive users to existing module.map files.
llvm-svn: 177552
2013-03-20 18:37:47 +00:00
Sean Silva 28e0def9f3 [docs] Prominently note that modules are expemental.
And ask for people to try it out and send us bug reports!

llvm-svn: 177551
2013-03-20 18:37:42 +00:00
Douglas Gregor bb1c7e358c Fix typo and grammaro in modules documentation
llvm-svn: 177544
2013-03-20 17:11:13 +00:00
Douglas Gregor e703f2dc30 Work-in-progress documentation on the experimental modules feature.
llvm-svn: 177491
2013-03-20 06:25:14 +00:00
Dmitri Gribenko 4e72a40604 Documentation: improve formatting
llvm-svn: 177066
2013-03-14 12:53:46 +00:00
Alexey Samsonov f29d81f234 [ASan] Update docs for -fsanitize=init-order option
llvm-svn: 177062
2013-03-14 12:26:21 +00:00
Dmitri Gribenko 3605f319dd Documentation: formatting fixes
llvm-svn: 176948
2013-03-13 14:26:35 +00:00
John McCall cdda29c968 Tighten up the rules for precise lifetime and document
the requirements on the ARC optimizer.

rdar://13407451

llvm-svn: 176924
2013-03-13 03:10:54 +00:00
Sean Silva 983caaacbb [docs] Add rtags to the external examples.
llvm-svn: 176871
2013-03-12 16:07:31 +00:00
Sean Silva 03bfc678c5 [docs] Add SourceWeb as external example.
llvm-svn: 176848
2013-03-12 02:11:17 +00:00
Sean Silva cc268f0e05 [docs] Add ellipsis.
llvm-svn: 176810
2013-03-11 17:07:47 +00:00
Edwin Vane 2a760d02f7 Adding lvalue and rvalue reference type matchers
Updated docs and tests.
    
Reviewers: klimek, gribozavr

llvm-svn: 176630
2013-03-07 15:44:40 +00:00
Edwin Vane 0a4836ed0e New ASTMatchers and enhancement to hasOverloadedOperatorName
Added two new narrowing matchers:
* hasMethod: aplies a matcher to a CXXRecordDecl's methods until a match is made
  or there are no more methods.
* hasCanonicalType: applies a matcher to a QualType's canonicalType.

Enhanced hasOverloadedOperatorName to work on CXXMethodDecl as well as
CXXOperatorCallExpr.

Updated tests and docs.

Reviewers: klimek, gribozavr
llvm-svn: 176556
2013-03-06 17:02:57 +00:00
Edwin Vane eec9a93262 Make LibASTMatchersTutorial code match text
Fixed code to match text. Slight adjustment for readability.

Author: Béatrice Creusillet
llvm-svn: 176493
2013-03-05 18:04:37 +00:00
Dmitri Gribenko 68a0668453 Documentation: use code highlighting
llvm-svn: 176480
2013-03-05 13:05:56 +00:00
Edwin Vane 6972f6d3c7 hasQualifer() matcher should return false if there's no qualifier
Instead of passing NULL on to sub-matcher, just return false. Updated tests and
regenerated docs.

Author: Tareq A Siraj <tareq.a.siraj@intel.com>
llvm-svn: 176441
2013-03-04 17:51:00 +00:00
Manuel Klimek 3de6d3a2a0 Make the tutorial easier to compile by adding in some of the details.
Patch by Béatrice Creusillet.

llvm-svn: 176434
2013-03-04 11:31:46 +00:00
Dmitri Gribenko 80bfa95d5b Add an idea for a cpp11-migrate tool: TR1 migration
Idea by Marshall Clow.

llvm-svn: 176423
2013-03-03 17:54:36 +00:00
Sean Silva d4ac85d21a [docs] Spelling
llvm-svn: 176421
2013-03-03 17:07:35 +00:00
Sean Silva edd5ca5a36 [docs] Use vim code-block instead of console.
llvm-svn: 176418
2013-03-03 15:17:35 +00:00
John McCall 73fc0385de Attempt to not place ownership qualifiers on the result type
of block declarators.  Document the rule we use.

Also document the rule that Doug implemented a few weeks ago
which drops ownership qualifiers on function result types.

rdar://10127067

llvm-svn: 176336
2013-03-01 07:58:16 +00:00
Hans Wennborg c32d513385 ClangFormat.rst: Fix two small typos
llvm-svn: 176276
2013-02-28 18:16:24 +00:00
Jordan Rose 4587b28758 [analyzer] Turn on C++ constructor inlining by default.
This enables constructor inlining for types with non-trivial destructors.
The plan is to enable destructor inlining within the next month, but that
needs further verification.

<rdar://problem/12295329>

llvm-svn: 176200
2013-02-27 18:49:43 +00:00
Kostya Serebryany 4c0fc9931e Unify clang/llvm attributes for asan/tsan/msan (Clang part)
These are two related changes (one in llvm, one in clang).
LLVM: 
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory

CLANG: 
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))

for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S

llvm-svn: 176076
2013-02-26 06:58:27 +00:00
Edwin Vane b6eae14c15 Various additions to ASTMatcher library:
New type matchers:
* recordType
* elaboratedType

New narrowing matchers:
* hasQualifier
* namesType
* hasDeclContext

Added tests and updated LibASTMatchersReference.

Reviewers: klimek
llvm-svn: 176047
2013-02-25 20:43:32 +00:00
Edwin Vane f901b71921 Adding hasDeclaration overload for TemplateSpecializationType
TemplateSpecializationType doesn't quite have getDecl(). Need to go
through TemplateName to get a TemplateDecl.

Added test cases for the hasDeclaration() overload for
TemplateSpecializationType. Also introduced the type matcher
templateSpecializationType() used by the new hasDeclaration() test case.

Updated LibASTMatchersReference.

Reviewers: klimek
llvm-svn: 176025
2013-02-25 14:49:29 +00:00
Daniel Jasper 64c3851be6 Update generated documentation after recent matcher addition.
llvm-svn: 176018
2013-02-25 12:39:41 +00:00
Dmitri Gribenko a431ae6842 Documentation: add an idea for a (weird) clang tool
llvm-svn: 176005
2013-02-25 01:14:45 +00:00
Dmitri Gribenko 2b125832e3 Documentation: add an idea for an automatic refactoring
llvm-svn: 176000
2013-02-24 19:04:36 +00:00
David Blaikie 5352e644b3 Reference the canonical commit (r175462) in the value casting release note.
llvm-svn: 175971
2013-02-23 19:30:31 +00:00
David Blaikie 6850acfcbb Document the value casting API changes.
After changing the way several value inheritance hierarchies (TypeLoc,
CFGelement, ProgramPoint and SVal) handle casting, this documentation describes
how 3rd party code may need to be updated to compile with the new APIs.

As suggested by Sean Silva on cfe-dev.

llvm-svn: 175970
2013-02-23 19:27:10 +00:00
Peter Collingbourne 47f9f2d1e6 Revert r175912, "Add support for coldcc to clang" at John's request.
llvm-svn: 175936
2013-02-23 00:06:18 +00:00
Peter Collingbourne f32b3f2c55 Add support for coldcc to clang
llvm-svn: 175912
2013-02-22 19:24:35 +00:00
Richard Smith b3a145293d Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,
to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting
levels for parentheses, brackets and braces.

Some code with heavy macro use exceeds the default limit of 256, but we don't
want to increase it generally to avoid stack overflow on stack-constrained
systems.

llvm-svn: 175855
2013-02-22 01:59:51 +00:00
Michael Gottesman 3ae54b2f41 Added a footnote to the documentation for objc_storeStrong that makes it clear
that a __strong object of block type is a valid argument to objc_storeStrong but
that an objc_retain and not an objc_retainBlock will be emitted.

llvm-svn: 175838
2013-02-22 00:16:48 +00:00
Sean Silva f2a472a321 [docs] Rename to permit wider variety of content.
I don't want to rule out the possibility of linking to e.g. interesting
blog posts about uses of Clang, so avoid restricting the content to
"projects".

This breaks URL compatibility, but this document was committed less than
an hour ago so hopefully nobody has linked to it yet.

llvm-svn: 175535
2013-02-19 17:29:01 +00:00
Sean Silva e3931a1cd4 [docs] Revise content on ExternalProjectsUsingClang page.
llvm-svn: 175534
2013-02-19 17:21:23 +00:00
Edwin Vane 2c197e0939 Support in hasDeclaration for types with getDecl()
Using a new metafunction for detecting the presence of the member
'getDecl' in a type T, added support to hasDeclaration for any such type
T. This allows hasDecl() to be replaced and enables several other
subclasses of clang::Type to use hasDeclaration.

Updated unittests and LibASTMatchersReference.html.

Reviewers: klimek
llvm-svn: 175532
2013-02-19 17:14:34 +00:00
Sean Silva 63c3af69b8 [docs] Introduce ExternalProjectsUsingClang.rst
A couple concrete examples are sure to be a win. If you know of any
other external projects using Clang, please let me know!

Patch by Laszlo Nagy! (with a title tweak by me)

llvm-svn: 175529
2013-02-19 16:58:15 +00:00
Richard Smith d06a87047d Actually fix rendering of the example code block!
llvm-svn: 175113
2013-02-14 00:23:04 +00:00
Richard Smith fabbcd9bcf Some grammar fixes to 'Format String Checking', and reorder the text slightly to try to make the final code block actually get rendered.
llvm-svn: 175112
2013-02-14 00:22:00 +00:00
Richard Smith f6d2d3bb40 Document Clang's support for [[gnu::...]] attributes.
llvm-svn: 175110
2013-02-14 00:13:34 +00:00
Argyrios Kyrtzidis f0ad09f8f6 [docs] The stat cache has been removed from the PCH, update the docs to remove mentions of it.
llvm-svn: 175109
2013-02-14 00:12:44 +00:00
Jordan Rose d9759fdb03 Release notes: mention support for Unicode and UCNs in identifiers.
I'm using the name "Extended Identifiers" for the feature because that's
what GCC calls them. According to the standard, the new feature is
"universal character names are now allowed in identifiers", but the more
interesting "feature" is that identifiers can now contain Unicode characters,
however they are written.

llvm-svn: 174798
2013-02-09 02:12:23 +00:00
Dmitri Gribenko 50e5924e43 Documentation: fix typo: stdard -> stdarg
llvm-svn: 174613
2013-02-07 14:48:33 +00:00
Dmitri Gribenko 90ccd44e94 Documentation: add information about builtin includes to FAQ
llvm-svn: 174612
2013-02-07 14:36:37 +00:00
Manuel Klimek bee085762b Implements equalsNode for Decl and Stmt.
This is a powerful tool when doing iterative refined matches,
where another match is started inside the match callback of the first
one; this allows for example to find out whether the node was in
the condition or body of its parent if-statement.

llvm-svn: 174605
2013-02-07 12:42:10 +00:00
Manuel Klimek 4feac28e0e Cleanup of ASTMatcher macros and adding support for overloaded matchers.
This is in preparation for adding other overloaded matchers. This change
alone is a net win in LOC.
I went through all matchers and looked whether we could now encode them
as macro, or simplify them with the matcher atoms that were not
available before.

llvm-svn: 174540
2013-02-06 20:36:22 +00:00
Jordan Rose 1f25dcb167 [analyzer] Add a doc describing the internals of RegionStore.
This is a text file with Markdown-ish formatting because we haven't decided
where analyzer internal documents should go, but it's probably better to
have this in source control than sitting on my local drive forever.

llvm-svn: 174398
2013-02-05 17:31:34 +00:00
Ted Kremenek 653f523664 Revert "Remove sparse text on diagnostic options. These are not really documented anywhere, and they really aren't for normal users."
I changed my mind.  We should just document these in the man page.

llvm-svn: 174344
2013-02-05 06:33:47 +00:00
Ted Kremenek e2af9b5d2c Remove sparse text on diagnostic options. These are not really documented anywhere, and they really aren't for normal users.
llvm-svn: 174338
2013-02-05 05:55:21 +00:00
Manuel Klimek abf4371339 Implements the convenience matcher findAll.
We found that findAll has been implemented incorrectly multiple times
by various people using the matchers. To prevent further wasted
development effort, it makes sense to add it as convenience matcher
implemented as eachOf(m, forEachDescendant(m)).

This patch also updates the docs with the new matchers.

llvm-svn: 174320
2013-02-04 10:59:20 +00:00
Anna Zaks 70aa53180d [analyzer] Remove further references to analyzer-ipa.
Thanks Jordan!

llvm-svn: 173955
2013-01-30 19:12:26 +00:00
Dmitri Gribenko 2625cf06ff Documentation: fix escaping in JSON example
llvm-svn: 173950
2013-01-30 17:58:39 +00:00
Dmitri Gribenko b46dc57feb Documentation: add a link to Bear, a tool to help with JSON DB
Patch by Laszlo Nagy

llvm-svn: 173949
2013-01-30 17:58:14 +00:00
Chad Rosier ae229d599b [ubsan] Implement the -fcatch-undefined-behavior flag using a trapping
implementation; this is much more inline with the original implementation
(i.e., pre-ubsan) and does not require run-time library support.

The trapping implementation can be invoked using either '-fcatch-undefined-behavior'
or '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error', with the latter
being preferred.  Eventually, the -fcatch-undefined-behavior' flag will be removed.

llvm-svn: 173848
2013-01-29 23:31:22 +00:00
Sean Silva cc8fbbf129 docs: clear up ambiguity
Anybody using clang is a "developer".

llvm-svn: 173282
2013-01-23 18:28:48 +00:00
Dmitri Gribenko 18d8a461e5 Documentation: add a note that -cc1 options are not guaranteed to be stable
llvm-svn: 173280
2013-01-23 18:02:28 +00:00
Dmitri Gribenko c6f1e56745 Update docs: nullptr conversion tool landed
llvm-svn: 173183
2013-01-22 19:22:22 +00:00
Dmitri Gribenko 764ea24cfd Documentation: formatting
llvm-svn: 172729
2013-01-17 17:04:54 +00:00
Aaron Ballman 1f0fa91bed Adding verbiage to the Language Extensions document about __has_include and __has_include_next only being allowed within preprocessor directives.
llvm-svn: 172643
2013-01-16 19:51:19 +00:00
Dmitri Gribenko fb5b2245c1 Documentation: fix typo
llvm-svn: 172588
2013-01-16 01:17:05 +00:00
Douglas Gregor 250ee63515 Document the redeclaration and overriding restrictions on the
availability attribute.

llvm-svn: 172587
2013-01-16 01:12:31 +00:00
Dmitri Gribenko fdfc739277 Document that we should recognize attributes supported by gcc with C++11
[[gnu::...]] syntax

Pointed out by Richard Smith on the mailing list.

llvm-svn: 172487
2013-01-14 22:44:07 +00:00
Dmitri Gribenko dc81f51d37 Document behavior of -Wformat-nonliteral, it is different from GCC
llvm-svn: 172362
2013-01-13 16:37:18 +00:00
Michael Gottesman c5cc9f154d Updated documentation to reflect new multiprecision builtin functions.
llvm-svn: 172345
2013-01-13 04:35:31 +00:00
Nikola Smiljanic 9d22fb11ba Fix spelling error and remove the part about CMake having experimental Ninja support since 2.8.9 has been released some time ago.
llvm-svn: 172182
2013-01-11 07:23:53 +00:00
Nikola Smiljanic 7835e3d1fe Revert the line ending mess I made.
llvm-svn: 172179
2013-01-11 07:14:58 +00:00
Nikola Smiljanic f1bb07f1d8 Fix spelling error and remove the part about CMake having experimental Ninja support since 2.8.9 has been released some time ago.
llvm-svn: 172177
2013-01-11 07:09:00 +00:00
Dmitri Gribenko dd7d8a0f35 ClangTools.rst: spelling and formatting
llvm-svn: 172008
2013-01-09 22:22:51 +00:00
Dmitri Gribenko cb9ede9437 ClangFormat.rst: improve formatting
llvm-svn: 172007
2013-01-09 22:18:55 +00:00
Daniel Jasper 85a77c1609 Add documentation for clang-format.
This adds documentation for both LibFormat as well as the standalone
tools and integrations built on top of it. It slightly restructures
the ClangTools documentation.

llvm-svn: 172004
2013-01-09 21:49:28 +00:00
Manuel Klimek cdd5c2397a Fixes dump_ast_matchers to parse all matcher macros and updates the
docs.

llvm-svn: 171962
2013-01-09 09:38:21 +00:00
Nico Weber 69dce49c76 Don't mention -fno-diagnostics-print-source-range-info in manual.
Clang doesn't understand it.

If someone wants to teach clang about that flag instead, please also add
support for -fno-diagnostics-parseable-fixits for consistency.

Until then, let the documentation match the current behavior.

llvm-svn: 171952
2013-01-09 05:06:41 +00:00
Michael Gottesman 675444d5de Removed extra "`" from ARC documentation.
llvm-svn: 171920
2013-01-08 23:55:10 +00:00
Sean Silva 3703823b89 docs: "clang tools" are not a different interface.
I spotted someone confused about this, so remove the heading to make it
clear that they really are a part of Tooling.

llvm-svn: 171841
2013-01-08 04:42:09 +00:00
Michael Gottesman 6fd5846b57 Converted Block-ABI-Apple.txt => Block-ABI-Apple.rst.
llvm-svn: 171799
2013-01-07 22:24:45 +00:00
Sean Silva 449e4926a6 docs: Fix inconsistent titles.
Sphinx was whining about this.

llvm-svn: 171796
2013-01-07 21:46:47 +00:00
Sean Silva dc92fc3426 docs: Copy Block-ABI-Apple.txt to output.
This fixes the URL permanence of that URL. This is a bit of a hack. See
the FIXME in the patch for what the "real" solution should be.

llvm-svn: 171795
2013-01-07 21:46:35 +00:00
Daniel Dunbar 5cfa4aeee5 [docs/analyzer] Test commit (for auto-update).
llvm-svn: 171788
2013-01-07 20:44:37 +00:00
Daniel Dunbar 98a93b3845 [docs] Fix an inconsistent title level, and a sphinx warning.
- We don't need any static files currently, so drop that dir.

llvm-svn: 171787
2013-01-07 20:43:06 +00:00
Daniel Dunbar 48f8bc895b [docs/analyzer] Convert existing debug-checks document to Sphinx and link into doctree.
llvm-svn: 171786
2013-01-07 20:38:55 +00:00
Dmitri Gribenko 5f3c9200e5 ClangTools doc: add ideas for new tools in clang-tools-extra to ensure that
these ideas don't get lost

llvm-svn: 171667
2013-01-06 20:19:09 +00:00
Dmitri Gribenko 4077efc146 Clang docs: add some information about the difference between 'clang' and 'clang -cc1'
This is coming up again and again on the mailing list and IRC.

llvm-svn: 171656
2013-01-06 13:38:34 +00:00
Sean Silva ab3314f4d7 Add docs/README.txt to point to llvm/docs/README.txt.
llvm-svn: 171426
2013-01-02 23:25:41 +00:00
Sean Silva cd61d28c4a analyzer: add initial Sphinx configuration
This is just the output of sphinx-quickstart. Now all that is needed
to begin converting the analyzer docs to reST is the server-side setup.

The analyzer folks have asked me to keep this segregated from the other
clang docs since the analyzer is a logically separate project (and has
its own separate web page) even though it resides in the clang tree.

llvm-svn: 171425
2013-01-02 23:07:22 +00:00
Sean Silva 437db15978 Exclude docs/analyzer/ from the default Sphinx build.
This paves the way for converting the analyzer docs to Sphinx (by
setting up a nested Sphinx tree in this directory).

llvm-svn: 171424
2013-01-02 22:48:50 +00:00
Sean Silva b045514abf docs: Mark ReleaseNotes as "In-Progress"
Even though we do have a `.. warning::` directive on the page, hopefully
having "In-Progress" in the title will help to condition people's
expectations a bit for when they run into the extremely bare-bones
release notes.

Also, when release season comes around again, maybe this will get
people's attention and avoid confusion about what is going into the
upcoming release, and what is for changes to trunk for the next version.

llvm-svn: 171419
2013-01-02 22:05:33 +00:00
Sean Silva aaa78eefe7 docs: Take advantage of extra level of headings.
The way Sphinx treats the "top-level" adornments is weird. It usually
uses the first top-level adornment as the page title, even if the
top-level adornment is just one "section" out of many (i.e. if the first
section is "Introduction", then it will make the page title be
"Introduction"). This behavior can be overriden by using an explicit
`..  title::` directive to set the title.

Since the Sphinx stylesheet that Clang is currently using ('haiku')
nicely puts the document title at the top of the page in the header,
this weird default behavior was resulting in a redundant "title" in the
body content. Getting rid of this redundant level of headings
effectively "exposes" one more level of heading from the stylesheet to
which now makes the real "sections" more distinct.

llvm-svn: 171417
2013-01-02 21:50:48 +00:00
Sean Silva 13d43feb11 docs: Curb excessive table-of-contents depth.
llvm-svn: 171410
2013-01-02 21:09:58 +00:00
Sean Silva f380e0e24b docs: Reorganize landing page.
Language extensions are highly relevant to using clang as a compiler, so
move LanguageExtensions up into `Using Clang as a Compiler` on the
landing page.

The other documents from the now-gone `Language Extensions and Specs`
section on the landing page nicely fit hierarchically under
LanguageExtensions.rst, so put them under LanguageExtensions.rst's
toctree instead of on the landing page.

Impetus from Jordan Rose.

llvm-svn: 171409
2013-01-02 21:03:11 +00:00
Sean Silva 29b7a60b12 docs: Fix spelling error.
Spotted by Nikola Smiljanic.

llvm-svn: 171407
2013-01-02 20:22:14 +00:00