Commit Graph

60181 Commits

Author SHA1 Message Date
Adrian Prantl
b20f1d0a3c Fix a typo.
llvm-svn: 247895
2015-09-17 15:58:54 +00:00
Asaf Badouh
2718051dd7 re-apply r.247881
fixed the tests.

llvm-svn: 247892
2015-09-17 14:53:37 +00:00
Aaron Ballman
cdc43afa20 Update the 3.8 release notes with the breaking change information regarding AST matchers.
llvm-svn: 247887
2015-09-17 13:47:22 +00:00
Aaron Ballman
512fb64765 Rename AST node matchers to match the AST node names directly. Part of this rename also splits recordDecl() (which used to match CXXRecordDecl) into recordDecl() (that matches RecordDecl) and cxxRecordDecl (that matches CXXRecordDecl). Also adds isStruct(), isUnion(), and isClass() narrowing matchers for RecordDecl objects.
llvm-svn: 247885
2015-09-17 13:30:52 +00:00
Asaf Badouh
8a61250709 revert r.247881 due to tests failures
llvm-svn: 247883
2015-09-17 13:09:33 +00:00
NAKAMURA Takumi
007f75dab7 Appease clang/test/CodeGen/avx512dq-builtins.c for -Asserts, for now.
llvm-svn: 247882
2015-09-17 12:33:34 +00:00
Asaf Badouh
a0e5e71ef1 [X86][AVX512DQ] add new intrinsics
convert i64 to FP and vice versa
reduceps & reducepd
rangeps & rangepd
all in their 512bit versions


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

llvm-svn: 247881
2015-09-17 11:56:04 +00:00
Naomi Musgrave
bf8f00586a Updating docs for MSan to describe poison-in-dtor.
Summary:
Describe the compile and runtime flags to enable MemorySanitizer
detection of use-after-destroy.

Reviewers: eugenis

Subscribers: llvm-commits

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

Revise doc description of use-after-dtor.

Change wording to specify memory no longer readable.

llvm-svn: 247871
2015-09-17 00:10:59 +00:00
NAKAMURA Takumi
d1aa0681d7 analyzer-plugin/MainCallChecker.cpp: s/generateSink/generateErrorNode/, corresponding to r247859.
llvm-svn: 247862
2015-09-16 22:57:23 +00:00
Gabor Horvath
3ef9ef2227 [Static Analyzer] Generics Checker: When an ObjC method returns a specialized object, track it properly.
Differential Revision: http://reviews.llvm.org/D12889

