]> granicus.if.org Git - clang/log
clang
5 years ago[Sema] Suppress additional warnings for C's zero initializer
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

5 years agoAllow for vendor prefixes in a list test
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

5 years agoTemporarily revert "add -fthinlto-index= option to clang-cl"
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

5 years agoTemporarily Revert "fix unnamed fiefield issue and add tests for __builtin_preserve_a...
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

5 years agoRevert "[NewPM] Port Sancov"
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

5 years ago[DirectoryWatcher][linux] Fix for older kernels
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

5 years agoadd -fthinlto-index= option to clang-cl
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

5 years ago[OpenCL] Make TableGen'd builtin tables and helper functions static
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

5 years ago[clang-fuzzer] Remove 'setUseOrcMCJITReplacement(false)' call.
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

5 years ago[DirectoryWatcher][test] Relax test assumptions
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

5 years ago[DirectoryWatcher][NFC][test] Add typedef for enum
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

5 years ago[clang] allow -fthinlto-index= without -x ir
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

5 years agoARM MTE stack sanitizer.
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

5 years agoUpdate __VERSION__ to remove the hardcoded 4.2.1 version
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

5 years agoUse a unique_ptr instead of manual memory management for LineTable
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

5 years agoUse a unique_ptr instead of manual memory management for CustomDiagInfo
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

5 years agoUse unique_ptr instead of manual delete in one place. No behavior change.
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

5 years agofix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic
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

5 years ago[OPENMP]Add support for analysis of if clauses.
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

5 years ago[OpenCL] Deduce addr space for pointee of dependent types in instantiation.
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

5 years agoFix uninitialized variable analyzer warning. NFCI.
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

5 years ago[ASTImporter] Using Lang_CXX14 in ASTImporterVisibilityTest.
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

5 years ago[OpenCL][PR41727] Prevent ICE on global dtors
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

5 years ago[PowerPC] Support -mabi=ieeelongdouble and -mabi=ibmlongdouble
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

5 years ago[TargetParser][ARM] Account dependencies when processing target features
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

5 years agoFix uninitialized variable analyzer warning. NFCI.
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

5 years agoSupport __seg_fs and __seg_gs on x86
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

5 years ago[clang][Driver][ARM] Favor -mfpu over default CPU features
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

5 years agoconsistency in the release notes
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

5 years ago[Driver] Simplify AddLibgcc
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

5 years ago[Driver] Simplify -lgcc & -lgcc_s
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

5 years agoRemove extra ';' to silent compiler warning.
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

5 years agoTemplate-related improvements to Visual Studio visualizers
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

5 years agoFix -Wdocumentation warning. NFCI.
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

5 years ago[CMake][Fuchsia] Define asan+noexcept multilib
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

5 years agoThis reverts commit 632a36bfcfc8273c1861f04ff6758d863c47c784.
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

5 years agoInitialize the non-trivial C union bits I added to RecordDeclBitfields
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

5 years ago[Sema] Diagnose default-initialization, destruction, and copying of
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

5 years agoclang/test/Driver/fsanitize.c: Fix -fsanitize=vptr using default target
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

5 years ago[DirectoryWatcher][test][NFC] Add information to test failure reports
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

