Commit Graph

1401 Commits

Author SHA1 Message Date
Vedant Kumar 553a0d62f2 [docs] Add a limitations section to SourceBasedCodeCoverage.rst
llvm-svn: 271544
2016-06-02 17:19:45 +00:00
Vedant Kumar 6c53d8f94c [docs] Fix misplaced comma
llvm-svn: 271472
2016-06-02 02:45:59 +00:00
Vedant Kumar 0819f36ddd [docs] Minor formatting changes and typo fixes
llvm-svn: 271471
2016-06-02 02:25:13 +00:00
Vedant Kumar 4c1112c3b7 [docs] Use cpp code-blocks where appropriate
llvm-svn: 271461
2016-06-02 01:15:59 +00:00
Vedant Kumar 01d91eeac5 [docs] Add missing newline to console section
llvm-svn: 271457
2016-06-02 01:01:48 +00:00
Vedant Kumar a530a3615e [docs] Document the source-based code coverage feature
Differential Revision: http://reviews.llvm.org/D20715

llvm-svn: 271454
2016-06-02 00:51:50 +00:00
Piotr Padlewski cfed2bf588 [ASTMatchers] Breaking change of `has` matcher
has matcher can now match to implicit and paren casts

http://reviews.llvm.org/D20801

llvm-svn: 271288
2016-05-31 15:25:05 +00:00
Alexey Bataev 44b67508ea [OPENMP] Update in ReleaseNotes for OpenMP support.
Added notes about full support of all non-offloading features of OpenMP
4.5 + info about option -fopenmp-version=[31|40|45] that allows to
control supported OpenMP version.

llvm-svn: 271263
2016-05-31 11:17:08 +00:00
Etienne Bergeron 5500f95a00 [ASTMatchers] Add support of hasCondition for SwitchStmt.
Summary:
The switch statement could be added to the hasCondition matcher.

Example:
```
clang-query> match switchStmt(hasCondition(ignoringImpCasts(declRefExpr())))
```

Output:
```
Match #1:

Binding for "root":
SwitchStmt 0x2f9b528 </usr/local/google/home/etienneb/examples/enum.cc:35:3, line:38:3>
|-<<<NULL>>>
|-ImplicitCastExpr 0x2f9b510 <line:35:11> 'int' <IntegralCast>
| `-ImplicitCastExpr 0x2f9b4f8 <col:11> 'enum Color' <LValueToRValue>
|   `-DeclRefExpr 0x2f9b4d0 <col:11> 'enum Color' lvalue Var 0x2f9a118 'C' 'enum Color'
`-CompoundStmt 0x2f9b610 <col:14, line:38:3>
  |-CaseStmt 0x2f9b578 <line:36:3, col:22>
  | |-ImplicitCastExpr 0x2f9b638 <col:8> 'int' <IntegralCast>
  | | `-DeclRefExpr 0x2f9b550 <col:8> 'enum Size' EnumConstant 0x2f99e40 'Small' 'enum Size'
  | |-<<<NULL>>>
  | `-ReturnStmt 0x2f9b5d0 <col:15, col:22>
  |   `-IntegerLiteral 0x2f9b5b0 <col:22> 'int' 1
  `-DefaultStmt 0x2f9b5f0 <line:37:3, col:12>
    `-BreakStmt 0x2f9b5e8 <col:12>

1 match.
```

Reviewers: aaron.ballman, sbenza, klimek

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D20767

llvm-svn: 271208
2016-05-30 15:25:25 +00:00
Peter Collingbourne b0195f28d7 docs: Clarify that LTO visibility is based on source-level symbol visibility.
llvm-svn: 271063
2016-05-27 22:31:30 +00:00
Kostya Serebryany 2494e8a6a2 [msan] add a sentence about inline assembly
llvm-svn: 271005
2016-05-27 15:49:32 +00:00
Simon Dardis d0e83bad13 [mips] Compact branch policy setting.
This patch adds the commandline option -mcompact-branches={never,optimal,always),
which controls how LLVM generates compact branches for MIPSR6 targets. By default,
the compact branch policy is 'optimal' where LLVM will generate the most
appropriate branch for any situation. The 'never' and 'always' policy will disable
or always generate compact branches wherever possible respectfully.

Reviewers: dsanders, vkalintiris, atanasyan

Differential Revision: http://reviews.llvm.org/D20729