llvm-svn: 247861
2015-09-16 22:44:36 +00:00
Devin Coughlin
e39bd407ba [analyzer] Add generateErrorNode() APIs to CheckerContext.
The analyzer trims unnecessary nodes from the exploded graph before reporting
path diagnostics. However, in some cases it can trim all nodes (including the
error node), leading to an assertion failure (see
https://llvm.org/bugs/show_bug.cgi?id=24184).

This commit addresses the issue by adding two new APIs to CheckerContext to
explicitly create error nodes. Unless the client provides a custom tag, these
APIs tag the node with the checker's tag -- preventing it from being trimmed.
The generateErrorNode() method creates a sink error node, while
generateNonFatalErrorNode() creates an error node for a path that should
continue being explored.

The intent is that one of these two methods should be used whenever a checker
creates an error node.

This commit updates the checkers to use these APIs. These APIs
(unlike addTransition() and generateSink()) do not take an explicit Pred node.
This is because there are not any error nodes in the checkers that were created
with an explicit different than the default (the CheckerContext's Pred node).

It also changes generateSink() to require state and pred nodes (previously
these were optional) to reduce confusion.

Additionally, there were several cases where checkers did check whether a
generated node could be null; we now explicitly check for null in these places.

This commit also includes a test case written by Ying Yi as part of
http://reviews.llvm.org/D12163 (that patch originally addressed this issue but
was reverted because it introduced false positive regressions).

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

llvm-svn: 247859
2015-09-16 22:03:05 +00:00
Reid Kleckner
8be1847b09 [WinEH] Fix a build issue in CGException.cpp
I was constructing an object without filling in all the fields.

llvm-svn: 247851
2015-09-16 21:06:09 +00:00
Reid Kleckner
10aa77032d [WinEH] Pass the catch adjectives to catchpad directly
This avoids building a fake LLVM IR global variable just to ferry an i32
down into LLVM codegen. It also puts a nail in the coffin of using MS
ABI C++ EH with landingpads, since now we'll assert in the lpad code
when flags are present.

llvm-svn: 247843
2015-09-16 20:15:55 +00:00
Argyrios Kyrtzidis
6d0a767685 [tooling] Add unit tests for change in r247468.
llvm-svn: 247832
2015-09-16 18:28:42 +00:00
Anton Yartsev
c647a6df72 [analyzer] Improved behavior if Clang was not found, part II
- scan-build help: display 'Could not query Clang for the list of available checkers.' + the reason why it happened so if clang was not found.
- display requested/forced help in case of --use-analyzer=Xcode.

llvm-svn: 247828
2015-09-16 18:12:15 +00:00
Adhemerval Zanella
567b9260fa [sanitizers] Enable memory sanitizer on clang
This patch enables MSan for aarch64/linux

llvm-svn: 247808
2015-09-16 15:11:21 +00:00
NAKAMURA Takumi
ee82b497f8 CGClass.cpp: Fix a warning in -Asserts. [-Wunused-private-field]
llvm-svn: 247778
2015-09-16 06:26:56 +00:00
Devin Coughlin
f3695c87cd [analyzer] SATestBuild.py: Move additional checkers logic so SATestAdd.py can use it as well.
Move the logic looking for additional checkers in the SA_ADDITIONAL_CHECKERS
environmental variable from SATestBuild's main() to runScanBuild(). This allows
SATestAdd.py to use the variable as well. Without it, we won't include
additional checkers when building reference results for the build bot.

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

llvm-svn: 247767
2015-09-16 01:52:32 +00:00
Richard Smith
938d701fad [modules] Fix a corner case in the macro override rules: properly handle overridden leaf module macros.
llvm-svn: 247765
2015-09-16 00:55:50 +00:00
Naomi Musgrave
703835c7f3 Implementation and testing for poisoning vtable
ptr in dtor.

Summary:
After destruction, invocation of virtual functions prevented
by poisoning vtable pointer.

Reviewers: eugenis, kcc

Subscribers: cfe-commits

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

Fixed testing callback emission order to account for vptr.
Poison vtable in either complete or base dtor, depending on
if virtual bases exist. If virtual bases exist, poison in
complete dtor. Otherwise, poison in base.
Remove commented-out block.

llvm-svn: 247762
2015-09-16 00:38:22 +00:00
NAKAMURA Takumi
c9ca73336d clang/test/CodeGenCXX/exceptions-cxx-new.cpp: Don't assume the label "entry:".
Seems it would be redundant.

llvm-svn: 247761
2015-09-16 00:33:59 +00:00
Nico Weber
8d8fc3f1ca Remove accidental superfluous newline added in r247750.
llvm-svn: 247752
2015-09-15 23:51:08 +00:00
Nico Weber
4f11349028 clang-format: In Java, assert is followed by an expression.
Before: assert a&& b;
Now:    assert a && b;
llvm-svn: 247750
2015-09-15 23:48:17 +00:00
David Majnemer
778ac14dfb Try to appease the build bots
llvm-svn: 247743
2015-09-15 23:34:59 +00:00
David Majnemer
834c5128d8 [MS ABI] Add a C++ test for -fnew-ms-eh
llvm-svn: 247742
2015-09-15 23:30:42 +00:00
Nico Weber
9677562c8f Don't crash when passing &@selector to a _Nonnull parameter. Fixes PR24774.
The root cause here is that ObjCSelectorExpr is an rvalue, yet it can have its
address taken.  That's kind of awkward, but fixing this is awkward in other
ways, see https://llvm.org/bugs/show_bug.cgi?id=24774#c16 .  For now, just
fix the crash.

llvm-svn: 247740
2015-09-15 23:17:17 +00:00
Gabor Horvath
6864cbced6 [Static Analyzer] Added an XFAIL test for inlining when the type inference involves generic types.
llvm-svn: 247739
2015-09-15 23:14:01 +00:00
Piotr Padlewski
08bd7bf00c invariant.group-for-vptrs test fix
llvm-svn: 247733
2015-09-15 23:04:47 +00:00
Chris Bieneman
ea7ecde87c [CMake] Add cache scripts for Apple-style clang builds.
Summary:
These CMake cache scripts are my first pass at replicating Apple's packaging logic from autoconf. They can be used on any Darwin machine to approximate an Apple Clang build.

The included README file includes documentation and a sample CMake invocation.

Reviewers: chandlerc, echristo

Subscribers: echristo, cfe-commits

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

llvm-svn: 247726
2015-09-15 21:52:42 +00:00
Piotr Padlewski
4b1ac72cd4 Decorating vptr load & stores with !invariant.group
Adding !invariant.group to vptr load/stores for devirtualization purposes.
For more goto:
http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html

http://reviews.llvm.org/D12026

llvm-svn: 247725
2015-09-15 21:46:55 +00:00
Piotr Padlewski
9d0ecf27a7 Added llvm.module flag for strict vtable pointers
It is dangerous to do LTO on code with strict-vtable-pointers, because
one module has invariant.group.barriers, and the other one not.

In the future I want to just strip all invariant.group metadata from
vptrs loads/stores and get rid of invariant.group.barrier calls.

http://reviews.llvm.org/D12580

llvm-svn: 247724
2015-09-15 21:46:50 +00:00
Piotr Padlewski
338c9d0ade Emiting llvm.invariant.group.barrier when dynamic type changes
For more goto:
http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html

http://reviews.llvm.org/D12312

llvm-svn: 247723
2015-09-15 21:46:47 +00:00
Hans Wennborg
5869ec4c6c MS ABI: Don't allow dllexport/import on lambdas
This is to follow up on David's comment in
http://reviews.llvm.org/D12422#235509

llvm-svn: 247718
2015-09-15 21:05:30 +00:00
Nico Weber
3df1840cfc Add test coverage for @encode(SEL); completely untested until now.
llvm-svn: 247717
2015-09-15 20:05:20 +00:00
Kelvin Li
4eea8c6b82 Allow static local variables specified on data-sharing attribute clauses.
http://reviews.llvm.org/D11619

llvm-svn: 247715
2015-09-15 18:56:58 +00:00
Richard Smith
ec4ad5ac9b [modules] Make sure we make hidden UsingShadowDecls visible to redeclaration
lookup for the UsingShadowDecls themselves.

llvm-svn: 247714
2015-09-15 18:51:56 +00:00
Nico Weber
cfb6f45168 Rebase tests after LLVM r247707.
llvm-svn: 247712
2015-09-15 18:49:51 +00:00
Alexey Bataev
ecb156aba2 [OPENMP] Emit an additional note during analysis of 'if' clause.
Patch adds emission of additional note for 'if' clauses with name modifiers in case if 'if' clause without name modified was specified or 'if' clause with the same name modifier was specified.

llvm-svn: 247706
2015-09-15 17:23:56 +00:00
Daniel Sanders
50f17235dd Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.
Eric has replied and has demanded the patch be reverted.

llvm-svn: 247702
2015-09-15 16:17:27 +00:00
Yury Gribov
daace1bb6b Mention that libcxx is required to build Compiler-RT tests on OS X.
llvm-svn: 247696
2015-09-15 15:05:47 +00:00
Aaron Ballman
02c6abc5dc Silencing a -Wreturn-type warning; NFC.
llvm-svn: 247693
2015-09-15 14:11:32 +00:00
Daniel Sanders
153010c52d Re-commit r247683: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.
Summary:
This is the first patch in the series to migrate Triple's (which are ambiguous)
to TargetTuple's (which aren't).