5 years agoRe-land [JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from parsed...
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

5 years agoNFC: utils/perf-training: Python 3 compatibility for lit.cfg
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

5 years ago[DirectoryWatcher][NFC] Silence warnings in release build
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

5 years ago[DirectoryWatcher][linux] Fix use of uninitialized value
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

5 years agoRemove __VERSION__
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

5 years agoRevert driver: Don't warn about assembler flags being unused when not assembling
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

5 years agoReland [clang] DirectoryWatcher
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

5 years agoRevert "Reland [clang] DirectoryWatcher"
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

5 years agoReland [clang] DirectoryWatcher
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

5 years ago[WebAssembly] Make pthread imply bulk-memory, mutable-globals
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

5 years ago[SystemZ] Add support for new cpu architecture - arch13
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

5 years agoRevert [clang-shlib] Fix clang-shlib for PRIVATE dependencies
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

5 years agoCodeGet: Init 32bit pointers with 0xFFFFFFFF
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

5 years agoDump actual line numbers when dumping the AST to JSON.
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

5 years ago[clang-format][tests] Explicitly specify style in some tests
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

5 years agoRevert "[JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from parsed...
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

5 years agocmake: Fix install of libclang-cpp.so when LLVM_INSTALL_TOOLCHAIN_ONLY=ON
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

5 years agocmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macros
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

5 years agoDelete dead stores
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

5 years agoDump floating-point values as strings when dumping to JSON.
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

5 years ago[Driver] Delete dead code
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

5 years ago[JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from parsed commands.
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

5 years ago[Driver] Delete --no-add-needed for RHEL7 or newer
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

5 years ago[test] Delete trailing spaces from YAML tests
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

5 years agotest/Driver/fsanitize.c: delete -target x86_64-linux-gnu from tests that should alway...
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

5 years ago[X86][PowerPC] Support -mlong-double-128
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

5 years agoNFC: Unforget a colon in a few CHECK: directives.
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

5 years ago[PowerPC] Default to -fomit-frame-pointer when optimization is enabled
Fangrui Song [Fri, 12 Jul 2019 02:14:08 +0000 (02:14 +0000)]
[PowerPC] Default to -fomit-frame-pointer when optimization is enabled

NetBSD, Linux, CloudABI and Hurd already omit frame pointer for PowerPC.
Make it do so for other platforms.

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

5 years ago[analyzer] exploded-graph-rewriter: Improve source location dumps.
Artem Dergachev [Fri, 12 Jul 2019 02:10:33 +0000 (02:10 +0000)]
[analyzer] exploded-graph-rewriter: Improve source location dumps.

- Correctly display macro expansion and spelling locations.
- Use the same procedure to display location context call site locations.
- Display statement IDs for program points.

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

5 years ago[Driver] Refactor interaction between -f(no-)?omit-frame-pointer and -m(no-)?omit...
Fangrui Song [Fri, 12 Jul 2019 02:01:51 +0000 (02:01 +0000)]
[Driver] Refactor interaction between -f(no-)?omit-frame-pointer and -m(no-)?omit-leaf-frame-pointer

Use a tri-state enum to represent shouldUseFramePointer() and
shouldUseLeafFramePointer().

This simplifies the logic and fixes PR9825:
  -fno-omit-frame-pointer doesn't imply -mno-omit-leaf-frame-pointer.

and PR24003:
  /Oy- /O2 should not omit leaf frame pointer: this matches MSVC x86-32.
  (/Oy- is a no-op on MSVC x86-64.)

and:
  when CC1 option -mdisable-fp-elim if absent, -momit-leaf-frame-pointer
  can also be omitted.

The new behavior matches GCC:
  -fomit-frame-pointer wins over -mno-omit-leaf-frame-pointer
  -fno-omit-frame-pointer loses out to -momit-leaf-frame-pointer

The behavior makes lots of sense. We have 4 states:

- 00) leaf retained, non-leaf retained
- 01) leaf retained, non-leaf omitted  (this is invalid)
- 10) leaf omitted, non-leaf retained  (what -momit-leaf-frame-pointer was designed for)
- 11) leaf omitted, non-leaf omitted

"omit" options taking precedence over "no-omit" options is the only way
to make 3 valid states representable with -f(no-)?omit-frame-pointer and
-m(no-)?omit-leaf-pointer.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D64294

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

5 years agoHandle IntToPtr in isBytewiseValue
Vitaly Buka [Fri, 12 Jul 2019 01:42:03 +0000 (01:42 +0000)]
Handle IntToPtr in isBytewiseValue

Summary:
This helps with more efficient use of memset for pattern initialization

From @pcc prototype for -ftrivial-auto-var-init=pattern optimizations

Binary size change on CTMark, (with -fuse-ld=lld -Wl,--icf=all, similar results with default linker options)
```
                   master           patch      diff
Os           8.238864e+05    8.238864e+05       0.0
O3           1.054797e+06    1.054797e+06       0.0
Os zero      8.292384e+05    8.292384e+05       0.0
O3 zero      1.062626e+06    1.062626e+06       0.0
Os pattern   8.579712e+05    8.338048e+05 -0.030299
O3 pattern   1.090502e+06    1.067574e+06 -0.020481
```

Zero vs Pattern on master
```
               zero       pattern      diff
Os     8.292384e+05  8.579712e+05  0.036578
O3     1.062626e+06  1.090502e+06  0.025124
```

Zero vs Pattern with the patch
```
               zero       pattern      diff
Os     8.292384e+05  8.338048e+05  0.003333
O3     1.062626e+06  1.067574e+06  0.003193
```