llvm-svn: 271000
2016-05-27 15:13:31 +00:00
Peter Collingbourne a9f38983e8 docs: Document how safestack handles setjmp and exceptions.
llvm-svn: 270634
2016-05-24 23:38:02 +00:00
David Majnemer b3d96882ec Clang support for __is_assignable intrinsic
MSVC now supports the __is_assignable type trait intrinsic,
to enable easier and more efficient implementation of the
Standard Library's is_assignable trait.
As of Visual Studio 2015 Update 3, the VC Standard Library
implementation uses the new intrinsic unconditionally.

The implementation is pretty straightforward due to the previously
existing is_nothrow_assignable and is_trivially_assignable.
We handle __is_assignable via the same code as the other two except
that we skip the extra checks for nothrow or triviality.

Patch by Dave Bartolomeo!

Differential Revision: http://reviews.llvm.org/D20492

llvm-svn: 270458
2016-05-23 17:21:55 +00:00
Justin Lebar 84da8b221e Update -ffast-math documentation to match reality.
Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D20457

llvm-svn: 270279
2016-05-20 21:33:01 +00:00
Haojian Wu 7751c92582 [ASTMatcher] Add a node matcher for UnresolvedLookupExpr.
Reviewers: alexfh, aaron.ballman

Subscribers: aaron.ballman, klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D20360

llvm-svn: 269916
2016-05-18 12:53:59 +00:00
Aaron Ballman abdbbbc51f Add the hasDynamicExceptionSpec() AST matcher to match function declarations that have a dynamic exception specification.
Patch by Don Hinton.

llvm-svn: 269662
2016-05-16 16:49:01 +00:00
Etienne Bergeron 75e52725e4 Add an AST matcher for CastExpr kind
Summary:
This AST matcher will match a given CastExpr kind.
It's an narrowing matcher on CastExpr.

Reviewers: klimek, alexfh, sbenza, aaron.ballman

Subscribers: Prazek, jroelofs, aaron.ballman, klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D19871

llvm-svn: 269460
2016-05-13 19:36:55 +00:00
Filipe Cabecinhas ab731f7e86 [ubsan] Add -fsanitize-undefined-strip-path-components=N
Summary:
This option allows the user to control how much of the file name is
emitted by UBSan. Tuning this option allows one to save space in the
resulting binary, which is helpful for restricted execution
environments.

With a positive N, UBSan skips the first N path components.
With a negative N, UBSan only keeps the last N path components.

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19666

llvm-svn: 269309
2016-05-12 16:51:36 +00:00
Etienne Bergeron 3588be7fa1 Add an AST matcher for string-literal length
Summary:
This patch is adding support for a matcher to check string literal length.

This matcher is used in clang-tidy checkers and is part of this refactoring:
  see: http://reviews.llvm.org/D19841

Reviewers: sbenza, klimek, aaron.ballman

Subscribers: alexfh, klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D19876

llvm-svn: 269274
2016-05-12 04:20:04 +00:00
Richard Smith 1a015f5481 More fixes to codeblock formatting in documentation.
llvm-svn: 268749
2016-05-06 16:48:29 +00:00
Aaron Ballman dc76a4db0f s/codeblock/code-block to fix the Sphinx build.
llvm-svn: 268728
2016-05-06 11:56:57 +00:00
Richard Smith 8eb53c8e22 Some release note updates for C++ language acceptance changes since Clang 3.8.
llvm-svn: 268663
2016-05-05 18:40:37 +00:00
Samuel Benzaquen a4076ea8a2 Fix the doc extraction script to work with hasAnyName and with equalsNode.
The change from llvm::VariadicFunction to internal::VariadicFunction
broke the extraction of hasAnyName().
equalsNode was broken because the argument type is 'const XXXX*' and
the internal space caused a failure on the regex.

llvm-svn: 268548
2016-05-04 20:45:00 +00:00
Kostya Serebryany 40b8215d2f fix docs
llvm-svn: 268541
2016-05-04 20:24:54 +00:00
Kostya Serebryany ceb1add630 document -f[no-]sanitize-recover=all and mention it in warning messages
llvm-svn: 268540
2016-05-04 20:21:47 +00:00
Gabor Horvath 1b3f8db8b6 [ASTMatchers] New matcher forFunction
Summary: Matcher proposed in the review of checker misc-assign-operator (name pending). Its goal is to find the direct enclosing function declaration of a statement and run the inner matcher on it. Two version is attached in this patch (thus it will not compile), to be decided which approach to take. The second one always chooses one single parent while the first one does a depth-first search upwards (thus a height-first search) and returns the first positive match of the inner matcher (thus it always returns zero or one matches, not more). Further questions: is it enough to implement it in-place, or ASTMatchersInternals or maybe ASTMatchFinder should be involved?