For the moment, TargetTuple simply passes all requests to the Triple object it
holds. Once it has replaced Triple, it will start to implement the interface in
a more suitable way.

This change makes some changes to the public C++ API. In particular,
InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer()
now take TargetTuples instead of Triples. The other public C++ API's have
been left as-is for the moment to reduce patch size.

This commit also contains a trivial patch to clang to account for the C++ API
change. Thanks go to Pavel Labath for fixing LLDB for me.

Reviewers: rengolin

Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin

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

llvm-svn: 247692
2015-09-15 14:08:28 +00:00
Daniel Sanders
c40de48041 Revert r247684 - Replace Triple with a new TargetTuple ...
LLDB needs to be updated in the same commit.

llvm-svn: 247686
2015-09-15 13:46:21 +00:00
Daniel Sanders
18d4b0dab7 Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.
Summary:
This is the first patch in the series to migrate Triple's (which are ambiguous)
to TargetTuple's (which aren't).

For the moment, TargetTuple simply passes all requests to the Triple object it
holds. Once it has replaced Triple, it will start to implement the interface in
a more suitable way.

This change makes some changes to the public C++ API. In particular,
InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer()
now take TargetTuples instead of Triples. The other public C++ API's have
been left as-is for the moment to reduce patch size.

This commit also contains a trivial patch to clang to account for the C++ API
change.