Reviewers: pcc, eugenis

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D63967

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

5 years agoCodegen, NFC: 32bit test in auto-var-init.cpp
Vitaly Buka [Fri, 12 Jul 2019 01:36:11 +0000 (01:36 +0000)]
Codegen, NFC: 32bit test in auto-var-init.cpp

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

5 years agoRe-Revert Devirtualize destructor of final class.
Jordan Rupprecht [Fri, 12 Jul 2019 00:32:08 +0000 (00:32 +0000)]
Re-Revert Devirtualize destructor of final class.

This reverts r365509 (git commit d088720edad9c29ee0d622b5d69092e18a9ac0bd)

This is a second revert[1] due to failures in internal test cases (shared offline) found during more thorough testing.

[1] Original patch commited as r364100, reverted as r364359, recommitted as r365509

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

5 years ago[CMake][Fuchsia] Use RelWithDebInfo to build runtimes
Petr Hosek [Thu, 11 Jul 2019 23:49:39 +0000 (23:49 +0000)]
[CMake][Fuchsia] Use RelWithDebInfo to build runtimes

We want to preserve debug info in our runtimes to aid symbolization and
debugging; for shared libraries this will be stripped away during
install-stripped step and distributed via .build-id, for static archives
it's part of the archive and it's a responsibility of the consumer to
strip it away in the final binary if not needed.

Differential Revision: https://reviews.llvm.org/D64605

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

5 years ago[NewPM] Port Sancov
Leonard Chan [Thu, 11 Jul 2019 22:35:40 +0000 (22:35 +0000)]
[NewPM] Port Sancov

This patch contains a port of SanitizerCoverage to the new pass manager. This one's a bit hefty.

Changes:

- Split SanitizerCoverageModule into 2 SanitizerCoverage for passing over
  functions and ModuleSanitizerCoverage for passing over modules.
- ModuleSanitizerCoverage exists for adding 2 module level calls to initialization
  functions but only if there's a function that was instrumented by sancov.
- Added legacy and new PM wrapper classes that own instances of the 2 new classes.
- Update llvm tests and add clang tests.

Differential Revision: https://reviews.llvm.org/D62888

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

5 years agoCodeGen: Suppress c++ warnings in test
Vitaly Buka [Thu, 11 Jul 2019 21:59:09 +0000 (21:59 +0000)]
CodeGen: Suppress c++ warnings in test

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

5 years agoFix a Python3 compatibility error
Azharuddin Mohammed [Thu, 11 Jul 2019 21:45:48 +0000 (21:45 +0000)]
Fix a Python3 compatibility error

  File "clang/test/lit.cfg.py", line 186, in <module>
    config.available_features.add('macos-sdk-' + macOSSDKVersion)
TypeError: must be str, not bytes

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

5 years agoRename libclang_shared to libclang-cpp
Sylvestre Ledru [Thu, 11 Jul 2019 21:42:55 +0000 (21:42 +0000)]
Rename libclang_shared to libclang-cpp

Summary: Fix bug 42475

Reviewers: beanz, tstellar

Reviewed By: beanz

Subscribers: kimgr, mgorny, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64278

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

5 years ago[analyzer] exploded-graph-rewriter: Fix filenames in program point.
Artem Dergachev [Thu, 11 Jul 2019 21:27:42 +0000 (21:27 +0000)]
[analyzer] exploded-graph-rewriter: Fix filenames in program point.

Fix a typo in JSON field name.

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

5 years ago[clang-shlib] Fix clang-shlib for PRIVATE dependencies
Shoaib Meenai [Thu, 11 Jul 2019 21:20:38 +0000 (21:20 +0000)]
[clang-shlib] Fix clang-shlib for PRIVATE dependencies

Any static library with a PRIVATE dependency ends up with a
$<LINK_ONLY:...> generator expression in its INTERFACE_LINK_LIBRARIES,
which won't be evaluated by the $<TARGET_PROPERTY:...>, so we end up
with an unevaluated generator expression in the generated build file and
Ninja chokes on the dollar sign. Just use the static library directly
for its dependencies instead of trying to propagate dependencies
manually.

Differential Revision: https://reviews.llvm.org/D64579

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