Reviewers: sbenza

Subscribers: aaron.ballman, klimek, o.gyorgy, xazax.hun, cfe-commits

Differential Revision: http://reviews.llvm.org/D19357

llvm-svn: 268490
2016-05-04 11:59:39 +00:00
David L Kreitzer d8984101e5 Add address space 258 (X86 SS segment) to clang documentation.
The change reflects llvm r268431.

Patch by Michael Lemay (michael.lemay@intel.com)

Differential Revision: http://reviews.llvm.org/D19458

llvm-svn: 268432
2016-05-03 20:20:59 +00:00
Peter Collingbourne 3afb266886 Re-apply r267784, r267824 and r267830.
I have updated the compiler-rt tests.

llvm-svn: 267903
2016-04-28 17:09:37 +00:00
Manuel Klimek 9db931021e Fix build.
llvm-svn: 267883
2016-04-28 14:28:19 +00:00
Manuel Klimek 13b7064b55 Fix spuriously dematerializing reference bug. Fixes PR26612.
llvm-svn: 267877
2016-04-28 13:37:45 +00:00
Benjamin Kramer 5556a5cf3b Revert r267784, r267824 and r267830.
It makes compiler-rt tests fail if the gold plugin is enabled.

Revert "Rework interface for bitset-using features to use a notion of LTO visibility."
Revert "Driver: only produce CFI -fvisibility= error when compiling."
Revert "clang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi."

llvm-svn: 267871
2016-04-28 12:14:47 +00:00
Peter Collingbourne a8b2f7c0d7 Rework interface for bitset-using features to use a notion of LTO visibility.
Bitsets, and the compiler features they rely on (vtable opt, CFI),
only have visibility within the LTO'd part of the linkage unit. Therefore,
only enable these features for classes with hidden LTO visibility. This
notion is based on object file visibility or (on Windows)
dllimport/dllexport attributes.

We provide the [[clang::lto_visibility_public]] attribute to override the
compiler's LTO visibility inference in cases where the class is defined
in the non-LTO'd part of the linkage unit, or where the ABI supports
calling classes derived from abstract base classes with hidden visibility
in other linkage units (e.g. COM on Windows).

If the cross-DSO CFI mode is enabled, bitset checks are emitted even for
classes with public LTO visibility, as that mode uses a separate mechanism
to cause bitsets to be exported.

This mechanism replaces the whole-program-vtables blacklist, so remove the
-fwhole-program-vtables-blacklist flag.

Because __declspec(uuid()) now implies [[clang::lto_visibility_public]], the
support for the special attr:uuid blacklist entry is removed.

Differential Revision: http://reviews.llvm.org/D18635

llvm-svn: 267784
2016-04-27 20:39:53 +00:00
George Burgess IV a17674b7cc [Docs] Fix indentation error introduced by r267447.
llvm-svn: 267501
2016-04-26 00:31:29 +00:00
George Burgess IV 58ebc66e98 [Docs] Clarify what the object-size sanitizer does.
Currently, the UBSan docs make it sound like the object-size sanitizer
will only detect out-of-bounds reads/writes. It also catches some
operations that don't necessarily access memory (invalid downcasts,
calls of methods on invalid pointers, ...). This patch adds a note
about this behavior in the docs.

llvm-svn: 267447
2016-04-25 19:21:45 +00:00
Kostya Serebryany 6453786b26 [sanitizer-coverage] better docs for -fsanitize-coverage=trace-bb
llvm-svn: 266672
2016-04-18 21:28:37 +00:00
Aaron Ballman 66eb58a756 Add typedefNameDecl() and typeAliasDecl() to the AST matchers; improves hasType() to match on TypedefNameDecl nodes.
Patch by Clement Courbet.

llvm-svn: 266331
2016-04-14 16:05:45 +00:00
Alexander Kornienko 7d20a5afdb Add AST Matchers for CXXConstructorDecl::isDelegatingConstructor and CXXMethodDecl::isUserProvided.
Summary: Added two AST matchers: isDelegatingConstructor for CXXConstructorDecl::IsDelegatingConstructor; and isUserProvided corresponding to CXXMethodDecl::isUserProvided.