Reviewers: rengolin

Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin

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

llvm-svn: 247683
2015-09-15 13:17:40 +00:00
Alexey Bataev
25e5b44654 [OPENMP] Emit __kmpc_cancel_barrier() and code for 'cancellation point' only if 'cancel' is found.
Patch improves codegen for OpenMP constructs. If the OpenMP region does not have internal 'cancel' construct, a call to 'void __kmpc_barrier()' runtime function is generated for all implicit/explicit barriers. If the region has inner 'cancel' directive, then
```
if (__kmpc_cancel_barrier())
  exit from outer construct;
```
code is generated.
Also, the code for 'canellation point' directive is not generated if parent directive does not have 'cancel' directive.

llvm-svn: 247681
2015-09-15 12:52:43 +00:00
Alexey Bader
bdf7c846f9 Run clang-format to unify the switch statement style as suggest here: http://reviews.llvm.org/D12855#246073.
NFC.

llvm-svn: 247678
2015-09-15 12:18:29 +00:00
Alexey Bader
9c8453fb4b [OpenCL] Add new types for OpenCL 2.0.
Patch by Pedro Ferreira.
Reviewers: pekka.jaaskelainen
Differential Revision: http://reviews.llvm.org/D12855

llvm-svn: 247676
2015-09-15 11:18:52 +00:00
Ismail Donmez
a8d3a2e9a1 Doxygen fix InitializeBuiltins -> initializeBuiltins
llvm-svn: 247668
2015-09-15 09:53:14 +00:00
NAKAMURA Takumi
f9c52dc3e7 Make clang/test/CodeGen/catch-undef-behavior.c* capable of -Asserts with "opt -instnamer".
It reverts r231717.

llvm-svn: 247667
2015-09-15 09:50:24 +00:00
Devin Coughlin
676a58c9b2 [analyzer] Restore behavior change introduced by r247657.
r247657 fixed warnings about unused variables when compiling without asserts
but changed behavior. This commit restores the old behavior but still suppresses
the warnings.

llvm-svn: 247660
2015-09-15 03:28:27 +00:00