Commit Graph

223678 Commits

Author SHA1 Message Date
Alexander Kornienko 1612fa07d3 Add a new check, readability-redundant-string-init, that checks unnecessary string initializations.
Reviewers: hokein, alexfh

Subscribers: cfe-commits

Patch by Shuai Wang!

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

llvm-svn: 261939
2016-02-25 23:57:23 +00:00
Rui Ueyama a354c5c433 ELF: Create MIPS .rld_map section earlier.
This is the usual way of instantiating a globally-visible section.

llvm-svn: 261938
2016-02-25 23:54:49 +00:00
Eugene Zelenko 50ff9fee00 Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source/Commands/CommandObjectThread.cpp; other minor fixes.
llvm-svn: 261936
2016-02-25 23:46:36 +00:00
Devin Coughlin 591991c86f [analyzer] Warn on use of 'self' after call to to [super dealloc].
Referring to 'self' after a call to [super dealloc] is a use-after-free in
Objective-C because NSObject's -dealloc frees the memory pointed to by self.
This patch extends the ObjCSuperDeallocChecker to catch this error.

rdar://problem/6953275

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

llvm-svn: 261935
2016-02-25 23:36:52 +00:00
Owen Anderson 7bd3499d05 More internal details of SROA pass to library visibility.
llvm-svn: 261934
2016-02-25 23:34:21 +00:00
Rafael Espindola 58e4c6bdba Delete dead code.
When this code was first added it was compensating for the code deciding
to create plt entries for directly referenced functions being too aggressive.

That has since been fixed, so we don't need this anymore.

llvm-svn: 261933
2016-02-25 23:16:33 +00:00
Rafael Espindola dd7f4e33ea Move common code out of target specific hooks.
llvm-svn: 261932
2016-02-25 23:03:55 +00:00
Justin Bogner 78cd1ddfbb Support: Give ManagedStatic's helper object library visibility
It doesn't make much sense to export these symbols.

llvm-svn: 261931
2016-02-25 22:05:19 +00:00
Simon Atanasyan 860fbf094e [ELF][MIPS] Calculate combined addend for R_MIPS_GOT16 against local symbol
R_MIPS_GOT16 relocation against local symbol requires index of a local
GOT entry which contains page address corresponds to sum of the symbol
address and addend. The addend in that case is calculated using addends
from the R_MIPS_GOT16 and paired R_MIPS_LO16 relocations.

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

llvm-svn: 261930
2016-02-25 21:33:56 +00:00
Devin Coughlin ad9f53e959 [analyzer] Reapply r261917 with a fix.
This reapplies "[analyzer] Make ObjCDeallocChecker path sensitive." (r261917)
with a fix for an error on some bots about specializing a template
from another namespace.

llvm-svn: 261929
2016-02-25 21:15:16 +00:00
Simon Atanasyan bea9698b0e [ELF][MIPS] Remove redundant namespace qualifier. NFC
llvm-svn: 261928
2016-02-25 21:09:05 +00:00
Hemant Kulkarni de1152f444 Reverts change r261907 and r261918
llvm-svn: 261927
2016-02-25 20:47:07 +00:00
Marshall Clow 41f4b6d4fa more status updates
llvm-svn: 261926
2016-02-25 20:17:03 +00:00
Marshall Clow 4877c197c2 Added tests to make sure that the categorization traits work on incomplete types
llvm-svn: 261925
2016-02-25 20:15:47 +00:00
Rui Ueyama 3095148015 ELF: Split Writer::addPredefiendSections. NFC.
llvm-svn: 261924
2016-02-25 19:34:37 +00:00
Rui Ueyama 4cea4e81d4 ELF: Split Writer::writeHeader. NFC.
llvm-svn: 261923
2016-02-25 19:28:37 +00:00
Hongbin Zheng 8c70ab75a0 Use regex in testcase, do not fail windows bots
llvm-svn: 261922
2016-02-25 19:16:40 +00:00
Devin Coughlin ea02bba5a1 Revert "[analyzer] Make ObjCDeallocChecker path sensitive."
This reverts commit r261917. It broke the bots.

llvm-svn: 261921
2016-02-25 19:13:43 +00:00
Eugene Zelenko f13e65232d Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source/Commands/CommandObjectTarget.cpp; other minor fixes.
llvm-svn: 261920
2016-02-25 19:02:39 +00:00
Rui Ueyama 10bd283041 ELF: Define log() to print out message if --verbose is given.
llvm-svn: 261919
2016-02-25 18:56:01 +00:00
Hemant Kulkarni c518d9b6ec Fix endianness issue on BE machines introduced by r261907
llvm-svn: 261918
2016-02-25 18:56:01 +00:00
Devin Coughlin 88691c1fcb [analyzer] Make ObjCDeallocChecker path sensitive.
Convert the ObjCDeallocChecker to be path sensitive. The primary
motivation for this change is to prevent false positives when -dealloc calls
helper invalidation methods to release instance variables, but it additionally
improves precision when -dealloc contains control flow. It also reduces the need
for pattern matching. The check for missing -dealloc methods remains AST-based.