5 years agoCodeGen, NFC: Test for auto-init for 32bit pointers
Vitaly Buka [Thu, 11 Jul 2019 20:51:59 +0000 (20:51 +0000)]
CodeGen, NFC: Test for auto-init for 32bit pointers

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

5 years ago[OPENMP]Improve handling of analysis of unsupported VLAs in reductions.
Alexey Bataev [Thu, 11 Jul 2019 20:35:31 +0000 (20:35 +0000)]
[OPENMP]Improve handling of analysis of unsupported VLAs in reductions.

Fixed the processing of the unsupported VLAs in the reduction clauses.
Used targetDiag if the diagnostics can be delayed and emit it
immediately if the target does not support VLAs and we're parsing target
directive with the reduction clauses.

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

5 years agoRevert "[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC"
Vedant Kumar [Thu, 11 Jul 2019 19:28:07 +0000 (19:28 +0000)]
Revert "[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC"

This reverts commit 1af41074445229fea66b99710a850e5f42ecfa95.

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

5 years ago[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC
Vedant Kumar [Thu, 11 Jul 2019 19:11:46 +0000 (19:11 +0000)]
[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC

Replace a `llvm::Function *` parameter with a bool, which seems harder
to set to the wrong value by accident.

Differential Revision: https://reviews.llvm.org/D64540

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

5 years ago[Driver] -noprofilelib flag
Petr Hosek [Thu, 11 Jul 2019 19:06:38 +0000 (19:06 +0000)]
[Driver] -noprofilelib flag

This flag is analoguous to other flags like -nostdlib or -nolibc
and could be used to disable linking of profile runtime library.
This is useful in certain environments like kernel, where profile
instrumentation is still desirable, but we cannot use the standard
runtime library.

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

5 years ago[HIP] Add GPU arch gfx1010, gfx1011, and gfx1012
Yaxun Liu [Thu, 11 Jul 2019 17:50:09 +0000 (17:50 +0000)]
[HIP] Add GPU arch gfx1010, gfx1011, and gfx1012

Differential Revision: https://reviews.llvm.org/D64364

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

5 years ago[CodeGen] NVPTX: Switch from atomic.load.add.f32 to atomicrmw fadd
Benjamin Kramer [Thu, 11 Jul 2019 17:44:11 +0000 (17:44 +0000)]
[CodeGen] NVPTX: Switch from atomic.load.add.f32 to atomicrmw fadd

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

5 years ago[Docs] Add standardized header links to analyzer doc
Nathan Huckleberry [Thu, 11 Jul 2019 17:12:05 +0000 (17:12 +0000)]
[Docs] Add standardized header links to analyzer doc

Summary:
Header links should have some standard form so clang tidy
docs can easily reference them. The form is as follows.

Start with the analyzer full name including packages.
Replace all periods with dashes and lowercase everything.

Ex: core.CallAndMessage -> core-callandmessage

Reviewers: JonasToth, aaron.ballman, NoQ, Szelethus

Reviewed By: aaron.ballman, Szelethus

Subscribers: nickdesaulniers, lebedev.ri, baloghadamsoftware, mgrang, a.sidorin, Szelethus, jfb, donat.nagy, dkrupp, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64543

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

5 years agoFix a few 'no newline at end of file' warnings that Xcode emits
Nico Weber [Thu, 11 Jul 2019 15:26:45 +0000 (15:26 +0000)]
Fix a few 'no newline at end of file' warnings that Xcode emits

(Xcode even has a snazzy "Fix" button, but clicking that inserts two
newlines. So close!)

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

5 years ago[OPENMP]Initial fix PR42392: Improve -Wuninitialized warnings for OpenMP programs.
Alexey Bataev [Thu, 11 Jul 2019 14:54:17 +0000 (14:54 +0000)]
[OPENMP]Initial fix PR42392: Improve -Wuninitialized warnings for OpenMP programs.

Summary:
Some OpenMP clauses rely on the values of the variables. If the variable
is not initialized and used in OpenMP clauses that depend on the
variables values, it should be reported that the uninitialized variable
is used in the OpenMP clause expression.
This patch adds initial processing for uninitialized variables in OpenMP
constructs. Currently, it checks for use of the uninitialized variables
in the structured blocks.

Reviewers: NoQ, Szelethus, dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet

Subscribers: rnkovacs, guansong, jfb, jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64356

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

5 years agoAdded mapping for pointers captured in Lambdas in OpenMP target regions,
Alexey Bataev [Thu, 11 Jul 2019 13:54:26 +0000 (13:54 +0000)]
Added mapping for pointers captured in Lambdas in OpenMP target regions,
by David Truby.

Summary:
This adds a zero length array section mapping for each pointer captured by a lambda that is used in a target region, as per section 2.19.7.1 of the OpenMP 5 specification.

Reviewers: ABataev

Reviewed By: ABataev

Subscribers: guansong, jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64558

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

5 years agoRevert Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the...
Haojian Wu [Thu, 11 Jul 2019 08:54:28 +0000 (08:54 +0000)]
Revert Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the Option class."

This reverts r365675 (git commit 43d75f977853c3ec891a440c362b2df183a211b5)

The patch causes a crash in SupportTests (CommandLineTest.AliasesWithArguments).

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

5 years agoIncrease the number of parser diagnostics.
Richard Trieu [Thu, 11 Jul 2019 02:54:15 +0000 (02:54 +0000)]
Increase the number of parser diagnostics.

The reserved range for parser diagnostics is getting close to being filled,
so increase the space for them.

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

5 years agoclang-cl: Remove -O0 option
Nico Weber [Thu, 11 Jul 2019 01:18:05 +0000 (01:18 +0000)]
clang-cl: Remove -O0 option

cl.exe doesn't understand it; there's /Od instead. See also the review
thread for r229575.

Update lots of compiler-rt tests to use -Od instead of -O0.
Ran `rg -l 'clang_cl.*O0' compiler-rt/test/ | xargs sed -i -c 's/-O0/-Od/'`

Differential Revision: https://reviews.llvm.org/D64506

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

5 years agoVarious minor tweaks to CLCompatOptions.td
Nico Weber [Thu, 11 Jul 2019 01:13:38 +0000 (01:13 +0000)]
Various minor tweaks to CLCompatOptions.td

- Add back indentation I accidentally removed in r364901
- Wrap two lines to 80 cols
- Slightly tighten up help text for several flags
- Consistently use "Do not" instead of "Don't"
- Make every option description start with a verb
- Use "Set" instead of "Specify"
- Mark default values of options more consistently
- Remove text about "/Zi" not producing PDBs since it's confusing
  for people not intimately familiar with the implementation of
  the normal PDB pipeline. /Zi lets the linker produce PDBs, which
  is what most users want.
- Consistently use "file" over "filename" in meta var names,
  consistently use "file name" over "filename" in text
- Make all output setting options have consistent language

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

5 years ago[CGDebugInfo] Fix -femit-debug-entry-values crash on os_log_helpers
Vedant Kumar [Thu, 11 Jul 2019 00:09:16 +0000 (00:09 +0000)]
[CGDebugInfo] Fix -femit-debug-entry-values crash on os_log_helpers

An os_log_helper FunctionDecl may not have a body. Ignore these for the
purposes of debug entry value emission.

Fixes an assertion failure seen in a stage2 build of clang:

Assertion failed: (FD->hasBody() && "Functions must have body here"),
function analyzeParametersModification

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

5 years agoAttempt to fix bots after r365703
Nico Weber [Wed, 10 Jul 2019 23:50:16 +0000 (23:50 +0000)]
Attempt to fix bots after r365703

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

5 years agoNFC: Pass DataLayout into isBytewiseValue
Vitaly Buka [Wed, 10 Jul 2019 22:53:52 +0000 (22:53 +0000)]
NFC: Pass DataLayout into isBytewiseValue

Summary:
We will need to handle IntToPtr which I will submit in a separate patch as it's
not going to be NFC.

Reviewers: eugenis, pcc

Reviewed By: eugenis

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D63940

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

5 years agoNFC: Convert large lambda into method
Vitaly Buka [Wed, 10 Jul 2019 22:53:50 +0000 (22:53 +0000)]
NFC: Convert large lambda into method

Reviewers: pcc, eugenis

Reviewed By: eugenis

Subscribers: cfe-commits, lldb-commits

Tags: #clang, #lldb

Differential Revision: https://reviews.llvm.org/D63854

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

5 years agoGodeGen, NFC: Add test to track emitStoresForConstant behavior
Vitaly Buka [Wed, 10 Jul 2019 22:47:07 +0000 (22:47 +0000)]
GodeGen, NFC: Add test to track emitStoresForConstant behavior

Reviewers: eugenis, pcc

Reviewed By: eugenis

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64385

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