]> granicus.if.org Git - clang/log
clang
9 years ago[analyzer] Add generateErrorNode() APIs to CheckerContext.
Devin Coughlin [Wed, 16 Sep 2015 22:03:05 +0000 (22:03 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247859 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[WinEH] Fix a build issue in CGException.cpp
Reid Kleckner [Wed, 16 Sep 2015 21:06:09 +0000 (21:06 +0000)]
[WinEH] Fix a build issue in CGException.cpp

I was constructing an object without filling in all the fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247851 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[WinEH] Pass the catch adjectives to catchpad directly
Reid Kleckner [Wed, 16 Sep 2015 20:15:55 +0000 (20:15 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247843 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[tooling] Add unit tests for change in r247468.
Argyrios Kyrtzidis [Wed, 16 Sep 2015 18:28:42 +0000 (18:28 +0000)]
[tooling] Add unit tests for change in r247468.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247832 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Improved behavior if Clang was not found, part II
Anton Yartsev [Wed, 16 Sep 2015 18:12:15 +0000 (18:12 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247828 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[sanitizers] Enable memory sanitizer on clang
Adhemerval Zanella [Wed, 16 Sep 2015 15:11:21 +0000 (15:11 +0000)]
[sanitizers] Enable memory sanitizer on clang

This patch enables MSan for aarch64/linux

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247808 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCGClass.cpp: Fix a warning in -Asserts. [-Wunused-private-field]
NAKAMURA Takumi [Wed, 16 Sep 2015 06:26:56 +0000 (06:26 +0000)]
CGClass.cpp: Fix a warning in -Asserts. [-Wunused-private-field]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247778 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] SATestBuild.py: Move additional checkers logic so SATestAdd.py can use...
Devin Coughlin [Wed, 16 Sep 2015 01:52:32 +0000 (01:52 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247767 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] Fix a corner case in the macro override rules: properly handle overridden...
Richard Smith [Wed, 16 Sep 2015 00:55:50 +0000 (00:55 +0000)]
[modules] Fix a corner case in the macro override rules: properly handle overridden leaf module macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247765 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoImplementation and testing for poisoning vtable
Naomi Musgrave [Wed, 16 Sep 2015 00:38:22 +0000 (00:38 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247762 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang/test/CodeGenCXX/exceptions-cxx-new.cpp: Don't assume the label "entry:".
NAKAMURA Takumi [Wed, 16 Sep 2015 00:33:59 +0000 (00:33 +0000)]
clang/test/CodeGenCXX/exceptions-cxx-new.cpp: Don't assume the label "entry:".

Seems it would be redundant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247761 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove accidental superfluous newline added in r247750.
Nico Weber [Tue, 15 Sep 2015 23:51:08 +0000 (23:51 +0000)]
Remove accidental superfluous newline added in r247750.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247752 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: In Java, `assert` is followed by an expression.
Nico Weber [Tue, 15 Sep 2015 23:48:17 +0000 (23:48 +0000)]
clang-format: In Java, `assert` is followed by an expression.

Before: assert a&& b;
Now:    assert a && b;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247750 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTry to appease the build bots
David Majnemer [Tue, 15 Sep 2015 23:34:59 +0000 (23:34 +0000)]
Try to appease the build bots

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247743 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MS ABI] Add a C++ test for -fnew-ms-eh
David Majnemer [Tue, 15 Sep 2015 23:30:42 +0000 (23:30 +0000)]
[MS ABI] Add a C++ test for -fnew-ms-eh

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247742 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't crash when passing &@selector to a _Nonnull parameter. Fixes PR24774.
Nico Weber [Tue, 15 Sep 2015 23:17:17 +0000 (23:17 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247740 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Static Analyzer] Added an XFAIL test for inlining when the type inference involves...
Gabor Horvath [Tue, 15 Sep 2015 23:14:01 +0000 (23:14 +0000)]
[Static Analyzer] Added an XFAIL test for inlining when the type inference involves generic types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247739 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoinvariant.group-for-vptrs test fix
Piotr Padlewski [Tue, 15 Sep 2015 23:04:47 +0000 (23:04 +0000)]
invariant.group-for-vptrs test fix

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247733 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] Add cache scripts for Apple-style clang builds.
Chris Bieneman [Tue, 15 Sep 2015 21:52:42 +0000 (21:52 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247726 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDecorating vptr load & stores with !invariant.group
Piotr Padlewski [Tue, 15 Sep 2015 21:46:55 +0000 (21:46 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247725 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdded llvm.module flag for strict vtable pointers
Piotr Padlewski [Tue, 15 Sep 2015 21:46:50 +0000 (21:46 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247724 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEmiting llvm.invariant.group.barrier when dynamic type changes
Piotr Padlewski [Tue, 15 Sep 2015 21:46:47 +0000 (21:46 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247723 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMS ABI: Don't allow dllexport/import on lambdas
Hans Wennborg [Tue, 15 Sep 2015 21:05:30 +0000 (21:05 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247718 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd test coverage for @encode(SEL); completely untested until now.
Nico Weber [Tue, 15 Sep 2015 20:05:20 +0000 (20:05 +0000)]
Add test coverage for @encode(SEL); completely untested until now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247717 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAllow static local variables specified on data-sharing attribute clauses.
Kelvin Li [Tue, 15 Sep 2015 18:56:58 +0000 (18:56 +0000)]
Allow static local variables specified on data-sharing attribute clauses.

http://reviews.llvm.org/D11619

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247715 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] Make sure we make hidden UsingShadowDecls visible to redeclaration
Richard Smith [Tue, 15 Sep 2015 18:51:56 +0000 (18:51 +0000)]
[modules] Make sure we make hidden UsingShadowDecls visible to redeclaration
lookup for the UsingShadowDecls themselves.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247714 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRebase tests after LLVM r247707.
Nico Weber [Tue, 15 Sep 2015 18:49:51 +0000 (18:49 +0000)]
Rebase tests after LLVM r247707.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247712 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Emit an additional note during analysis of 'if' clause.
Alexey Bataev [Tue, 15 Sep 2015 17:23:56 +0000 (17:23 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247706 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and related...
Daniel Sanders [Tue, 15 Sep 2015 16:17:27 +0000 (16:17 +0000)]
Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.

Eric has replied and has demanded the patch be reverted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247702 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMention that libcxx is required to build Compiler-RT tests on OS X.
Yury Gribov [Tue, 15 Sep 2015 15:05:47 +0000 (15:05 +0000)]
Mention that libcxx is required to build Compiler-RT tests on OS X.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247696 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSilencing a -Wreturn-type warning; NFC.
Aaron Ballman [Tue, 15 Sep 2015 14:11:32 +0000 (14:11 +0000)]
Silencing a -Wreturn-type warning; NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247693 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRe-commit r247683: Replace Triple with a new TargetTuple in MCTargetDesc/* and relate...
Daniel Sanders [Tue, 15 Sep 2015 14:08:28 +0000 (14:08 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247692 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r247684 - Replace Triple with a new TargetTuple ...
Daniel Sanders [Tue, 15 Sep 2015 13:46:21 +0000 (13:46 +0000)]
Revert r247684 - Replace Triple with a new TargetTuple ...

LLDB needs to be updated in the same commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247686 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReplace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.
Daniel Sanders [Tue, 15 Sep 2015 13:17:40 +0000 (13:17 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247683 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Emit __kmpc_cancel_barrier() and code for 'cancellation point' only if ...
Alexey Bataev [Tue, 15 Sep 2015 12:52:43 +0000 (12:52 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247681 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRun clang-format to unify the switch statement style as suggest here: http://reviews...
Alexey Bader [Tue, 15 Sep 2015 12:18:29 +0000 (12:18 +0000)]
Run clang-format to unify the switch statement style as suggest here: http://reviews.llvm.org/D12855#246073.

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247678 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OpenCL] Add new types for OpenCL 2.0.
Alexey Bader [Tue, 15 Sep 2015 11:18:52 +0000 (11:18 +0000)]
[OpenCL] Add new types for OpenCL 2.0.

Patch by Pedro Ferreira.
Reviewers: pekka.jaaskelainen
Differential Revision: http://reviews.llvm.org/D12855

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247676 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDoxygen fix InitializeBuiltins -> initializeBuiltins
Ismail Donmez [Tue, 15 Sep 2015 09:53:14 +0000 (09:53 +0000)]
Doxygen fix InitializeBuiltins -> initializeBuiltins

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247668 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake clang/test/CodeGen/catch-undef-behavior.c* capable of -Asserts with "opt -instna...
NAKAMURA Takumi [Tue, 15 Sep 2015 09:50:24 +0000 (09:50 +0000)]
Make clang/test/CodeGen/catch-undef-behavior.c* capable of -Asserts with "opt -instnamer".

It reverts r231717.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247667 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Restore behavior change introduced by r247657.
Devin Coughlin [Tue, 15 Sep 2015 03:28:27 +0000 (03:28 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247660 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MS ABI] Restore our warning for overwide bitfields using the MS ABI
David Majnemer [Tue, 15 Sep 2015 02:36:41 +0000 (02:36 +0000)]
[MS ABI] Restore our warning for overwide bitfields using the MS ABI

This restores a diagnostic lost in r247651.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247659 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoExprEngineObjC.cpp: Fix warnings. [-Wunused-variable]
NAKAMURA Takumi [Tue, 15 Sep 2015 01:53:27 +0000 (01:53 +0000)]
ExprEngineObjC.cpp: Fix warnings. [-Wunused-variable]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247657 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoItaniumCXXABI.cpp: Fix a warning. [-Wunused-variable]
NAKAMURA Takumi [Tue, 15 Sep 2015 01:39:27 +0000 (01:39 +0000)]
ItaniumCXXABI.cpp: Fix a warning. [-Wunused-variable]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247655 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] A using-declaration doesn't introduce a new entity, just a new name
Richard Smith [Tue, 15 Sep 2015 01:28:55 +0000 (01:28 +0000)]
[modules] A using-declaration doesn't introduce a new entity, just a new name
for an existing entity, and as such a using-declaration doesn't need to
conflict with a hidden entity (nor vice versa).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247654 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Skip Pre/Post handlers for ObjC calls when receiver is nil.
Devin Coughlin [Tue, 15 Sep 2015 01:13:53 +0000 (01:13 +0000)]
[analyzer] Skip Pre/Post handlers for ObjC calls when receiver is nil.

In Objective-C, method calls with nil receivers are essentially no-ops. They
do not fault (although the returned value may be garbage depending on the
declared return type and architecture). Programmers are aware of this
behavior and will complain about a false alarm when the analyzer
diagnoses API violations for method calls when the receiver is known to
be nil.

Rather than require each individual checker to be aware of this behavior
and suppress a warning when the receiver is nil, this commit
changes ExprEngineObjC so that VisitObjCMessage skips calling checker
pre/post handlers when the receiver is definitely nil. Instead, it adds a
new event, ObjCMessageNil, that is only called in that case.

The CallAndMessageChecker explicitly cares about this case, so I've changed it
to add a callback for ObjCMessageNil and moved the logic in PreObjCMessage
that handles nil receivers to the new callback.

rdar://problem/18092611

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247653 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MS ABI] Overwide bool bitfields should be permitted
David Majnemer [Tue, 15 Sep 2015 01:00:55 +0000 (01:00 +0000)]
[MS ABI] Overwide bool bitfields should be permitted

Overwide bool bitfields have eight bits of storage size, make sure we
take the padding into account when determining whether or not they are
problematic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247651 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agosmall test bugfix
Piotr Padlewski [Tue, 15 Sep 2015 00:55:29 +0000 (00:55 +0000)]
small test bugfix

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247650 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoGenerating assumption loads of vptr after ctor call (fixed)
Piotr Padlewski [Tue, 15 Sep 2015 00:37:06 +0000 (00:37 +0000)]
Generating assumption loads of vptr after ctor call (fixed)

Generating call assume(icmp %vtable, %global_vtable) after constructor
call for devirtualization purposes.

For more info go to:
http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html

Edit:
Fixed version because of PR24479 and other bug caused in chrome.
After this patch got reverted because of ScalarEvolution bug (D12719)
Merged after John McCall big patch (Added Address).

http://reviews.llvm.org/D11859
http://reviews.llvm.org/D12865

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247646 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPrevent implicit re-interpret casts between ExtVector and Scalar types.
Stephen Canon [Tue, 15 Sep 2015 00:21:56 +0000 (00:21 +0000)]
Prevent implicit re-interpret casts between ExtVector and Scalar types.

Previously, in certain cases lax vector conversions could occur between scalar floating-point values and ExtVector types; these conversions would be simple bitcasts.  We need to allow them with other vector types to support some common headers, but we don't need them for ExtVector.  Preventing them here makes them behave like other operations involving scalars and ExtVectors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247643 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang/test/CodeGenCXX/2009-04-23-bool2.cpp: Avoid -mms-bitfields to add explicit...
NAKAMURA Takumi [Mon, 14 Sep 2015 23:50:08 +0000 (23:50 +0000)]
clang/test/CodeGenCXX/2009-04-23-bool2.cpp: Avoid -mms-bitfields to add explicit triple.

FIXME: Better way to cancel -mms-bitfields?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247640 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Solaris] Default to -fno-cxa-finalize.
Rafael Espindola [Mon, 14 Sep 2015 23:21:31 +0000 (23:21 +0000)]
[Solaris] Default to -fno-cxa-finalize.

There is no __cxa_finalize symbol available on recent Solaris OS
versions, so we need this flag to make non trivial C++ programs run.

Also stop looking for cxa_finalize.o, since it won't be there.

Patch by Xan López!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247634 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[WebAssembly] Define the atomic type sizes
Dan Gohman [Mon, 14 Sep 2015 21:56:37 +0000 (21:56 +0000)]
[WebAssembly] Define the atomic type sizes

WebAssembly's spec has now been updated to specify some guarantees
about lock free atomic accesses. Update clang to match.

This also updates sig_atomic_t to be 64-bit on wasm64. WebAssembly
does not presently have asynchronous interrupts, but this change is
within the spirit of how they will work if they are added.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247624 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[WebAssembly] Simplify code by avoiding duplicating the default behavior.
Dan Gohman [Mon, 14 Sep 2015 21:54:32 +0000 (21:54 +0000)]
[WebAssembly] Simplify code by avoiding duplicating the default behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247623 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[WebAssembly] Use "long long" for int_fast64_t and int_least64_t on wasm64
Dan Gohman [Mon, 14 Sep 2015 21:49:41 +0000 (21:49 +0000)]
[WebAssembly] Use "long long" for int_fast64_t and int_least64_t on wasm64

This makes int_fast64_t and int_least64_t the same type as int64_t, and
eliminates a difference between wasm32 and wasm64.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247622 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Always_inline codegen rewrite" and 2 follow-ups.
Evgeniy Stepanov [Mon, 14 Sep 2015 21:35:16 +0000 (21:35 +0000)]
Revert "Always_inline codegen rewrite" and 2 follow-ups.

Revert "Update cxx-irgen.cpp test to allow signext in alwaysinline functions."
Revert "[CodeGen] Remove wrapper-free always_inline functions from COMDATs"
Revert "Always_inline codegen rewrite."

Reason for revert: PR24793.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247620 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPR24595: Ignore calling convention modifiers for structors in MS ABI.
Andrey Bokhanko [Mon, 14 Sep 2015 21:29:57 +0000 (21:29 +0000)]
PR24595: Ignore calling convention modifiers for structors in MS ABI.

MS compiler ignores calling convention modifiers for structors. This patch makes
clang do the same (for MS ABI). This fixes PR24595 and makes vswriter.h header
(from Windows SDK 8.1) compilable.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247619 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoC11 _Bool bitfield diagnostic
Rachel Craik [Mon, 14 Sep 2015 21:27:36 +0000 (21:27 +0000)]
C11 _Bool bitfield diagnostic

Summary: Implement DR262 (for C). This patch will mainly affect bitfields of type _Bool

Reviewers: fraggamuffin, rsmith

Subscribers: hubert.reinterpretcast, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247618 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Update SATestBuild.py to set -isysroot for preprocessed files
Devin Coughlin [Mon, 14 Sep 2015 21:22:24 +0000 (21:22 +0000)]
[analyzer] Update SATestBuild.py to set -isysroot for preprocessed files

Update the static analyzer buildbot script to set -isysroot to the OS X SDK path
when analyzing preprocessed files on OS X.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247617 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Static Analyzer] Turn on some nullability checks by default.
Gabor Horvath [Mon, 14 Sep 2015 20:34:06 +0000 (20:34 +0000)]
[Static Analyzer] Turn on some nullability checks by default.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247614 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Static Analyzer] Nullability checker optimization.
Gabor Horvath [Mon, 14 Sep 2015 20:31:46 +0000 (20:31 +0000)]
[Static Analyzer] Nullability checker optimization.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247612 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver should forward at most one gdwarf-N flag to cc1as.
Douglas Katzman [Mon, 14 Sep 2015 20:31:28 +0000 (20:31 +0000)]
Driver should forward at most one gdwarf-N flag to cc1as.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247611 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Solaris] Add -lc also when linking shared libraries
Rafael Espindola [Mon, 14 Sep 2015 19:30:53 +0000 (19:30 +0000)]
[Solaris] Add -lc also when linking shared libraries

This is actually needed, otherwise libc won't be added at all. For
instance when building libclang.so all the libc symbols won't be
found, with ld warning about libc being an "implicit dependency".

Patch by Xan López!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247603 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Static Analyzer] Relaxing a caching out related assert.
Gabor Horvath [Mon, 14 Sep 2015 19:00:08 +0000 (19:00 +0000)]
[Static Analyzer] Relaxing a caching out related assert.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247598 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix a nasty bug with the partial destruction of nested arrays;
John McCall [Mon, 14 Sep 2015 18:57:08 +0000 (18:57 +0000)]
Fix a nasty bug with the partial destruction of nested arrays;
it escaped notice because it's only used for heterogeneous
initialization.

rdar://21397946

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247597 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Static Analyzer] Moving nullability checkers out of alpha.
Gabor Horvath [Mon, 14 Sep 2015 18:48:55 +0000 (18:48 +0000)]
[Static Analyzer] Moving nullability checkers out of alpha.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247595 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] Fix a few uses of PointerType::getElementType in favor of uses...
David Blaikie [Mon, 14 Sep 2015 18:38:22 +0000 (18:38 +0000)]
[opaque pointer type] Fix a few uses of PointerType::getElementType in favor of uses of types already available elsewhere

These are a few cleanups I happened to have from trying to go in a
different direction recently, so just flushing them out while I have
them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247593 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Static Analyzer] Moving nullability checkers to a top level package.
Gabor Horvath [Mon, 14 Sep 2015 18:31:34 +0000 (18:31 +0000)]
[Static Analyzer] Moving nullability checkers to a top level package.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247590 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "[opaque pointer type] update for LLVM API change"
David Blaikie [Mon, 14 Sep 2015 18:02:04 +0000 (18:02 +0000)]
Revert "[opaque pointer type] update for LLVM API change"

This was the wrong direction to take anyway (because ultimately the
GlobalValue needed the pointee type again and /it/ used
PointerType::getElementType eventually anyway)... let's go a different way.

This reverts commit r236161.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247586 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate cxx-irgen.cpp test to allow signext in alwaysinline functions.
Samuel Antao [Mon, 14 Sep 2015 17:41:32 +0000 (17:41 +0000)]
Update cxx-irgen.cpp test to allow signext in alwaysinline functions.

This was causing an error in Power8 targets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247584 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTest commit
Rachel Craik [Mon, 14 Sep 2015 14:08:18 +0000 (14:08 +0000)]
Test commit

Remove some trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247560 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] r247548 introduced llvm-readobj.
NAKAMURA Takumi [Mon, 14 Sep 2015 12:42:52 +0000 (12:42 +0000)]
[CMake] r247548 introduced llvm-readobj.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247554 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] Reformat CLANG_TEST_DEPS.
NAKAMURA Takumi [Mon, 14 Sep 2015 12:41:53 +0000 (12:41 +0000)]
[CMake] Reformat CLANG_TEST_DEPS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247553 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Add test case to check ABI flag emissions in case of inline assembler
Simon Atanasyan [Mon, 14 Sep 2015 11:23:02 +0000 (11:23 +0000)]
[mips] Add test case to check ABI flag emissions in case of inline assembler

Follow up to r247546. The test case reproduces the problem fixed by this commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247548 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Reject value-initialization of function types
David Majnemer [Mon, 14 Sep 2015 07:05:00 +0000 (07:05 +0000)]
[Sema] Reject value-initialization of function types

T in the expression T() must be a non-array complete object type or
the void type.  Function types are neither.

This fixes PR24798.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247535 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Static Analyzer] Remove a redundant file.
Gabor Horvath [Sun, 13 Sep 2015 23:03:11 +0000 (23:03 +0000)]
[Static Analyzer] Remove a redundant file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247533 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Static Analyzer] Merge the Objective-C Generics Checker into Dynamic Type Propagatio...
Gabor Horvath [Sun, 13 Sep 2015 23:02:24 +0000 (23:02 +0000)]
[Static Analyzer] Merge the Objective-C Generics Checker into Dynamic Type Propagation checker.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247532 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[docs] NFC: Fix line formatting in INSTALL.txt
Vedant Kumar [Sun, 13 Sep 2015 20:17:18 +0000 (20:17 +0000)]
[docs] NFC: Fix line formatting in INSTALL.txt

Patch by beltex!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247530 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse -f instead of -d flag for testing existing of clang executable (http://reviews...
Ted Kremenek [Sat, 12 Sep 2015 16:01:34 +0000 (16:01 +0000)]
Use -f instead of -d flag for testing existing of clang executable (http://reviews.llvm.org/D12827).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247510 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTest commit.
Kelvin Li [Sat, 12 Sep 2015 13:35:31 +0000 (13:35 +0000)]
Test commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247503 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CodeGen] Remove wrapper-free always_inline functions from COMDATs
David Majnemer [Sat, 12 Sep 2015 06:37:42 +0000 (06:37 +0000)]
[CodeGen] Remove wrapper-free always_inline functions from COMDATs

always_inline functions without a wrapper don't need to be in a COMDAT.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247500 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoClean up trailing whitespace in the builtin headers
Sean Silva [Sat, 12 Sep 2015 02:55:19 +0000 (02:55 +0000)]
Clean up trailing whitespace in the builtin headers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247498 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang/test/Driver/stackrealign.c REQUIRES clang-driver.
NAKAMURA Takumi [Sat, 12 Sep 2015 01:29:35 +0000 (01:29 +0000)]
clang/test/Driver/stackrealign.c REQUIRES clang-driver.

GCC driver, for example cygwin, both "-mstackrealign" "-mno-stackrealign" are passed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247496 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAlways_inline codegen rewrite.
Evgeniy Stepanov [Sat, 12 Sep 2015 01:07:37 +0000 (01:07 +0000)]
Always_inline codegen rewrite.

Current implementation may end up emitting an undefined reference for
an "inline __attribute__((always_inline))" function by generating an
"available_externally alwaysinline" IR function for it and then failing to
inline all the calls. This happens when a call to such function is in dead
code. As the inliner is an SCC pass, it does not process dead code.

Libc++ relies on the compiler never emitting such undefined reference.

With this patch, we emit a pair of
1. internal alwaysinline definition (called F.alwaysinline)
2a. A stub F() { musttail call F.alwaysinline }
  -- or, depending on the linkage --
2b. A declaration of F.

The frontend ensures that F.inlinefunction is only used for direct
calls, and the stub is used for everything else (taking the address of
the function, really). Declaration (2b) is emitted in the case when
"inline" is meant for inlining only (like __gnu_inline__ and some
other cases).

This approach, among other nice properties, ensures that alwaysinline
functions are always internal, making it impossible for a direct call
to such function to produce an undefined symbol reference.

This patch is based on ideas by Chandler Carruth and Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247494 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Specify target triple in alwaysinline tests."
Evgeniy Stepanov [Fri, 11 Sep 2015 23:48:37 +0000 (23:48 +0000)]
Revert "Specify target triple in alwaysinline tests."
Revert "Always_inline codegen rewrite."

Breaks gdb & lldb tests.
Breaks on Fedora 22 x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247491 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd new test file missing from r247486.
Richard Smith [Fri, 11 Sep 2015 22:54:01 +0000 (22:54 +0000)]
Add new test file missing from r247486.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247488 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] When picking one of two template declarations as a lookup result,
Richard Smith [Fri, 11 Sep 2015 22:39:35 +0000 (22:39 +0000)]
[modules] When picking one of two template declarations as a lookup result,
it's not sufficient to prefer the declaration with more default arguments, or
the one that's visible; they might both be visible, but one of them might have
a visible default argument where the other has a hidden default argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247486 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWhen comparing two block captures for layout, don't crash
John McCall [Fri, 11 Sep 2015 22:00:51 +0000 (22:00 +0000)]
When comparing two block captures for layout, don't crash
if they have the same alignment and one was 'this'.

Fixes PR24780.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247482 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoLet selector-expr-lvalue.mm actually test something.
Nico Weber [Fri, 11 Sep 2015 21:24:40 +0000 (21:24 +0000)]
Let selector-expr-lvalue.mm actually test something.

I accidentally introduced a bug locally, and noticed that none of the tests
caught it. No longer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247477 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Static Analyzer] Properly cash the configuration option for lambda support.
Gabor Horvath [Fri, 11 Sep 2015 21:19:39 +0000 (21:19 +0000)]
[Static Analyzer] Properly cash the configuration option for lambda support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247476 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Shave]: pass -isystem dirs and "-Wa," args to moviAsm
Douglas Katzman [Fri, 11 Sep 2015 21:13:46 +0000 (21:13 +0000)]
[Shave]: pass -isystem dirs and "-Wa," args to moviAsm

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247474 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSpecify target triple in alwaysinline tests.
Evgeniy Stepanov [Fri, 11 Sep 2015 21:10:12 +0000 (21:10 +0000)]
Specify target triple in alwaysinline tests.

This should fix the tests on Windows (failing due to mangling differencies).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247473 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSimplify logic introduced in r247464.
David Majnemer [Fri, 11 Sep 2015 20:55:29 +0000 (20:55 +0000)]
Simplify logic introduced in r247464.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247472 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[tooling] In CompileCommand, Expose the 'file' that was associated with the command.
Argyrios Kyrtzidis [Fri, 11 Sep 2015 20:43:05 +0000 (20:43 +0000)]
[tooling] In CompileCommand, Expose the 'file' that was associated with the command.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247468 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] [Darwin] Add support for building bootstrap builds with -flto
Chris Bieneman [Fri, 11 Sep 2015 20:42:57 +0000 (20:42 +0000)]
[CMake] [Darwin] Add support for building bootstrap builds with -flto

When building with LTO the bootstrap builds need to depend on libLTO, llvm-ar, and llvm-ranlib, which all need to be passed into the bootstrap build. This functionality only works on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247467 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Improve behavior if Clang not found.
Anton Yartsev [Fri, 11 Sep 2015 20:41:09 +0000 (20:41 +0000)]
[analyzer] Improve behavior if Clang not found.

- Eliminate 'No such file or directory at scan-build line ...' error if '$RealBin/bin/clang' or '$RealBin/clang' directory does not exist.
- Eliminate 'Use of uninitialized value $Clang in concatenation (.) or string at scan-build line ...' error if help is displayed while $Clang was not found.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247466 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAlways_inline codegen rewrite.
Evgeniy Stepanov [Fri, 11 Sep 2015 20:29:07 +0000 (20:29 +0000)]
Always_inline codegen rewrite.

Current implementation may end up emitting an undefined reference for
an "inline __attribute__((always_inline))" function by generating an
"available_externally alwaysinline" IR function for it and then failing to
inline all the calls. This happens when a call to such function is in dead
code. As the inliner is an SCC pass, it does not process dead code.

Libc++ relies on the compiler never emitting such undefined reference.

With this patch, we emit a pair of
1. internal alwaysinline definition (called F.alwaysinline)
2a. A stub F() { musttail call F.alwaysinline }
  -- or, depending on the linkage --
2b. A declaration of F.

The frontend ensures that F.inlinefunction is only used for direct
calls, and the stub is used for everything else (taking the address of
the function, really). Declaration (2b) is emitted in the case when
"inline" is meant for inlining only (like __gnu_inline__ and some
other cases).

This approach, among other nice properties, ensures that alwaysinline
functions are always internal, making it impossible for a direct call
to such function to produce an undefined symbol reference.

This patch is based on ideas by Chandler Carruth and Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247465 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MS ABI] Select an inheritance model in template arguments
David Majnemer [Fri, 11 Sep 2015 20:18:09 +0000 (20:18 +0000)]
[MS ABI] Select an inheritance model in template arguments

We used to only select an inheritance model if the pointer to member was
nullptr.  Instead, select a model regardless of the member pointer's
value.

N.B.  This bug was exposed by making member pointers report true for
isIncompleteType but has been latent since the member pointer scheme's
inception.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247464 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Add -analyzer-config option for function size the inliner considers as...
Devin Coughlin [Fri, 11 Sep 2015 20:14:05 +0000 (20:14 +0000)]
[analyzer] Add -analyzer-config option for function size the inliner considers as large

Add an option (-analyzer-config min-blocks-for-inline-large=14) to control the function
size the inliner considers as large, in relation to "max-times-inline-large". The option
defaults to the original hard coded behaviour, which I believe should be adjustable with
the other inlining settings.

The analyzer-config test has been modified so that the analyzer will reach the
getMinBlocksForInlineLarge() method and store the result in the ConfigTable, to ensure it
is dumped by the debug checker.

A patch by Sean Eveson!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247463 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Edit] Fix issue with tracking what macro argument inputs have been edited.
Argyrios Kyrtzidis [Fri, 11 Sep 2015 20:09:11 +0000 (20:09 +0000)]
[Edit] Fix issue with tracking what macro argument inputs have been edited.

This was not working correctly, leading to erroneously rejecting valid edits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247462 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRecord function attribute "stackrealign" instead of using backend option
Akira Hatanaka [Fri, 11 Sep 2015 18:55:09 +0000 (18:55 +0000)]
Record function attribute "stackrealign" instead of using backend option
-force-align-stack.

Also, make changes to the driver so that -mno-stack-realign is no longer
an option exposed to the end-user that disallows stack realignment in
the backend.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247451 91177308-0d34-0410-b5e6-96231b3b80d8