Part of rdar://problem/6927496

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

llvm-svn: 261917
2016-02-25 18:55:24 +00:00
David L Kreitzer 602ba70a0b Reformatted a comment to fit the 80 column limit. NFC.
llvm-svn: 261916
2016-02-25 18:50:45 +00:00
Jonathan Peyton 2f7c077b5a Add new OpenMP 4.5 affinity API
This change introduces the new OpenMP 4.5 affinity api surrounding
OpenMP Places. There are six new entry points:

Typically called in serial region:
 * omp_get_num_places - returns the number of places available to the execution
       environment in the place list.
 * omp_get_place_num_procs - returns the number of processors available to the
       execution environment in the specified place.
 * omp_get_place_proc_ids - returns the numerical identifiers of the processors
       available to the execution environment in the specified place.

Typically called inside parallel region:
 * omp_get_place_num - returns the place number of the place to which the
       encountering thread is bound.
 * omp_get_partition_num_places - returns the number of places in the place
       partition of the innermost implicit task.
 * omp_get_partition_place_nums - returns the list of place numbers
       corresponding to the places in the place-var ICV of the innermost
       implicit task.

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

llvm-svn: 261915
2016-02-25 18:49:52 +00:00
Rui Ueyama 29d8eef440 Rename so that the function name is consistent between ELF and COFF.
llvm-svn: 261914
2016-02-25 18:49:11 +00:00
Rui Ueyama 6a9ef8550c Remove default values which are always overwritten.
llvm-svn: 261913
2016-02-25 18:49:09 +00:00
Rui Ueyama 0b28952993 ELF: Implement ICF.
This patch implements the same algorithm as LLD/COFF's ICF. I'm
not going to repeat the same description about how it works, so you
want to read the comment in ICF.cpp in this patch if you want to know
the details. This algorithm should be more powerful than the ICF
algorithm implemented in GNU gold. It can even merge mutually-recursive
functions (which is harder than one might think).

ICF is a fairly effective size optimization. Here are some examples.

 LLD:   37.14 MB -> 35.80 MB (-3.6%)
 Clang: 59.41 MB -> 57.80 MB (-2.7%)

The lacking feature is "safe" version of ICF. This merges all
identical sections. That is not compatible with a C/C++ language
requirement that two distinct functions must have distinct addresses.

But as long as your program do not rely on the pointer equality
(which is in many cases true), your program should work with the
feature. LLD works fine for example.

GNU gold implements so-called "safe ICF" that identifies functions
that are safe to merge by heuristics -- for example, gold thinks
that constructors are safe to merge because there is no way to
take an address of a constructor in C++. We have a different idea
which David Majnemer suggested that we add NOPs at beginning of
merged functions so that two or more pointers can have distinct
values. We can do whichever we want, but this patch does not
include neither.

http://reviews.llvm.org/D17529

llvm-svn: 261912
2016-02-25 18:43:51 +00:00
Chris Bieneman 2c6c01a4fc [CMake] Fixing install-clang-headers dependencies to depend on generating the headers.
llvm-svn: 261911
2016-02-25 18:39:19 +00:00
Hongbin Zheng bb48b353a1 Try to fix windows fail at r261902.
Introduce move constructor and move assignment operator to PostDominatorTree.

llvm-svn: 261910
2016-02-25 18:24:19 +00:00
Alexey Samsonov 07f9c0f558 [Sanitizer] Protect against compiler-inserted memcpy() in InternalMmapVector::push_back().
llvm-svn: 261909
2016-02-25 18:12:30 +00:00
Jonathan Peyton 2851072d69 Add initial support for OpenMP 4.5 task priority feature
The maximum task priority value is read from envirable: OMP_MAX_TASK_PRIORITY.
But as of now, nothing is done with it.  We just handle the environment variable
and add the new api: omp_get_max_task_priority() which returns that value or
zero if it is not set.

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

llvm-svn: 261908
2016-02-25 18:04:09 +00:00
Hemant Kulkarni 2a834115bf [llvm-readobj] Enable GNU style sections and relocations printing
http://reviews.llvm.org/D17523

llvm-svn: 261907
2016-02-25 18:02:00 +00:00
Jonathan Peyton ea0fe1dfeb dd new OpenMP 4.5 schedule clause modifiers (monotonic/non-monotonic) feature
The monotonic/non-monotonic flags are sent to the runtime via the sched_type by
setting the 30th (non-monotonic) or 29th (monotonic) bit in the sched_type.
Macros are added to probe if monotonic or non-monotonic is specified
(SCHEDULE_HAS_[NON]MONOTONIC & SCHEDULE_HAS_NO_MODIFIERS)
and also to to get the base sched_type (SCHEDULE_WITHOUT_MODIFIERS)

