Commit Graph

60932 Commits

Author SHA1 Message Date
Anna Zaks de14eb5b4e [static analyzer] Don't flag nil storage into NSMutableDictionary.
This is now allowed and has the behavior of removing the mapping.

llvm-svn: 252679
2015-11-11 00:49:22 +00:00
John McCall 28ea04fc4c Define __unsafe_unretained and __autoreleasing in ObjC GC mode.
This was an accidental regression from the MRC __weak patch.

llvm-svn: 252668
2015-11-10 23:00:25 +00:00
Jonathan Roelofs a3219a70be Fix build
llvm-svn: 252667
2015-11-10 22:59:18 +00:00
Jonathan Roelofs 1ff9c63204 Implement post-commit review feedback on r252662
llvm-svn: 252664
2015-11-10 22:48:11 +00:00
Jonathan Roelofs 467ab05291 Implement the fix that r252641 should have been
llvm-svn: 252662
2015-11-10 22:38:59 +00:00
Reid Kleckner 489cfe1401 [COFF] Don't try to emit weak aliases on COFF
This comes up when a derived class destructor is equivalent to a base
class destructor defined in the same TU, and we try to alias them.

A COFF weak alias cannot satisfy a normal undefined symbol reference
from another TU. The other TU must also mark the referenced symbol as
weak, and we can't rely on that.

Clang already has a special case here for dllexport, but we failed to
realize that the problem also applies to other non-discardable symbols
such as those from explicit template instantiations.

Fixes PR25477.

llvm-svn: 252659
2015-11-10 22:23:58 +00:00
Evgeniy Stepanov ae6ebd3af5 Implement __attribute__((internal_linkage)).
The attrubite is applicable to functions and variables and changes
the linkage of the subject to internal.

This is the same functionality as C-style "static", but applicable to
class methods; and the same as anonymouns namespaces, but can apply
to individual methods of a class.

Following the proposal in
http://lists.llvm.org/pipermail/cfe-dev/2015-October/045580.html

llvm-svn: 252648
2015-11-10 21:28:44 +00:00
Dan Gohman 6db4640b80 [WebAssembly] Change long double to be quadruple-precision floating point.
llvm-svn: 252646
2015-11-10 21:01:46 +00:00
Jonathan Roelofs 2a439a104b Fix missing CMake dependency introduced in r252474
llvm-svn: 252641
2015-11-10 20:01:22 +00:00
Joerg Sonnenberger 4ecfa623e5 Add the variant of __sparc_v9__ with five underscores, not just four.
llvm-svn: 252640
2015-11-10 19:28:17 +00:00
Aaron Ballman 4960df0db3 No longer creating the install-clang target for IDEs, as it was never meant for those.
llvm-svn: 252601
2015-11-10 12:51:25 +00:00
Sean Eveson 00e780e1cc [Analyzer] Fix comments and formatting. NFC.
llvm-svn: 252599
2015-11-10 11:48:55 +00:00
Craig Topper fd778eebac [X86] Use setzero instead of set1(0) in a few places in intrinsic headers.
llvm-svn: 252587
2015-11-10 05:08:08 +00:00
Craig Topper 7148166785 [X86] Remove temporary variables from macros in x86 intrinsic headers. Prevents duplicate names appearing from multiple macro expansions. NFC
llvm-svn: 252586
2015-11-10 05:08:05 +00:00
Craig Topper 166f8b20a3 [X86] Fix bad intrinsic header comment. NFC.
llvm-svn: 252585
2015-11-10 05:08:00 +00:00
Joerg Sonnenberger 5c1ac90715 Use the generic Sparc CPU handling for Linux, FreeBSD and OpenBSD, too.
This currently changes the default toward the more historic -Av8/-Av9,
but as discussed with James Y Knight, consistency is for now more
important than figuring out which default CPU each OS should be using.

llvm-svn: 252571
2015-11-10 00:40:29 +00:00
Joerg Sonnenberger 9d3e4f6651 Use the normal switch over getArch() approach and not a long if chain.
llvm-svn: 252562
2015-11-10 00:23:12 +00:00
Vedant Kumar 0affb93894 [Driver] Use platform-appropriate profiling libraries for WatchOS, TVOS
When adding profiling instrumentation, use libclang_rt.profile_tvos.a
for TVOS targets and libclang_rt.profile_watchos.a for WatchOS targets.

I've also fixed up a comment and added an assert() that prevents us from
defaulting to an incorrect platform.

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