Reviewers: aaron.ballman, alexfh

Subscribers: klimek, cfe-commits

Patch by Michael Miller!

Differential Revision: http://reviews.llvm.org/D19038

llvm-svn: 266189
2016-04-13 11:13:08 +00:00
John Brawn 8e62db3247 Add a PragmaHandler Registry for plugins to add PragmaHandlers to
This allows plugins which add AST passes to also define pragmas to do things
like only enable certain behaviour of the AST pass in files where a certain
pragma is used.

Differential Revision: http://reviews.llvm.org/D18319

llvm-svn: 265295
2016-04-04 14:22:58 +00:00
Paul Robinson 1c898c9e8c Docs: keep copyright years up-to-date.
llvm-svn: 264941
2016-03-30 22:24:57 +00:00
Gabor Horvath 1b654f2293 [ASTMatchers] Existing matcher hasAnyArgument fixed
Summary: A checker (will be uploaded after this patch) needs to check implicit casts. The checker needs matcher hasAnyArgument but it ignores implicit casts and parenthesized expressions which disables checking of implicit casts for arguments in the checker. However the documentation of the matcher contains a FIXME that this should be removed once separate matchers for ignoring implicit casts and parenthesized expressions are ready. Since these matchers were already there the fix could be executed. Only one Clang checker was affected which was also fixed (ignoreParenImpCasts added) and is separately uploaded. Third party checkers (not in the Clang repository) may be affected by this fix so the fix must be emphasized in the release notes.

Reviewers: klimek, sbenza, alexfh

Subscribers: alexfh, klimek, xazax.hun, cfe-commits

Differential Revision: http://reviews.llvm.org/D18243

llvm-svn: 264855
2016-03-30 11:22:14 +00:00
Reid Kleckner 2a5d34b5ef Update the description of Clang's MSVC compatibility flags
llvm-svn: 264651
2016-03-28 20:42:41 +00:00
Aaron Ballman bcf13da98e Fix Sphinx errors with documentation build.
llvm-svn: 264263
2016-03-24 12:34:44 +00:00
Eric Christopher 37df19ebee Add release notes for the removal of the silent include of altivec.h.
llvm-svn: 264236
2016-03-24 01:28:25 +00:00
Matt Arsenault 08087c52eb Add missing __builtin_bitreverse8
Also add documentation for bitreverse builtins

llvm-svn: 264203
2016-03-23 22:14:43 +00:00
Alexander Kornienko 976921d4b4 [ASTMatchers] New matcher hasReturnValue added
Summary: A checker (will be uploaded after this patch) needs to check implicit casts. Existing generic matcher "has" ignores implicit casts and parenthesized expressions and no specific matcher for matching return value expression preexisted. The patch adds such a matcher (hasReturnValue).

Reviewers: klimek, sbenza

Subscribers: xazax.hun, klimek, cfe-commits

Patch by Ádám Balogh!

Differential Revision: http://reviews.llvm.org/D17986

llvm-svn: 264037
2016-03-22 11:03:03 +00:00
Daniel Jasper 9c8ff3551a clang-format: Make include sorting's main include detection configurable.
This patch adds a regular expression to configure suffixes of an
included file to check whether it is the "main" include of the current
file. Previously, clang-format has allowed arbitrary suffixes on the
formatted file, which is still the case when no IncludeMainRegex is
specified.

llvm-svn: 263943
2016-03-21 14:11:27 +00:00
John Brawn 6c78974b29 Make it possible for AST plugins to enable themselves by default
Currently when an AST plugin is loaded it must then be enabled by passing
-plugin pluginname or -add-plugin pluginname to the -cc1 command line. This
patch adds a method to PluginASTAction which allows it to declare that the
action happens before, instead of, or after the main AST action, plus the
relevant changes to make the plugin action happen at that time automatically.

Differential Revision: http://reviews.llvm.org/D17959

llvm-svn: 263546
2016-03-15 12:51:40 +00:00
Dmitry Polukhin 5af55b663c NFC fix documentation build by rL263015
This time I hope it will fix the build for real.

llvm-svn: 263052
2016-03-09 19:39:16 +00:00
Hans Wennborg b2ed61a611 ReleaseNotes: update 'you may prefer' link to 3.8
llvm-svn: 263031
2016-03-09 17:26:46 +00:00