Currently, nothing is done with the modifiers.

Also, this patch adds some comments on the use of the enumerations in at least
 one place where it is subtle.

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

llvm-svn: 261906
2016-02-25 17:55:50 +00:00
Hongbin Zheng defd098612 Adapt to LLVM head, again
llvm-svn: 261905
2016-02-25 17:54:42 +00:00
Hongbin Zheng bc53977a0d Introduce RegionInfoAnalysis, which compute Region Tree in the new PassManager. NFC
Differential Revision: http://reviews.llvm.org/D17571

llvm-svn: 261904
2016-02-25 17:54:25 +00:00
Hongbin Zheng 751337faa7 Introduce DominanceFrontierAnalysis to the new PassManager to compute DominanceFrontier. NFC
Differential Revision: http://reviews.llvm.org/D17570

llvm-svn: 261903
2016-02-25 17:54:15 +00:00
Hongbin Zheng 3f97840721 Introduce analysis pass to compute PostDominators in the new pass manager. NFC
Differential Revision: http://reviews.llvm.org/D17537

llvm-svn: 261902
2016-02-25 17:54:07 +00:00
Pavel Labath 5a8453d576 Fix PythonDataObjectsTests for python 2
Summary:
the python2 branch seems erroneous as it expected the object to be both a "String" and "Bytes".
Fix the expectation.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 261901
2016-02-25 17:41:59 +00:00
Bill Seurer 1d180c31f4 [powerpc] reactivate ignore_lib4.cc on powerpc64le
The test case compiler-rt/test/tsan/ignore_lib4.cc fails on powerpc64
big endian but not little endian.

llvm-svn: 261900
2016-02-25 17:41:41 +00:00
Michael Kruse 9cfc49d5b5 Add update_test.py script.
The script updates a lit test case that uses FileCheck using the actual
output of the 'RUN:'-lines program. Useful when updating test cases due
expected output changes and diff'ing expected and actual output.

llvm-svn: 261899
2016-02-25 17:12:12 +00:00
Maxim Ostapenko 50ca4464c4 [sanitizer] Fix third parameter in COMMON_INTERCEPTOR_WRITE_RANGE in recv and recvfrom interceptors.
Pass res instead of len as third parameter to COMMON_INTERCEPTOR_WRITE_RANGE,
because otherwise we can write to unrelated memory (in MSan) or get wrong report (in ASan).

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

llvm-svn: 261898
2016-02-25 17:07:38 +00:00
NAKAMURA Takumi be16bbc925 Revert r261814, "check-clang-tools: Introduce the feature target-headers", corresponding to r261893.
llvm-svn: 261897
2016-02-25 16:59:59 +00:00
Marshall Clow 21dc2c25e7 Update the status of a N4089 and a couple issues
llvm-svn: 261896
2016-02-25 16:55:58 +00:00
Tim Northover aa35bd26c7 ARM: disallow pc as a base register in Thumb2 memory ops.
These should all be deferring to the "OP (literal)" variant according to the
ARM ARM.

llvm-svn: 261895
2016-02-25 16:54:52 +00:00
Marshall Clow 026b805687 Another chunk of N4089
llvm-svn: 261894
2016-02-25 16:50:51 +00:00
Alexander Kornienko f9c1e2c812 [clang-tidy] Adding headers needed in modernize-deprecated-headers tests
llvm-svn: 261893
2016-02-25 16:46:54 +00:00
Hongbin Zheng 566c614525 Revert "Adapt to LLVM head. NFC"
This reverts commit 4d3753b9646a69c00d234ccd6e91dc3d0ea5d643.

llvm-svn: 261892
2016-02-25 16:46:17 +00:00
Hongbin Zheng 66b19fbc4e Revert "Introduce analysis pass to compute PostDominators in the new pass manager. NFC"
This reverts commit a3e5cc6a51ab5ad88d1760c63284294a4e34c018.

llvm-svn: 261891
2016-02-25 16:45:53 +00:00
Hongbin Zheng ad782ce3f7 Revert "Introduce DominanceFrontierAnalysis to the new PassManager to compute DominanceFrontier. NFC"
This reverts commit 109c38b2226a87b0be73fa7a0a8c1a81df20aeb2.

llvm-svn: 261890
2016-02-25 16:45:46 +00:00
Hongbin Zheng 921fabf34b Revert "Introduce RegionInfoAnalysis, which compute Region Tree in the new PassManager. NFC"
This reverts commit 8228b4d374edeb4cc0c5fddf6e1ab876918ee126.

llvm-svn: 261889
2016-02-25 16:45:37 +00:00