Reviewed-by: t.p.northover
llvm-svn: 252558
2015-11-10 00:20:34 +00:00
Joerg Sonnenberger ec353d3fc6 Reorganise CPU handling for Sparc. When using -mcpu=v9 and co, __sparcv8
is not defined for 32bit mode, but __sparcv9 is. Pass down the correct
-target-cpu flags to the backend, so that instruction restrictions are
applied correctly. Pass down the correct -A flag when not using IAS.
The latter is limited to NetBSD targets in this commit.

llvm-svn: 252545
2015-11-09 23:39:45 +00:00
Chris Bieneman 4e3b36947b [CMake] Support passing CMAKE_VERBOSE_MAKEFILE through to bootstrap builds.
This option enables full verbosity in recursive CMake builds.

llvm-svn: 252523
2015-11-09 22:43:10 +00:00
Evgeniy Stepanov 65bc2b1223 Extend linux header search to find libc++ headers in c++/vN for any N.
llvm-svn: 252514
2015-11-09 21:10:54 +00:00
Tim Northover cc2a6e0608 Atomics: support __c11_* calls on _Atomic struct types.
When a struct's size is not a power of 2, the corresponding _Atomic() type is
promoted to the nearest. We already correctly handled normal C++ expressions of
this form, but direct calls to the __c11_atomic_whatever builtins ended up
performing dodgy operations on the smaller non-atomic types (e.g. memcpy too
much). Later optimisations removed this as undefined behaviour.

This patch converts EmitAtomicExpr to allocate its temporaries at the full
atomic width, sidestepping the issue.

llvm-svn: 252507
2015-11-09 19:56:35 +00:00
Devin Coughlin 9c76869bc3 [analyzer] Fix assertion failure invalidating on const member function calls (PR25392).
We now return early when the 'this' value cannot be converted to a MemRegion.

llvm-svn: 252506
2015-11-09 19:50:29 +00:00
Mike Aizatsky aeb9dd92d5 Moving FileManager::removeDotPaths to llvm::sys::path::remove_dots
Differential Revision: http://reviews.llvm.org/D14394

llvm-svn: 252501
2015-11-09 19:12:18 +00:00
Alexander Kornienko fd6ce04cf6 Use "auto" when the type name is redundant
Summary: Use "auto" when the type name is redundant

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 252494
2015-11-09 17:53:06 +00:00
Jonathan Roelofs 9c0d3f5e6f Fix the cmake build after r252474 broke it
llvm-svn: 252489
2015-11-09 16:47:09 +00:00
Alexander Kornienko 4f35532dbe Adjust printQualifiedName to handle unscoped enums in a way similar to anonymous namespaces.
Patch by Sterling Augustine!

Differential revision: http://reviews.llvm.org/D14459

llvm-svn: 252488
2015-11-09 16:45:17 +00:00
Jonathan Roelofs e961432ae7 Create install targets for scan-build and scan-view
http://reviews.llvm.org/D14403

llvm-svn: 252474
2015-11-09 16:12:56 +00:00
Aaron Ballman 570100b306 Fixing SPHINX warnings with incorrect indentations.
llvm-svn: 252470
2015-11-09 15:24:09 +00:00
Renato Golin 4854d80c39 [EABI] Add Clang support for -meabi flag
The -meabi flag to control LLVM EABI version.

Without '-meabi' or with '-meabi default' imply LLVM triple default.
With '-meabi gnu' sets EABI GNU.
With '-meabi 4' or '-meabi 5' set EABI version 4 and 5 respectively.

A similar patch was introduced in LLVM.

Patch by Vinicius Tinti.

llvm-svn: 252463
2015-11-09 12:40:41 +00:00
Xinliang David Li 2d7ec5a970 [PGO] Code cleanup [NFC]
Use interfaces defined in LLVM to create FuncName
and FuncNameVar.

llvm-svn: 252434
2015-11-09 00:04:16 +00:00
Yaron Keren 30e4515a5f Replace tab with 8 spaces, NFC.
llvm-svn: 252426
2015-11-08 22:01:45 +00:00
Devin Coughlin 2cb767d32b [analyzer] Update SATestBuild.py to enable a 'download and patch' model for projects.
Currently the SATestBuild.py and SATestAdd.py buildbot scripts expect project
sources to be checked into the project repository. This commit changes these
scripts to additionally support a model where project sources are downloaded
rather than checked into the repository. Sometimes projects may need to be
modified (for example, to support a newer versions of clang), so the updated scripts
also allow for an optional patch file that will be applied to the downloaded
project source before analysis.

To support this workflow, this commit changes the expected layout of
a project in the repository. The project-specific helper scripts will stay
in the root of each project directory, but the benchmark source itself (if
checked into the repo) should now be stored in a subdirectory named
'CachedSource':

  project_name/
    cleanup_run_static_analyzer.sh [optional]
    run_static_analyzer.cmd [required]
    download_project.sh [optional]
    CachedSource/ [optional]
    changes_for_analyzer.patch [optional]

