Sam McCall [Thu, 18 Jul 2019 07:17:49 +0000 (07:17 +0000)]
[CodeComplete] Fix ASTUnit cached completion of macros from preamble, broken in r342528
Summary:
The problem is the default LoadExternal with no completer, which happens when
loading global results.
Reviewers: ilya-biryukov, nik
Subscribers: arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64864
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366409
91177308-0d34-0410-b5e6-
96231b3b80d8
Qiu Chaofan [Thu, 18 Jul 2019 06:20:12 +0000 (06:20 +0000)]
[PowerPC][Clang] Remove use of malloc in mm_malloc
Remove dependency of malloc in implementation of mm_malloc function in PowerPC
intrinsics and alignment assumption on glibc.
Reviewed By: Hal Finkel
Differential Revision: https://reviews.llvm.org/D64850
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366406
91177308-0d34-0410-b5e6-
96231b3b80d8
Csaba Dabis [Thu, 18 Jul 2019 00:03:55 +0000 (00:03 +0000)]
[analyzer] MallocChecker: Prevent Integer Set Library false positives
Summary:
Integer Set Library using retain-count based allocation which is not
modeled in MallocChecker.
Reviewed By: NoQ
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64680
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366391
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 17 Jul 2019 21:45:19 +0000 (21:45 +0000)]
hwasan: Initialize the pass only once.
This will let us instrument globals during initialization. This required
making the new PM pass a module pass, which should still provide access to
analyses via the ModuleAnalysisManager.
Differential Revision: https://reviews.llvm.org/D64843
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366379
91177308-0d34-0410-b5e6-
96231b3b80d8
Sunil Srivastava [Wed, 17 Jul 2019 20:41:26 +0000 (20:41 +0000)]
Renamed and changed the wording of warn_cconv_ignored
As discussed in D64780 the wording of this warning message is being
changed to say 'is not supported' instead of 'ignored', and the
diag ID itself is being changed to warn_cconv_not_supported.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366368
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Wed, 17 Jul 2019 18:03:39 +0000 (18:03 +0000)]
[OPENMP]Fix PR42632: crash on the analysis of the OpenMP constructs.
Fixed processing of the CapturedStmt children to fix the crash of the
OpenMP constructs during analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366357
91177308-0d34-0410-b5e6-
96231b3b80d8
Momchil Velikov [Wed, 17 Jul 2019 17:43:32 +0000 (17:43 +0000)]
Revert [AArch64] Add support for Transactional Memory Extension (TME)
This reverts r366322 (git commit
4b8da3a503e434ddbc08ecf66582475765f449bc)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366355
91177308-0d34-0410-b5e6-
96231b3b80d8
Anastasia Stulova [Wed, 17 Jul 2019 17:21:31 +0000 (17:21 +0000)]
[Docs][OpenCL] Documentation of C++ for OpenCL mode
Added documentation of C++ for OpenCL mode into Clang
User Manual and Language Extensions document.
Differential Revision: https://reviews.llvm.org/D64418
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366351
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Rice [Wed, 17 Jul 2019 15:18:45 +0000 (15:18 +0000)]
[OPENMP]Fix crash in LoopCounterRefChecker when MemberExpr is not Var or Field
checkDecl is only valid for VarDecls or FieldDecls, since getCanonicalDecl
expects only these. Prevent other Decl kinds (such as CXXMethodDecls and
EnumConstantDecls) from entering and asserting.
Differential Revision: https://reviews.llvm.org/D64842
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366336
91177308-0d34-0410-b5e6-
96231b3b80d8
Gabor Marton [Wed, 17 Jul 2019 14:40:09 +0000 (14:40 +0000)]
[ASTImporter] Fix structural eq of lambdas
Summary:
The structural equivalence check reported false eq between lambda classes
with different parameters in their call signature.
The solution is to check the methods for equality too in case of lambda
classes.
Reviewers: a_sidorin, a.sidorin
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64075
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366332
91177308-0d34-0410-b5e6-
96231b3b80d8
Gabor Marton [Wed, 17 Jul 2019 13:47:46 +0000 (13:47 +0000)]
[ASTImporter] Fix LLDB lookup in transparent ctx and with ext src
Summary:
With LLDB we use localUncachedLookup(), however, that fails to find
Decls when a transparent context is involved and the given DC has
external lexical storage. The solution is to use noload_lookup, which
works well with transparent contexts. But, we cannot use only the
noload_lookup since the slow case of localUncachedLookup is still needed
in some other cases.
These other cases are handled in ASTImporterLookupTable, but we cannot
use that with LLDB since that traverses through the AST which initiates
the load of external decls again via DC::decls().
We must avoid loading external decls during the import becuase
ExternalASTSource is implemented with ASTImporter, so external loads
during import results in uncontrolled and faulty import.
Reviewers: shafik, teemperor, jingham, clayborg, a_sidorin, a.sidorin
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits, lldb-commits
Tags: #clang, #lldb
Differential Revision: https://reviews.llvm.org/D61333
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366325
91177308-0d34-0410-b5e6-
96231b3b80d8
Momchil Velikov [Wed, 17 Jul 2019 13:23:27 +0000 (13:23 +0000)]
[AArch64] Add support for Transactional Memory Extension (TME)
TME is a future architecture technology, documented in
https://developer.arm.com/architectures/cpu-architecture/a-profile/exploration-tools
https://developer.arm.com/docs/ddi0601/a
More about the future architectures:
https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/new-technologies-for-the-arm-a-profile-architecture
This patch adds support for the TME instructions TSTART, TTEST, TCOMMIT, and
TCANCEL and the target feature/arch extension "tme".
It also implements TME builtin functions, defined in ACLE Q2 2019
(https://developer.arm.com/docs/101028/latest)
Patch by Javed Absar and Momchil Velikov
Differential Revision: https://reviews.llvm.org/D64416
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366322
91177308-0d34-0410-b5e6-
96231b3b80d8
Momchil Velikov [Wed, 17 Jul 2019 11:24:37 +0000 (11:24 +0000)]
[AArch64] Consistent types and naming for AArch64 target features (NFC)
Differential Revision: https://reviews.llvm.org/D64415
Committed as obvious.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366315
91177308-0d34-0410-b5e6-
96231b3b80d8
Marco Antognini [Wed, 17 Jul 2019 08:52:09 +0000 (08:52 +0000)]
[OpenCL][Sema] Minor refactoring and constraint checking
Summary:
Simplify code a bit and add assertion to address post-landing comments
from D64083.
Subscribers: yaxunl, Anastasia, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64804
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366306
91177308-0d34-0410-b5e6-
96231b3b80d8
Rainer Orth [Wed, 17 Jul 2019 08:37:00 +0000 (08:37 +0000)]
[Driver] Enable __cxa_atexit on Solaris
Starting with Solaris 11.4 (which is now the required minimal version), Solaris does
support __cxa_atexit. This patch reflects that.
One might consider removing the affected tests altogether instead of inverting them,
as is done on other targets.
Besides, this lets two ASan tests PASS:
AddressSanitizer-i386-sunos :: TestCases/init-order-atexit.cc
AddressSanitizer-i386-sunos-dynamic :: TestCases/init-order-atexit.cc
Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64491
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366305
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 17 Jul 2019 00:01:03 +0000 (00:01 +0000)]
AMDGPU: Add some missing builtins
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366286
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 16 Jul 2019 23:44:33 +0000 (23:44 +0000)]
Fix OpenCLCXX test on 32-bit Windows where thiscall is present
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366284
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 16 Jul 2019 23:38:05 +0000 (23:38 +0000)]
Fix darwin-ld.c if dsymutil.exe exists on PATH
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366282
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Tue, 16 Jul 2019 22:32:17 +0000 (22:32 +0000)]
Fix a typo in target features
There was a slight typo in r364352 that ended up causing our backend to
complain on some x86 Android builds. This CL fixes that.
Differential Revision: https://reviews.llvm.org/D64781
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366276
91177308-0d34-0410-b5e6-
96231b3b80d8
Guanzhong Chen [Tue, 16 Jul 2019 22:00:45 +0000 (22:00 +0000)]
[WebAssembly] Implement thread-local storage (local-exec model)
Summary:
Thread local variables are placed inside a `.tdata` segment. Their symbols are
offsets from the start of the segment. The address of a thread local variable
is computed as `__tls_base` + the offset from the start of the segment.
`.tdata` segment is a passive segment and `memory.init` is used once per thread
to initialize the thread local storage.
`__tls_base` is a wasm global. Since each thread has its own wasm instance,
it is effectively thread local. Currently, `__tls_base` must be initialized
at thread startup, and so cannot be used with dynamic libraries.
`__tls_base` is to be initialized with a new linker-synthesized function,
`__wasm_init_tls`, which takes as an argument a block of memory to use as the
storage for thread locals. It then initializes the block of memory and sets
`__tls_base`. As `__wasm_init_tls` will handle the memory initialization,
the memory does not have to be zeroed.
To help allocating memory for thread-local storage, a new compiler intrinsic
is introduced: `__builtin_wasm_tls_size()`. This instrinsic function returns
the size of the thread-local storage for the current function.
The expected usage is to run something like the following upon thread startup:
__wasm_init_tls(malloc(__builtin_wasm_tls_size()));
Reviewers: tlively, aheejin, kripken, sbc100
Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, jfb, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D64537
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366272
91177308-0d34-0410-b5e6-
96231b3b80d8
Ben Hamilton [Tue, 16 Jul 2019 21:29:40 +0000 (21:29 +0000)]
[clang-format] Don't detect call to ObjC class method as C++11 attribute specifier
Summary:
Previously, clang-format detected something like the following as a C++11 attribute specifier.
@[[NSArray class]]
instead of an array with an Objective-C method call inside. In general, when the attribute specifier checking runs, if it sees 2 identifiers in a row, it decides that the square brackets represent an Objective-C method call. However, here, `class` is tokenized as a keyword instead of an identifier, so this check fails.
To fix this, the attribute specifier first checks whether the first square bracket has an "@" before it. If it does, then that square bracket is not the start of a attribute specifier because it is an Objective-C array literal. (The assumption is that @[[.*]] is not valid C/C++.)
Contributed by rkgibson2.
Reviewers: benhamilton
Reviewed By: benhamilton
Subscribers: aaron.ballman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64632
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366267
91177308-0d34-0410-b5e6-
96231b3b80d8
Yonghong Song [Tue, 16 Jul 2019 17:24:33 +0000 (17:24 +0000)]
fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic
The original commit is r366076. It is temporarily reverted (r366155)
due to test failure. This resubmit makes test more robust by accepting
regex instead of hardcoded names/references in several places.
This is a followup patch for https://reviews.llvm.org/D61809.
Handle unnamed bitfield properly and add more test cases.
Fixed the unnamed bitfield issue. The unnamed bitfield is ignored
by debug info, so we need to ignore such a struct/union member
when we try to get the member index in the debug info.
D61809 contains two test cases but not enough as it does
not checking generated IRs in the fine grain level, and also
it does not have semantics checking tests.
This patch added unit tests for both code gen and semantics checking for
the new intrinsic.
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366231
91177308-0d34-0410-b5e6-
96231b3b80d8
Neil Hickey [Tue, 16 Jul 2019 14:57:32 +0000 (14:57 +0000)]
[OpenCL] Fixing sampler initialisations for C++ mode.
Allow conversions between integer and sampler type.
Differential Revision: https://reviews.llvm.org/D64791
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366212
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Tue, 16 Jul 2019 14:51:46 +0000 (14:51 +0000)]
[OPENMP]Add support for analysis of if clauses.
Summary:
Added support for analysis of if clauses in the OpenMP directives to be
able to check for the use of uninitialized variables.
Reviewers: NoQ
Subscribers: guansong, jfb, jdoerfert, caomhin, kkwli0, cfe-commits
Tags: clang
Differential Revision: https://reviews.llvm.org/D64646
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366211
91177308-0d34-0410-b5e6-
96231b3b80d8
Rainer Orth [Tue, 16 Jul 2019 11:06:43 +0000 (11:06 +0000)]
[Driver] Don't pass --dynamic-linker to ld on Solaris
I noticed that clang currently passes --dynamic-linker to ld. This has been the case
since Solaris 11 support was added initially back in 2012 by David Chisnall (r150580).
I couldn't find any patch submission, let alone a justification, for this, and it seems
completely useless: --dynamic-linker is a gld compatibility form of the option, the
native option being -I. First of all, however, the dynamic linker passed is simply the
default, so there's no reason at all to specify it in the first place.
This patch removes passing the option and adjusts the affected testcase accordingly.
Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64493
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366202
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam McCall [Tue, 16 Jul 2019 10:30:21 +0000 (10:30 +0000)]
[SemaTemplate] Fix uncorrected typos after pack expansion
Summary:
This case is particularly important for clangd, as it is triggered after
inserting the snippet for variadic functions.
Reviewers: kadircet, ilya-biryukov
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64677
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366200
91177308-0d34-0410-b5e6-
96231b3b80d8
Kyrylo Tkachov [Tue, 16 Jul 2019 09:27:39 +0000 (09:27 +0000)]
[AArch64] Implement __jcvt intrinsic from Armv8.3-A
The jcvt intrinsic defined in ACLE [1] is available when ARM_FEATURE_JCVT is defined.
This change introduces the AArch64 intrinsic, wires it up to the instruction and a new clang builtin function.
The __ARM_FEATURE_JCVT macro is now defined when an Armv8.3-A or higher target is used.
I've implemented the target detection logic in Clang so that this feature is enabled for architectures from armv8.3-a onwards (so -march=armv8.4-a also enables this, for example).
make check-all didn't show any new failures.
[1] https://developer.arm.com/docs/101028/latest/data-processing-intrinsics
Differential Revision: https://reviews.llvm.org/D64495
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366197
91177308-0d34-0410-b5e6-
96231b3b80d8
Serge Guelton [Tue, 16 Jul 2019 08:56:47 +0000 (08:56 +0000)]
[clang-scan-view] Force utf-8 when handling report (python2 only)
Original patch by random human <random.bored.human@gmail.com>
Differential Revision: https://reviews.llvm.org/D64129
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366194
91177308-0d34-0410-b5e6-
96231b3b80d8
Stephan Bergmann [Tue, 16 Jul 2019 06:23:27 +0000 (06:23 +0000)]
Finish "Adapt -fsanitize=function to SANITIZER_NON_UNIQUE_TYPEINFO"
i.e., recent
5745eccef54ddd3caca278d1d292a88b2281528b:
* Bump the function_type_mismatch handler version, as its signature has changed.
* The function_type_mismatch handler can return successfully now, so
SanitizerKind::Function must be AlwaysRecoverable (like for
SanitizerKind::Vptr).
* But the minimal runtime would still unconditionally treat a call to the
function_type_mismatch handler as failure, so disallow -fsanitize=function in
combination with -fsanitize-minimal-runtime (like it was already done for
-fsanitize=vptr).
* Add tests.
Differential Revision: https://reviews.llvm.org/D61479
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366186
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Tue, 16 Jul 2019 04:46:31 +0000 (04:46 +0000)]
Fix parameter name comments using clang-tidy. NFC.
This patch applies clang-tidy's bugprone-argument-comment tool
to LLVM, clang and lld source trees. Here is how I created this
patch:
$ git clone https://github.com/llvm/llvm-project.git
$ cd llvm-project
$ mkdir build
$ cd build
$ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug \
-DLLVM_ENABLE_PROJECTS='clang;lld;clang-tools-extra' \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLLVM_ENABLE_LLD=On \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../llvm
$ ninja
$ parallel clang-tidy -checks='-*,bugprone-argument-comment' \
-config='{CheckOptions: [{key: StrictMode, value: 1}]}' -fix \
::: ../llvm/lib/**/*.{cpp,h} ../clang/lib/**/*.{cpp,h} ../lld/**/*.{cpp,h}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366177
91177308-0d34-0410-b5e6-
96231b3b80d8
Ali Tamur [Tue, 16 Jul 2019 03:20:15 +0000 (03:20 +0000)]
Revert "[OPENMP]Add support for analysis of if clauses."
This reverts commit rL366068.
The patch broke 86 tests under clang/test/OpenMP/ when run with address sanitizer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366169
91177308-0d34-0410-b5e6-
96231b3b80d8
Nathan Lanza [Tue, 16 Jul 2019 02:05:52 +0000 (02:05 +0000)]
Change a lit test to permit vendor specific clang version
A test manually checks for the string `__VERSION__ "Clang`. This needs
to permit vendor specific variants.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366166
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Haarman [Tue, 16 Jul 2019 01:35:49 +0000 (01:35 +0000)]
reland "add -fthinlto-index= option to clang-cl"
Summary:
This is a reland of r366146, adding in the previously missing '--'
flag that prevents filenames from being interpreted as flags.
Original description:
This adds a -fthinlto-index= option to clang-cl, which allows it to
be used to drive ThinLTO backend passes. This allows clang-cl to be
used for distributed ThinLTO.
Tags: #clang
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366165
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Wu [Tue, 16 Jul 2019 01:13:36 +0000 (01:13 +0000)]
[Sema] Suppress additional warnings for C's zero initializer
Summary:
D28148 relaxed some checks for assigning { 0 } to a structure for all C
standards, but it failed to handle structures with non-integer
subobjects. Relax -Wmissing-braces checks for such structures, and add
some additional tests.
This fixes PR39931.
Patch By: al3xtjames
Reviewed By: Lekensteyn
Differential Revision: https://reviews.llvm.org/D61838
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366163
91177308-0d34-0410-b5e6-
96231b3b80d8
Nathan Lanza [Tue, 16 Jul 2019 00:57:50 +0000 (00:57 +0000)]
Allow for vendor prefixes in a list test
Summary:
Preprocessor/init.c contains a line that explicitly checks for the
string
__VERSION__ "Clang{{.*}}
It's valid to have a toolchain configured to emit a vendor prefix
before the word Clang. e.g.
__VERSION__ "Vendor Clang{{.*}}
Subscribers: fedor.sergeev, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64772
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366159
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 16 Jul 2019 00:02:40 +0000 (00:02 +0000)]
Temporarily revert "add -fthinlto-index= option to clang-cl"
This is causing testsuite failures on (at least) darwin release+asserts.
This reverts commit r366146.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366157
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 15 Jul 2019 23:49:31 +0000 (23:49 +0000)]
Temporarily Revert "fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic"
The commit had tests that would only work with names in the IR.
This reverts commit r366076.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366155
91177308-0d34-0410-b5e6-
96231b3b80d8
Leonard Chan [Mon, 15 Jul 2019 23:18:31 +0000 (23:18 +0000)]
Revert "[NewPM] Port Sancov"
This reverts commit
5652f35817f07b16f8b3856d594cc42f4d7ee29c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366153
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Korous [Mon, 15 Jul 2019 23:14:00 +0000 (23:14 +0000)]
[DirectoryWatcher][linux] Fix for older kernels
IN_EXCL_UNLINK exists since Linux 2.6.36
Differential Revision: https://reviews.llvm.org/D64764
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366152
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Haarman [Mon, 15 Jul 2019 22:50:04 +0000 (22:50 +0000)]
add -fthinlto-index= option to clang-cl
Summary:
This adds a -fthinlto-index= option to clang-cl, which allows it to
be used to drive ThinLTO backend passes. This allows clang-cl to be
used for distributed ThinLTO.
Reviewers: tejohnson, pcc, rnk
Subscribers: mehdi_amini, steven_wu, dexonsmith, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64458
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366146
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 15 Jul 2019 22:34:19 +0000 (22:34 +0000)]
[OpenCL] Make TableGen'd builtin tables and helper functions static
Reviewers: Pierre, Anastasia
Reviewed By: Anastasia
Subscribers: yaxunl, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64608
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366143
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 15 Jul 2019 22:27:57 +0000 (22:27 +0000)]
[clang-fuzzer] Remove 'setUseOrcMCJITReplacement(false)' call.
The default value for this option (UseMCJITReplacement) is already false, and
OrcMCJITReplacement is going to have deprecation warnings attached in LLVM 9.0.
Removing this call removes a spurious warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366141
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Korous [Mon, 15 Jul 2019 22:11:51 +0000 (22:11 +0000)]
[DirectoryWatcher][test] Relax test assumptions
Workaround for FSEvents sometimes sending notifications for events that happened
before DirectoryWatcher was created.
This caused tests to be flaky on green dragon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366138
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Korous [Mon, 15 Jul 2019 22:11:28 +0000 (22:11 +0000)]
[DirectoryWatcher][NFC][test] Add typedef for enum
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366137
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Haarman [Mon, 15 Jul 2019 20:51:44 +0000 (20:51 +0000)]
[clang] allow -fthinlto-index= without -x ir
Summary:
Previously, passing -fthinlto-index= to clang required that bitcode
files be explicitly marked by -x ir. This change makes us detect files
with object file extensions as bitcode files when -fthinlto-index= is
present, so that explicitly marking them is no longer necessary.
Explicitly specifying -x ir is still accepted and continues to be part
of the test case to ensure we continue to support it.
Reviewers: tejohnson, rnk, pcc
Subscribers: mehdi_amini, steven_wu, dexonsmith, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64610
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366127
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Mon, 15 Jul 2019 20:02:23 +0000 (20:02 +0000)]
ARM MTE stack sanitizer.
Add "memtag" sanitizer that detects and mitigates stack memory issues
using armv8.5 Memory Tagging Extension.
It is similar in principle to HWASan, which is a software implementation
of the same idea, but there are enough differencies to warrant a new
sanitizer type IMHO. It is also expected to have very different
performance properties.
The new sanitizer does not have a runtime library (it may grow one
later, along with a "debugging" mode). Similar to SafeStack and
StackProtector, the instrumentation pass (in a follow up change) will be
inserted in all cases, but will only affect functions marked with the
new sanitize_memtag attribute.
Reviewers: pcc, hctim, vitalybuka, ostannard
Subscribers: srhines, mehdi_amini, javed.absar, kristof.beyls, hiraditya, cryptoad, steven_wu, dexonsmith, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D64169
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366123
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Mon, 15 Jul 2019 17:47:22 +0000 (17:47 +0000)]
Update __VERSION__ to remove the hardcoded 4.2.1 version
Summary:
Just like in https://reviews.llvm.org/D56803
for -dumpversion
Reviewers: rnk
Reviewed By: rnk
Subscribers: dexonsmith, lebedev.ri, hubert.reinterpretcast, xbolva00, fedor.sergeev, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63048
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366091
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Mon, 15 Jul 2019 17:27:46 +0000 (17:27 +0000)]
Use a unique_ptr instead of manual memory management for LineTable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366088
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Mon, 15 Jul 2019 17:20:34 +0000 (17:20 +0000)]
Use a unique_ptr instead of manual memory management for CustomDiagInfo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366085
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Mon, 15 Jul 2019 17:12:08 +0000 (17:12 +0000)]
Use unique_ptr instead of manual delete in one place. No behavior change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366084
91177308-0d34-0410-b5e6-
96231b3b80d8
Yonghong Song [Mon, 15 Jul 2019 15:42:41 +0000 (15:42 +0000)]
fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic
This is a followup patch for https://reviews.llvm.org/D61809.
Handle unnamed bitfield properly and add more test cases.
Fixed the unnamed bitfield issue. The unnamed bitfield is ignored
by debug info, so we need to ignore such a struct/union member
when we try to get the member index in the debug info.
D61809 contains two test cases but not enough as it does
not checking generated IRs in the fine grain level, and also
it does not have semantics checking tests.
This patch added unit tests for both code gen and semantics checking for
the new intrinsic.
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366076
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Mon, 15 Jul 2019 14:46:23 +0000 (14:46 +0000)]
[OPENMP]Add support for analysis of if clauses.
Summary:
Added support for analysis of if clauses in the OpenMP directives to be
able to check for the use of uninitialized variables.
Reviewers: NoQ
Subscribers: guansong, jfb, jdoerfert, caomhin, kkwli0, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64646
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366068
91177308-0d34-0410-b5e6-
96231b3b80d8
Anastasia Stulova [Mon, 15 Jul 2019 13:02:21 +0000 (13:02 +0000)]
[OpenCL] Deduce addr space for pointee of dependent types in instantiation.
Since pointee doesn't require context sensitive addr space deduction
it's easier to handle pointee of dependent types during templ
instantiation.
Differential Revision: https://reviews.llvm.org/D64400
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366063
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 15 Jul 2019 13:00:43 +0000 (13:00 +0000)]
Fix uninitialized variable analyzer warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366062
91177308-0d34-0410-b5e6-
96231b3b80d8
Balazs Keri [Mon, 15 Jul 2019 12:16:30 +0000 (12:16 +0000)]
[ASTImporter] Using Lang_CXX14 in ASTImporterVisibilityTest.
Summary:
These tests may work with C++14 language constructs in the future
(variable templates and others).
To avoid warnings about language version C++ version constants in the tests
are updated.
Reviewers: martong, a.sidorin
Reviewed By: martong
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64477
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366061
91177308-0d34-0410-b5e6-
96231b3b80d8
Anastasia Stulova [Mon, 15 Jul 2019 11:58:10 +0000 (11:58 +0000)]
[OpenCL][PR41727] Prevent ICE on global dtors
Pass NULL to pointer arg of __cxa_atexit if addr space
is not matching with its param. This doesn't align yet
with how dtors are generated that should be changed too.
Differential Revision: https://reviews.llvm.org/D62413
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366059
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Mon, 15 Jul 2019 07:25:11 +0000 (07:25 +0000)]
[PowerPC] Support -mabi=ieeelongdouble and -mabi=ibmlongdouble
gcc PowerPC supports 3 representations of long double:
* -mlong-double-64
long double has the same representation of double but is mangled as `e`.
In clang, this is the default on AIX, FreeBSD and Linux musl.
* -mlong-double-128
2 possible 128-bit floating point representations:
+ -mabi=ibmlongdouble
IBM extended double format. Mangled as `g`
In clang, this is the default on Linux glibc.
+ -mabi=ieeelongdouble
IEEE 754 quadruple-precision format. Mangled as `u9__ieee128` (`U10__float128` before gcc 8.2)
This is currently unavailable.
This patch adds -mabi=ibmlongdouble and -mabi=ieeelongdouble, and thus
makes the IEEE 754 quadruple-precision long double available for
languages supported by clang.
Reviewed By: hfinkel
Differential Revision: https://reviews.llvm.org/D64283
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366044
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexandros Lamprineas [Sun, 14 Jul 2019 20:31:15 +0000 (20:31 +0000)]
[TargetParser][ARM] Account dependencies when processing target features
Teaches ARM::appendArchExtFeatures to account dependencies when processing
target features: i.e. when you say -march=armv8.1-m.main+mve.fp+nofp it
means mve.fp should get discarded too. (Split from D63936)
Differential Revision: https://reviews.llvm.org/D64048
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366031
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 14 Jul 2019 19:13:09 +0000 (19:13 +0000)]
Fix uninitialized variable analyzer warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366029
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Sun, 14 Jul 2019 18:33:51 +0000 (18:33 +0000)]
Support __seg_fs and __seg_gs on x86
Summary:
GCC supports named address spaces macros:
https://gcc.gnu.org/onlinedocs/gcc/Named-Address-Spaces.html
clang does as well with address spaces:
https://clang.llvm.org/docs/LanguageExtensions.html#memory-references-to-specified-segments
Add the __seg_fs and __seg_gs macros for compatibility with GCC.
<rdar://problem/
52944935>
Subscribers: jkorous, dexonsmith, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64676
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366028
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexandros Lamprineas [Sun, 14 Jul 2019 18:32:42 +0000 (18:32 +0000)]
[clang][Driver][ARM] Favor -mfpu over default CPU features
When processing the command line options march, mcpu and mfpu, we store
the implied target features on a vector. The change D62998 introduced a
temporary vector, where the processed features get accumulated. When
calling DecodeARMFeaturesFromCPU, which sets the default features for
the specified CPU, we certainly don't want to override the features
that have been explicitly specified on the command line. Therefore, the
default features should appear first in the final vector. This problem
became evident once I added the missing (unhandled) target features in
ARM::getExtensionFeatures.
Differential Revision: https://reviews.llvm.org/D63936
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366027
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Sun, 14 Jul 2019 18:25:09 +0000 (18:25 +0000)]
consistency in the release notes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366024
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Sun, 14 Jul 2019 07:16:13 +0000 (07:16 +0000)]
[Driver] Simplify AddLibgcc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366013
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Sun, 14 Jul 2019 06:46:46 +0000 (06:46 +0000)]
[Driver] Simplify -lgcc & -lgcc_s
gcc defaults to -shared-libgcc in C++ mode.
Letting getLibGccType() return SharedLibGcc simplifies the logic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366012
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Sat, 13 Jul 2019 19:49:39 +0000 (19:49 +0000)]
Remove extra ';' to silent compiler warning.
- Plus extra style formatting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366010
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Spertus [Sat, 13 Jul 2019 15:27:53 +0000 (15:27 +0000)]
Template-related improvements to Visual Studio visualizers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366007
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 13 Jul 2019 08:08:43 +0000 (08:08 +0000)]
Fix -Wdocumentation warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365995
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Sat, 13 Jul 2019 08:07:10 +0000 (08:07 +0000)]
[CMake][Fuchsia] Define asan+noexcept multilib
Using noexcept multilib with -fno-exceptions can lead to significant
space savings when statically linking libc++abi because we don't need
all the unwinding and demangling code.
When compiling with ASan, we already get a lot of overhead from the
instrumentation itself, when statically linking libc++abi, that overhead
is even larger.
Having the noexcept variant for ASan can help significantly, we've seen
more than 50% size reduction in our system image, which offsets the cost
of having to build another multilib.
Differential Revision: https://reviews.llvm.org/D64140
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365994
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Sat, 13 Jul 2019 06:27:35 +0000 (06:27 +0000)]
This reverts commit
632a36bfcfc8273c1861f04ff6758d863c47c784.
Some targets such as Python 2.7.16 still use VERSION in
their builds. Without VERSION defined, the source code
has syntax errors.
Reverting as it will probably break many other things.
Noticed by Sterling Augustine
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365992
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Sat, 13 Jul 2019 03:59:55 +0000 (03:59 +0000)]
Initialize the non-trivial C union bits I added to RecordDeclBitfields
in r365985
These bits weren't being initialized in the RecordDecl's constructor,
which probably caused test/Modules/stress1.cpp to fail on a couple of
bots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365989
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Sat, 13 Jul 2019 01:47:15 +0000 (01:47 +0000)]
[Sema] Diagnose default-initialization, destruction, and copying of
non-trivial C union types
This patch diagnoses uses of non-trivial C unions and structs/unions
containing non-trivial C unions in the following contexts, which require
default-initialization, destruction, or copying of the union objects,
instead of disallowing fields of non-trivial types in C unions, which is
what we currently do:
- function parameters.
- function returns.
- assignments.
- compound literals.
- block captures except capturing of `__block` variables by non-escaping
blocks.
- local and global variable definitions.
- lvalue-to-rvalue conversions of volatile types.
See the discussion in https://reviews.llvm.org/D62988 for more background.
rdar://problem/
50679094
Differential Revision: https://reviews.llvm.org/D63753
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365985
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Sat, 13 Jul 2019 00:47:58 +0000 (00:47 +0000)]
clang/test/Driver/fsanitize.c: Fix -fsanitize=vptr using default target
The default implementation of getSupportedSanitizers isn't able to turn
on the vptr sanitizer, and thus, any platform that runs this test will
fail with the error:
clang: error: unsupported option '-fsanitize=vptr' for target '<target>'
Patch by James Nagurne!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365981
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Korous [Sat, 13 Jul 2019 00:09:04 +0000 (00:09 +0000)]
[DirectoryWatcher][test][NFC] Add information to test failure reports
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365976
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam McCall [Fri, 12 Jul 2019 23:38:31 +0000 (23:38 +0000)]
Re-land [JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from parsed commands.
Use //net/dir like other test cases for windows compatibility
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365975
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Fri, 12 Jul 2019 22:29:44 +0000 (22:29 +0000)]
NFC: utils/perf-training: Python 3 compatibility for lit.cfg
The output of subprocess.check_output is now bytes. We need to decode it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365969
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Korous [Fri, 12 Jul 2019 22:25:17 +0000 (22:25 +0000)]
[DirectoryWatcher][NFC] Silence warnings in release build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365968
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Korous [Fri, 12 Jul 2019 22:11:43 +0000 (22:11 +0000)]
[DirectoryWatcher][linux] Fix use of uninitialized value
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365966
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Fri, 12 Jul 2019 21:45:08 +0000 (21:45 +0000)]
Remove __VERSION__
Summary:
It has been introduced in 2011 for gcc compat:
https://github.com/llvm-mirror/clang/commit/
ad1a4c6e89594e704775ddb6b036ac982fd68cad
it is probably time to remove it
Reviewers: rnk, dexonsmith
Reviewed By: rnk
Subscribers: dschuff, aheejin, fedor.sergeev, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64062
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365962
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 12 Jul 2019 20:44:57 +0000 (20:44 +0000)]
Revert driver: Don't warn about assembler flags being unused when not assembling
This reverts r365703 (git commit
101c1afdfd1c88f05da94c6fd317b489bb704f40)
and r365714.
This broke some autoconf-style assembler flags checks in the Linux
build:
https://github.com/ClangBuiltLinux/linux/issues/598
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365956
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Korous [Fri, 12 Jul 2019 20:34:10 +0000 (20:34 +0000)]
Reland [clang] DirectoryWatcher
This reverts commit
f561227d133224d2d6a5a016abe4be051fa75501.
- DirectoryWatcher
- Fix the build for platforms that don't have DW implementated.
- Fix the threading dependencies (thanks to compnerd).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365954
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Korous [Fri, 12 Jul 2019 19:54:36 +0000 (19:54 +0000)]
Revert "Reland [clang] DirectoryWatcher"
This reverts commit
fdcb7f47e783933e0af8a5fae91132269a208268.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365948
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Korous [Fri, 12 Jul 2019 19:47:55 +0000 (19:47 +0000)]
Reland [clang] DirectoryWatcher
This reverts commit
abce8c457dd3de6b156756e547cc0eefb7653c79.
+ Fix the build for platforms that don't have DW implementated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365947
91177308-0d34-0410-b5e6-
96231b3b80d8
Thomas Lively [Fri, 12 Jul 2019 18:23:13 +0000 (18:23 +0000)]
[WebAssembly] Make pthread imply bulk-memory, mutable-globals
Summary:
This paves the way for using passive segments in pthread builds, which
will make separate memory files unnecessary. Mutable globals are also
necessary for the upcoming implementation of TLS.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, jfb, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64586
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365935
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Fri, 12 Jul 2019 18:14:51 +0000 (18:14 +0000)]
[SystemZ] Add support for new cpu architecture - arch13
This patch series adds support for the next-generation arch13
CPU architecture to the SystemZ backend.
This includes:
- Basic support for the new processor and its features.
- Support for low-level builtins mapped to new LLVM intrinsics.
- New high-level intrinsics in vecintrin.h.
- Indicate support by defining __VEC__ == 10303.
Note: No currently available Z system supports the arch13
architecture. Once new systems become available, the
official system name will be added as supported -march name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365933
91177308-0d34-0410-b5e6-
96231b3b80d8
Shoaib Meenai [Fri, 12 Jul 2019 17:23:35 +0000 (17:23 +0000)]
Revert [clang-shlib] Fix clang-shlib for PRIVATE dependencies
This reverts r365825 (git commit
3173c60f96c3ccfc17d403a192ae58e720153c23)
This is breaking BUILD_SHARED_LIBS=ON builds. Reverting while I rethink it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365922
91177308-0d34-0410-b5e6-
96231b3b80d8
Vitaly Buka [Fri, 12 Jul 2019 17:21:55 +0000 (17:21 +0000)]
CodeGet: Init 32bit pointers with 0xFFFFFFFF
Summary:
Patch makes D63967 effective for 32bit platforms and improves pattern
initialization there. It cuts size of 32bit binary compiled with
-ftrivial-auto-var-init=pattern by 2% (3% with -Os).
Binary size change on CTMark, (with -fuse-ld=lld -Wl,--icf=all, similar results with default linker options)
```
master patch diff
Os pattern 7.
915580e+05 7.
698424e+05 -0.028387
O3 pattern 9.
953688e+05 9.
752952e+05 -0.019325
```
Zero vs Pattern on master
```
zero pattern diff
Os 7.
689712e+05 7.
915580e+05 0.031380
O3 9.
744796e+05 9.
953688e+05 0.021133
```
Zero vs Pattern with the patch
```
zero pattern diff
Os 7.
689712e+05 7.
698424e+05 0.000789
O3 9.
744796e+05 9.
752952e+05 0.000742
```
Reviewers: pcc, eugenis, glider, jfb
Reviewed By: jfb
Subscribers: hubert.reinterpretcast, dexonsmith, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64597
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365921
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Fri, 12 Jul 2019 16:53:57 +0000 (16:53 +0000)]
Dump actual line numbers when dumping the AST to JSON.
The "line" attribute is now the physical line within the source file for the location. A "presumedLine" attribute is printed when the presumed line number does not match the given source line number. We continue to not print repeated line information in subsequent source locations, but we track presumed and actual lines separately.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365919
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Stahl [Fri, 12 Jul 2019 15:56:18 +0000 (15:56 +0000)]
[clang-format][tests] Explicitly specify style in some tests
Summary: This fixes broken tests when doing an out-of-source build that picks up a random .clang-format on the file system due to the default "file" style.
Reviewers: djasper, klimek, MyDeveloperDay, krasimir
Reviewed By: MyDeveloperDay
Subscribers: lebedev.ri, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61001
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365909
91177308-0d34-0410-b5e6-
96231b3b80d8
Russell Gallop [Fri, 12 Jul 2019 15:15:56 +0000 (15:15 +0000)]
Revert "[JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from parsed commands."
New test is failing on Windows bot
This reverts commit
9c0391b36a76f8e3949588de3f44b7314c2318bf.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365906
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 12 Jul 2019 15:11:28 +0000 (15:11 +0000)]
cmake: Fix install of libclang-cpp.so when LLVM_INSTALL_TOOLCHAIN_ONLY=ON
Summary:
If CLANG_LINK_CLANG_DYLIB is also enabled, then this library needs to be
installed.
Fixes PR42575.
Reviewers: beanz, smeenai
Subscribers: mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64582
Conflicts:
clang/tools/clang-shlib/CMakeLists.txt
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365905
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 12 Jul 2019 14:40:18 +0000 (14:40 +0000)]
cmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macros
Summary:
This will simplify the macros by allowing us to remove the hard-coded
list of libraries that should be installed when
LLVM_INSTALL_TOOLCHAIN_ONLY is enabled.
Reviewers: beanz, smeenai
Reviewed By: beanz
Subscribers: aheejin, mehdi_amini, mgorny, steven_wu, dexonsmith, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D64580
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365902
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Fri, 12 Jul 2019 14:04:34 +0000 (14:04 +0000)]
Delete dead stores
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365901
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Fri, 12 Jul 2019 13:57:41 +0000 (13:57 +0000)]
Dump floating-point values as strings when dumping to JSON.
This fixes a bug where we would have an invalid JSON attribute (e.g., "value": inf). It also increases the precision of the values because they're not represented as approximate doubles with the host architecture's floating-point model.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365900
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Fri, 12 Jul 2019 13:21:58 +0000 (13:21 +0000)]
[Driver] Delete dead code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365898
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam McCall [Fri, 12 Jul 2019 10:11:40 +0000 (10:11 +0000)]
[JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from parsed commands.
Summary:
It's common to use compiler wrappers by setting CC="gomacc clang++".
This results in both args appearing in compile_commands.json, and clang's driver
can't handle this.
This patch attempts to recognize this pattern (by looking for well-known
wrappers) and dropping argv0 in this case.
It conservatively ignores other cases for now:
- wrappers with unknown names
- wrappers that accept -flags
- wrappers where the compiler to use is implied (usually cc or gcc)
This is done at the JSONCompilationDatabase level rather than somewhere more
fundamental, as (hopefully) this isn't a general conceptual problem, but a messy
aspect of the nature of the ecosystem around compile_commands.json.
i.e. compilation databases more tightly tied to the build system should not have
this problem.
Reviewers: phosek, klimek
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64297
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365887
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Fri, 12 Jul 2019 06:46:47 +0000 (06:46 +0000)]
[Driver] Delete --no-add-needed for RHEL7 or newer
This is really not needed. gcc driver doesn't add this option.
BTW, since binutils 2.22, --no-copy-dt-needed-entries (new name of
--no-add-needed) is the default.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365877
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Fri, 12 Jul 2019 05:59:28 +0000 (05:59 +0000)]
[test] Delete trailing spaces from YAML tests
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365873
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Fri, 12 Jul 2019 05:51:36 +0000 (05:51 +0000)]
test/Driver/fsanitize.c: delete -target x86_64-linux-gnu from tests that should always be available
Follow-up of D64317/r365587.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365872
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Fri, 12 Jul 2019 02:32:15 +0000 (02:32 +0000)]
[X86][PowerPC] Support -mlong-double-128
This patch makes the driver option -mlong-double-128 available for X86
and PowerPC. The CC1 option -mlong-double-128 is available on all targets
for users to test on unsupported targets.
On PowerPC, -mlong-double-128 uses the IBM extended double format
because we don't support -mabi=ieeelongdouble yet (D64283).
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D64277
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365866
91177308-0d34-0410-b5e6-
96231b3b80d8
Artem Dergachev [Fri, 12 Jul 2019 02:16:56 +0000 (02:16 +0000)]
NFC: Unforget a colon in a few CHECK: directives.
Differential Revision: https://reviews.llvm.org/D64526
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365863
91177308-0d34-0410-b5e6-
96231b3b80d8