If the 'CachedSource' source directory is not present, the download script will
be executed. This script should download the project source into 'CachedSource'.
Then, if 'changes_for_analyzer.patch' is present its changes will
be applied to a copy of 'CachedSource' before analysis.

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

llvm-svn: 252410
2015-11-07 18:27:35 +00:00
Yaron Keren e02bcdca88 Remove spaces in empty line, NFC.
llvm-svn: 252405
2015-11-07 16:35:07 +00:00
Yaron Keren 5f813e8de3 Remove spaces at start of line, NFC.
llvm-svn: 252404
2015-11-07 16:24:52 +00:00
Craig Topper 681242c2be Make a couple methods static.
llvm-svn: 252400
2015-11-07 08:08:34 +00:00
Craig Topper 5ba2c50d9f Make SemaBuiltinCpuSupports a static function. NFC.
llvm-svn: 252399
2015-11-07 08:08:31 +00:00
Craig Topper 882bc8dfed Use makeArrayRef instead of explicitly mentioning the type. NFC
llvm-svn: 252398
2015-11-07 06:16:16 +00:00
Craig Topper a86e70dc0c Fix indentation. NFC
llvm-svn: 252397
2015-11-07 06:16:14 +00:00
Akira Hatanaka 48684b073e Use regex in test case.
This is a follow-up to r252369.

llvm-svn: 252376
2015-11-07 00:48:18 +00:00
Akira Hatanaka c866762272 Add support for function attribute 'not_tail_called'.
This attribute is used to prevent tail-call optimizations to the marked
function. For example, in the following piece of code, foo1 will not be
tail-call optimized: 

int __attribute__((not_tail_called)) foo1(int);

int foo2(int a) {
  return foo1(a); // Tail-call optimization is not performed.
}

The attribute has effect only on statically bound calls. It has no
effect on indirect calls. Also, virtual functions and objective-c
methods cannot be marked as 'not_tail_called'.

rdar://problem/22667622

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

llvm-svn: 252369
2015-11-06 23:56:15 +00:00
Duncan P. N. Exon Smith b126f6b6c8 StaticAnalyzer: Remove implicit ilist iterator conversions, NFC
Remove implicit ilist iterator conversions from clangStaticAnalyzer.

llvm-svn: 252360
2015-11-06 23:04:58 +00:00
Duncan P. N. Exon Smith 9f5260ab13 CodeGen: Remove implicit ilist iterator conversions, NFC
Make ilist iterator conversions explicit in clangCodeGen.  Eventually
I'll remove them everywhere.

llvm-svn: 252358
2015-11-06 23:00:41 +00:00
Aaron Ballman bde4c81ffe Fixing line endings; NFC.
llvm-svn: 252314
2015-11-06 15:34:03 +00:00
Kuba Brecka cc47f200ba Followup test failure fix for r252310 ("[tsan] Add Clang frontend support for TSan on OS X").
llvm-svn: 252311
2015-11-06 15:20:30 +00:00
Kuba Brecka 85e01c0bdc [tsan] Add Clang frontend support for TSan on OS X
We're currently in process of porting TSan to OS X, and quite a few of the initial support in the runtime library has already landed in trunk. This patch actually enables "-fsanitize=thread" in the frontend.

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

llvm-svn: 252310
2015-11-06 15:09:20 +00:00
Petar Jovanovic 73d1044abe Fix __builtin_signbit for ppcf128 type
Function__builtin_signbit returns wrong value for type ppcf128 on big endian
machines. This patch fixes how value is generated in that case.

Patch by Aleksandar Beserminji.

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

llvm-svn: 252307
2015-11-06 14:52:46 +00:00
Yury Gribov 22b4164e7d [analyzer] Add VforkChecker to find unsafe code in vforked process.
This checker looks for unsafe constructs in vforked process:
function calls (excluding whitelist), memory write and returns.
This was originally motivated by a vfork-related bug in xtables package.

Patch by Yury Gribov.

Differential revision: http://reviews.llvm.org/D14014

llvm-svn: 252285
2015-11-06 11:16:31 +00:00
Alexander Kornienko ad98885be1 Refactor: Simplify boolean conditional return statements in lib/ARCMigrate
Patch by Richard Thomson! (+a couple of modifications to address comments)

Differential revision: http://reviews.llvm.org/D10009

llvm-svn: 252261
2015-11-06 01:26:37 +00:00
Alexander Kornienko 090360d630 Refactor: simplify boolean conditional return statements in lib/Analysis
Patch by Richard Thomson!

Differential revision: http://reviews.llvm.org/D10008

llvm-svn: 252256
2015-11-06 01:08:38 +00:00