]> granicus.if.org Git - clang/log
clang
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

5 years agodriver: Don't warn about assembler flags being unused when not assembling
Nico Weber [Wed, 10 Jul 2019 22:29:35 +0000 (22:29 +0000)]
driver: Don't warn about assembler flags being unused when not assembling

clang currently warns when passing flags for the assembler (e.g.
-Wa,-mbig-obj) to an invocation that doesn't run the assembler (e.g.
-E).

At first sight, that makes sense -- the flag really is unused. But many
other flags don't have an effect if no assembler runs (e.g.
-fno-integrated-as, -ffunction-sections, and many others), and those
currently don't warn. So this seems more like a side effect of how
CollectArgsForIntegratedAssembler() is implemented than like an
intentional feature.

Since it's a bit inconvenient when debugging builds and adding -E,
always call CollectArgsForIntegratedAssembler() to make sure assembler
args always get claimed. Currently, this affects only these flags:
-mincremental-linker-compatible, -mimplicit-it= (on ARM), -Wa, -Xassembler

It does have the side effect that assembler options now need to be valid
even if -E is passed. Previously, `-Wa,-mbig-obj` would error for
non-coff output only if the assembler ran, now it always errors. This
too makes assembler flags more consistent with all the other flags and
seems like a progression.

Fixes PR42066.

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

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

5 years ago[clang-scan-deps] Dependency directives source minimizer:
Alex Lorenz [Wed, 10 Jul 2019 22:00:59 +0000 (22:00 +0000)]
[clang-scan-deps] Dependency directives source minimizer:
single quotes are not digit separators after a valid character literal prefix

The single quote character can act as a c++ digit separator.
However, the minimizer shouldn't treat it as such when it's actually following
a valid character literal prefix, like L, U, u, or u8.

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

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

5 years ago[Concepts] Concept definitions (D40381)
Saar Raz [Wed, 10 Jul 2019 21:25:49 +0000 (21:25 +0000)]
[Concepts] Concept definitions (D40381)

First in a series of patches to land C++2a Concepts support.
This patch adds AST and parsing support for concept-declarations.

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

5 years agoMy first test commit.
Saar Raz [Wed, 10 Jul 2019 20:01:44 +0000 (20:01 +0000)]
My first test commit.

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

5 years ago[OPENMP]Remove not used check line from the test, NFC.
Alexey Bataev [Wed, 10 Jul 2019 19:30:25 +0000 (19:30 +0000)]
[OPENMP]Remove not used check line from the test, NFC.

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

5 years agoUpdate libc++ include path detection to use VFS on Linux
Julie Hockett [Wed, 10 Jul 2019 18:41:35 +0000 (18:41 +0000)]
Update libc++ include path detection to use VFS on Linux

The DetectLibcxxIncludePath function had been using
llvm::sys::fs::directory_iterator, and this updates it to use
llvm::vfs::directory_iterator.

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

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

5 years agoRecommit "[CommandLine] Remove OptionCategory and SubCommand caches from the Option...
Don Hinton [Wed, 10 Jul 2019 17:57:05 +0000 (17:57 +0000)]
Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the Option class."

Previously reverted in 364141 due to buildbot breakage, and fixed here
by making GeneralCategory global a ManagedStatic.

Summary:
This change processes `OptionCategory`s and `SubCommand`s as they
are seen instead of caching them in the Option class and processing
them later.  Doing so simplifies the work needed to be done by the Global
parser and significantly reduces the size of the Option class to a mere 64
bytes.

Removing  the `OptionCategory` cache saved 24 bytes, and removing
the `SubCommand` cache saved an additional 48 bytes, for a total of a
72 byte reduction.

Reviewed By: serge-sans-paille

Tags: #llvm, #clang

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

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

5 years ago[X86] Change the IR sequence for _mm_storeh_pi and _mm_storel_pi to perform the store...
Craig Topper [Wed, 10 Jul 2019 17:11:29 +0000 (17:11 +0000)]
[X86] Change the IR sequence for _mm_storeh_pi and _mm_storel_pi to perform the store as a <2 x float> instead of i64.

This is similar to what we do for loadl_pi and loadh_pi.

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

5 years ago[X86] Add guards to some of the x86 intrinsic tests to skip 64-bit mode only intrinsi...
Craig Topper [Wed, 10 Jul 2019 17:11:23 +0000 (17:11 +0000)]
[X86] Add guards to some of the x86 intrinsic tests to skip 64-bit mode only intrinsics when compiled for 32-bit mode.

All the command lines are for 64-bit mode, but sometimes I compile
the tests in 32-bit mode to see what assembly we get and we need
to skip these to do that.

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

5 years ago[clang] Preserve names of addrspacecast'ed values.
Vyacheslav Zakharin [Wed, 10 Jul 2019 17:10:05 +0000 (17:10 +0000)]
[clang] Preserve names of addrspacecast'ed values.

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

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

5 years ago[AMDGPU] Increased the number of implicit argument bytes for both OpenCL and HIP...
Christudasan Devadasan [Wed, 10 Jul 2019 15:10:08 +0000 (15:10 +0000)]
[AMDGPU] Increased the number of implicit argument bytes for both OpenCL and HIP (CLANG).

To enable a new implicit kernel argument,
increased the number of argument bytes from 48 to 56.

Reviewed By: yaxunl

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

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

5 years ago[analyzer]Add user docs rst
Gabor Marton [Wed, 10 Jul 2019 14:49:53 +0000 (14:49 +0000)]
[analyzer]Add user docs rst

Summary:
Add user documentation page. This is an empty page atm, later patches will add
the specific user documentatoins.

Reviewers: dkrupp

Subscribers: whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, gamesh411, Charusso, cfe-commits

Tags: #clang

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

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

5 years agoRemove two unused member variables.
Nico Weber [Wed, 10 Jul 2019 14:49:36 +0000 (14:49 +0000)]
Remove two unused member variables.

They were added over 10 years ago in r66575 and have never been used as
far as I can tell.

(r67087 added similar fields to Compilation, and those are used.)

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

5 years agoLoop pragma parsing. NFC.
Sjoerd Meijer [Wed, 10 Jul 2019 13:34:57 +0000 (13:34 +0000)]
Loop pragma parsing. NFC.

I would like to add some pragma handling here, but couldn't resist a little NFC
and tidy up first.

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

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

5 years ago[AArch64] Fix vector vuqadd intrinsics operands
Diogo N. Sampaio [Wed, 10 Jul 2019 09:58:51 +0000 (09:58 +0000)]
[AArch64] Fix vector vuqadd intrinsics operands

Summary:
Change the vuqadd vector instrinsics to have the second argument as unsigned values, not signed,
accordingly to https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics

Reviewers: LukeCheeseman, ostannard

Reviewed By: ostannard

Subscribers: javed.absar, kristof.beyls, cfe-commits

Tags: #clang

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

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

5 years ago[NFC][AArch64] Fix vector vsqadd intrinsics operands
Diogo N. Sampaio [Wed, 10 Jul 2019 09:58:03 +0000 (09:58 +0000)]
[NFC][AArch64] Fix vector vsqadd intrinsics operands

Summary:
Change the vsqadd vector instrinsics to have the second argument as signed values, not unsigned,
accordingly to https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics

Reviewers: LukeCheeseman, ostannard

Reviewed By: ostannard

Subscribers: javed.absar, kristof.beyls, cfe-commits

Tags: #clang

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

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

5 years ago[Syntax] Add assertion to catch invalid tokens early. NFC
Ilya Biryukov [Wed, 10 Jul 2019 08:24:42 +0000 (08:24 +0000)]
[Syntax] Add assertion to catch invalid tokens early. NFC

To help with identifiying root cause of a crash we are seeing.

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

5 years ago[NFC][AArch64] Fix vector vqtb[lx][1-4]_s8 operand
Diogo N. Sampaio [Wed, 10 Jul 2019 08:16:49 +0000 (08:16 +0000)]
[NFC][AArch64] Fix vector vqtb[lx][1-4]_s8 operand

Summary:
Change the vqtb[lx][1-4]_s8 instrinsics to have the last argument as vector of unsigned valuse, not
signed, accordingly to https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics

Reviewers: LukeCheeseman, DavidSpickett

Reviewed By: DavidSpickett

Subscribers: DavidSpickett, javed.absar, kristof.beyls, cfe-commits

Tags: #clang

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

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

5 years ago[analyzer] CastValueChecker: Remove a dump()
Csaba Dabis [Wed, 10 Jul 2019 00:50:01 +0000 (00:50 +0000)]
[analyzer] CastValueChecker: Remove a dump()

Summary: Fix a nit.

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

5 years ago[Driver] Add float-divide-by-zero back to supported sanitizers after D63793/rC365272
Fangrui Song [Wed, 10 Jul 2019 00:30:02 +0000 (00:30 +0000)]
[Driver] Add float-divide-by-zero back to supported sanitizers after D63793/rC365272

D63793 removed float-divide-by-zero from the "undefined" set but it
failed to add it to getSupportedSanitizers(), thus the sanitizer is
rejected by the driver:

    clang-9: error: unsupported option '-fsanitize=float-divide-by-zero' for target 'x86_64-unknown-linux-gnu'

Also, add SanitizerMask::FloatDivideByZero to a few other masks to make -fsanitize-trap, -fsanitize-recover, -fsanitize-minimal-runtime and -fsanitize-coverage work.

Reviewed By: rsmith, vitalybuka

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

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

5 years ago[analyzer] CastValueChecker: Model casts
Csaba Dabis [Wed, 10 Jul 2019 00:20:03 +0000 (00:20 +0000)]
[analyzer] CastValueChecker: Model casts

Summary:
It models the LLVM casts:
- `cast<>`
- `dyn_cast<>`
- `cast_or_null<>`
- `dyn_cast_or_null<>`

It has a very basic support without checking the `classof()` function.

(It reapplies the reverted 'llvm-svn: 365582' patch with proper test file.)

Reviewed By: NoQ

Tags: #clang

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

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

5 years agoRevert "[analyzer] CastValueChecker: Model casts"
Csaba Dabis [Tue, 9 Jul 2019 23:47:09 +0000 (23:47 +0000)]
Revert "[analyzer] CastValueChecker: Model casts"

This reverts commit 27cf6664437efd640bb6db5594bafcce68fa2854.

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

5 years ago[analyzer] CastValueChecker: Model casts
Csaba Dabis [Tue, 9 Jul 2019 23:33:23 +0000 (23:33 +0000)]
[analyzer] CastValueChecker: Model casts

Summary:
It models the LLVM casts:
- `cast<>`
- `dyn_cast<>`
- `cast_or_null<>`
- `dyn_cast_or_null<>`

It has a very basic support without checking the `classof()` function.

Reviewed By: NoQ

Tags: #clang

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

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

5 years agoRevert [clang] DirectoryWatcher
Reid Kleckner [Tue, 9 Jul 2019 23:22:01 +0000 (23:22 +0000)]
Revert [clang] DirectoryWatcher

This reverts r365574 (git commit 31babea94a3ed38a140540f2252cf043dacec1f7)

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

5 years ago[MS] Treat ignored explicit calling conventions as an explicit __cdecl
Reid Kleckner [Tue, 9 Jul 2019 23:17:43 +0000 (23:17 +0000)]
[MS] Treat ignored explicit calling conventions as an explicit __cdecl

The CCCR_Ignore action is only used for Microsoft calling conventions,
mainly because MSVC does not warn when a calling convention would be
ignored by the current target. This behavior is actually somewhat
important, since windows.h uses WINAPI (which expands to __stdcall)
widely. This distinction didn't matter much before the introduction of
__vectorcall to x64 and the ability to make that the default calling
convention with /Gv. Now, we can't just ignore __stdcall for x64, we
have to treat it as an explicit __cdecl annotation.

Fixes PR42531

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

5 years ago[clang] DirectoryWatcher
Jan Korous [Tue, 9 Jul 2019 22:44:48 +0000 (22:44 +0000)]
[clang] DirectoryWatcher

Asynchronously monitors specified directory for changes and passes notifications to provided callback.

Dependency for index-while-building.

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

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

5 years agoXFAIL clang/test/Headers/max_align.c on i686
Andus Yu [Tue, 9 Jul 2019 21:06:34 +0000 (21:06 +0000)]
XFAIL clang/test/Headers/max_align.c on i686

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

5 years agoUse the Itanium C++ ABI for the pipe_builtin.cl test
Reid Kleckner [Tue, 9 Jul 2019 21:02:06 +0000 (21:02 +0000)]
Use the Itanium C++ ABI for the pipe_builtin.cl test

Certain OpenCL constructs cannot yet be mangled in the MS C++ ABI.
Add a FIXME for it if anyone cares to implement it.

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

5 years agoDe-templatize non-dependent VS macro logic, NFC
Reid Kleckner [Tue, 9 Jul 2019 20:57:28 +0000 (20:57 +0000)]
De-templatize non-dependent VS macro logic, NFC

These macro definitions don't depend on the template parameter, so they
don't need to be part of the template. Move them to a .cpp file.

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

5 years ago[CXX] Exercise all paths through these tests.
Paul Robinson [Tue, 9 Jul 2019 20:49:07 +0000 (20:49 +0000)]
[CXX] Exercise all paths through these tests.

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

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

5 years agohwasan: Improve precision of checks using short granule tags.
Peter Collingbourne [Tue, 9 Jul 2019 20:22:36 +0000 (20:22 +0000)]
hwasan: Improve precision of checks using short granule tags.

A short granule is a granule of size between 1 and `TG-1` bytes. The size
of a short granule is stored at the location in shadow memory where the
granule's tag is normally stored, while the granule's actual tag is stored
in the last byte of the granule. This means that in order to verify that a
pointer tag matches a memory tag, HWASAN must check for two possibilities:

* the pointer tag is equal to the memory tag in shadow memory, or
* the shadow memory tag is actually a short granule size, the value being loaded
  is in bounds of the granule and the pointer tag is equal to the last byte of
  the granule.

Pointer tags between 1 to `TG-1` are possible and are as likely as any other
tag. This means that these tags in memory have two interpretations: the full
tag interpretation (where the pointer tag is between 1 and `TG-1` and the
last byte of the granule is ordinary data) and the short tag interpretation
(where the pointer tag is stored in the granule).

When HWASAN detects an error near a memory tag between 1 and `TG-1`, it
will show both the memory tag and the last byte of the granule. Currently,
it is up to the user to disambiguate the two possibilities.

Because this functionality obsoletes the right aligned heap feature of
the HWASAN memory allocator (and because we can no longer easily test
it), the feature is removed.

Also update the documentation to cover both short granule tags and
outlined checks.

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

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

5 years ago[OpenMP] Simplify getFloatTypeSemantics
Fangrui Song [Tue, 9 Jul 2019 19:36:22 +0000 (19:36 +0000)]
[OpenMP] Simplify getFloatTypeSemantics

When the float point representations are the same on the host and on the target device,
(`&Target->getLongDoubleFormat() == &AuxTarget->getLongDoubleFormat()`),
we can just use `AuxTarget->getLongDoubleFormat()`.

Reviewed By: ABataev

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

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

5 years ago[AMDGPU] gfx908 clang target
Stanislav Mekhanoshin [Tue, 9 Jul 2019 18:19:00 +0000 (18:19 +0000)]
[AMDGPU] gfx908 clang target

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

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

5 years ago[ObjC] Add a warning for implicit conversions of a constant non-boolean value to...
Erik Pilkington [Tue, 9 Jul 2019 17:29:40 +0000 (17:29 +0000)]
[ObjC] Add a warning for implicit conversions of a constant non-boolean value to BOOL

rdar://51954400

Differential revision: https://reviews.llvm.org/D63912

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

5 years agoRevert Revert Devirtualize destructor of final class.
Hiroshi Yamauchi [Tue, 9 Jul 2019 15:57:29 +0000 (15:57 +0000)]
Revert Revert Devirtualize destructor of final class.

Revert r364359 and recommit r364100.

r364100 was reverted as r364359 due to an internal test failure, but it was a
false alarm.

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

5 years ago[OpenCL][Sema] Improve address space support for blocks
Marco Antognini [Tue, 9 Jul 2019 15:04:27 +0000 (15:04 +0000)]
[OpenCL][Sema] Improve address space support for blocks

Summary:
This patch ensures that the following code is compiled identically with
-cl-std=CL2.0 and -fblocks -cl-std=c++.

    kernel void test(void) {
      void (^const block_A)(void) = ^{
        return;
      };
    }

A new test is not added because cl20-device-side-enqueue.cl will cover
this once blocks are further improved for C++ for OpenCL.

The changes to Sema::PerformImplicitConversion are based on
the parts of Sema::CheckAssignmentConstraints on block pointer
conversions.

Reviewers: rjmccall, Anastasia

Subscribers: yaxunl, cfe-commits

Tags: #clang

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

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

5 years ago[OpenCL][Sema] Fix builtin rewriting
Marco Antognini [Tue, 9 Jul 2019 15:04:23 +0000 (15:04 +0000)]
[OpenCL][Sema] Fix builtin rewriting

This patch ensures built-in functions are rewritten using the proper
parent declaration.

Existing tests are modified to run in C++ mode to ensure the
functionality works also with C++ for OpenCL while not increasing the
testing runtime.

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

5 years agoIgnore trailing NullStmts in StmtExprs for GCC compatibility.
Aaron Ballman [Tue, 9 Jul 2019 15:02:07 +0000 (15:02 +0000)]
Ignore trailing NullStmts in StmtExprs for GCC compatibility.

Ignore trailing NullStmts in compound expressions when determining the result type and value. This is to match the GCC behavior which ignores semicolons at the end of compound expressions.

Patch by Dominic Ferreira.

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

5 years ago[libclang] Fix hang in release / assertion in debug when evaluating value-dependent...
Emilio Cobos Alvarez [Tue, 9 Jul 2019 14:27:01 +0000 (14:27 +0000)]
[libclang] Fix hang in release / assertion in debug when evaluating value-dependent types.

Expression evaluator doesn't work in value-dependent types, so ensure that the
precondition it asserts holds.

This fixes https://bugs.llvm.org/show_bug.cgi?id=42532

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

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

5 years ago[OPENMP]Fix the float point semantics handling on the device.
Alexey Bataev [Tue, 9 Jul 2019 14:09:53 +0000 (14:09 +0000)]
[OPENMP]Fix the float point semantics handling on the device.

The device should use the same float point representation as the host.
Previous patch fixed the handling of the sizes of the float point types,
but did not fixed the fp semantics. This patch makes target device to
use the host fp semantics. this is required for the correct data
transfer between host and device and correct codegen.

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

5 years ago[ItaniumMangle] Refactor long double/__float128 mangling and fix the mangled code
Fangrui Song [Tue, 9 Jul 2019 13:32:26 +0000 (13:32 +0000)]
[ItaniumMangle] Refactor long double/__float128 mangling and fix the mangled code

In gcc PowerPC, long double has 3 mangling schemes:

-mlong-double-64: `e`
-mlong-double-128 -mabi=ibmlongdouble: `g`
-mlong-double-128 -mabi=ieeelongdouble: `u9__ieee128` (gcc <= 8.1: `U10__float128`)

The current useFloat128ManglingForLongDouble() bisection is not suitable
when we support -mlong-double-128 in clang (D64277). Replace
useFloat128ManglingForLongDouble() with getLongDoubleMangling() and
getFloat128Mangling() to allow 3 mangling schemes.

I also deleted the `getTriple().isOSBinFormatELF()` check (the Darwin
support has gone: https://reviews.llvm.org/D50988).

For x86, change the mangled code of __float128 from `U10__float128` to `g`. `U10__float128` was wrongly copied from PowerPC.
The test will be added to `test/CodeGen/x86-long-double.cpp` in D64277.

Reviewed By: erichkeane

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

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

5 years ago[Syntax] Move roles into a separate enum
Ilya Biryukov [Tue, 9 Jul 2019 13:31:43 +0000 (13:31 +0000)]
[Syntax] Move roles into a separate enum

To align with reviewer's suggestions.

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

5 years ago[NFC] [X86] Fix scan-build complaining
Pengfei Wang [Tue, 9 Jul 2019 12:41:12 +0000 (12:41 +0000)]
[NFC] [X86] Fix scan-build complaining

Summary:
Remove unused variable. This fixes bug:
https://bugs.llvm.org/show_bug.cgi?id=42526

Signed-off-by: pengfei <pengfei.wang@intel.com>
Reviewers: RKSimon, xiangzhangllvm, craig.topper

Subscribers: cfe-commits

Tags: #clang

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

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

5 years agoReland r365355: [Syntax] Introduce syntax trees
Ilya Biryukov [Tue, 9 Jul 2019 11:32:13 +0000 (11:32 +0000)]
Reland r365355: [Syntax] Introduce syntax trees

With a fix to a PS4 buildbot crash.

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

5 years agoRevert rL365355 : [Syntax] Introduce syntax trees
Simon Pilgrim [Tue, 9 Jul 2019 11:26:35 +0000 (11:26 +0000)]
Revert rL365355 : [Syntax] Introduce syntax trees

Summary:
A tooling-focused alternative to the AST. This commit focuses on the
memory-management strategy and the structure of the AST.

More to follow later:
  - Operations to mutate the syntax trees and corresponding textual
    replacements.
  - Mapping between clang AST nodes and syntax tree nodes.
  - More node types corresponding to the language constructs.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: llvm-commits, mgorny, cfe-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D61637
........
Fixes buildbots which were crashing on SyntaxTests.exe

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

5 years ago[ASTImporter] Added visibility context check for EnumDecl.
Balazs Keri [Tue, 9 Jul 2019 11:08:18 +0000 (11:08 +0000)]
[ASTImporter] Added visibility context check for EnumDecl.

Summary:
ASTImporter makes now difference between enums with same name in different translation
units if these are not visible outside.
("Scoped enums" are not handled yet.)

Reviewers: martong, a.sidorin, shafik, a_sidorin

Reviewed By: a_sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

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

5 years agoRetire VS2015 Support
Simon Pilgrim [Tue, 9 Jul 2019 10:12:37 +0000 (10:12 +0000)]
Retire VS2015 Support

As proposed here: https://lists.llvm.org/pipermail/llvm-dev/2019-June/133147.html

This patch raises the minimum supported version to build LLVM/Clang to Visual Studio 2017.

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

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

5 years agoRemove trailing whitespaces in the Language Extensions doc
Sylvestre Ledru [Tue, 9 Jul 2019 08:50:17 +0000 (08:50 +0000)]
Remove trailing whitespaces in the Language Extensions doc

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

5 years agoAdd AlignConsecutiveMacros to the clang release notes
Sylvestre Ledru [Tue, 9 Jul 2019 08:45:55 +0000 (08:45 +0000)]
Add AlignConsecutiveMacros to the clang release notes

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

5 years ago[BPF] Preserve debuginfo array/union/struct type/access index
Yonghong Song [Tue, 9 Jul 2019 04:21:50 +0000 (04:21 +0000)]
[BPF] Preserve debuginfo array/union/struct type/access index

For background of BPF CO-RE project, please refer to
  http://vger.kernel.org/bpfconf2019.html
In summary, BPF CO-RE intends to compile bpf programs
adjustable on struct/union layout change so the same
program can run on multiple kernels with adjustment
before loading based on native kernel structures.

In order to do this, we need keep track of GEP(getelementptr)
instruction base and result debuginfo types, so we
can adjust on the host based on kernel BTF info.
Capturing such information as an IR optimization is hard
as various optimization may have tweaked GEP and also
union is replaced by structure it is impossible to track
fieldindex for union member accesses.

Three intrinsic functions, preserve_{array,union,struct}_access_index,
are introducted.
  addr = preserve_array_access_index(base, index, dimension)
  addr = preserve_union_access_index(base, di_index)
  addr = preserve_struct_access_index(base, gep_index, di_index)
here,
  base: the base pointer for the array/union/struct access.
  index: the last access index for array, the same for IR/DebugInfo layout.
  dimension: the array dimension.
  gep_index: the access index based on IR layout.
  di_index: the access index based on user/debuginfo types.

If using these intrinsics blindly, i.e., transforming all GEPs
to these intrinsics and later on reducing them to GEPs, we have
seen up to 7% more instructions generated. To avoid such an overhead,
a clang builtin is proposed:
  base = __builtin_preserve_access_index(base)
such that user wraps to-be-relocated GEPs in this builtin
and preserve_*_access_index intrinsics only apply to
those GEPs. Such a buyin will prevent performance degradation
if people do not use CO-RE, even for programs which use
bpf_probe_read().

For example, for the following example,
  $ cat test.c
  struct sk_buff {
     int i;
     int b1:1;
     int b2:2;
     union {
       struct {
         int o1;
         int o2;
       } o;
       struct {
         char flags;
         char dev_id;
       } dev;
       int netid;
     } u[10];
  };

  static int (*bpf_probe_read)(void *dst, int size, const void *unsafe_ptr)
      = (void *) 4;

  #define _(x) (__builtin_preserve_access_index(x))

  int bpf_prog(struct sk_buff *ctx) {
    char dev_id;
    bpf_probe_read(&dev_id, sizeof(char), _(&ctx->u[5].dev.dev_id));
    return dev_id;
  }
  $ clang -target bpf -O2 -g -emit-llvm -S -mllvm -print-before-all \
    test.c >& log

The generated IR looks like below:
  ...
  define dso_local i32 @bpf_prog(%struct.sk_buff*) #0 !dbg !15 {
    %2 = alloca %struct.sk_buff*, align 8
    %3 = alloca i8, align 1
    store %struct.sk_buff* %0, %struct.sk_buff** %2, align 8, !tbaa !45
    call void @llvm.dbg.declare(metadata %struct.sk_buff** %2, metadata !43, metadata !DIExpression()), !dbg !49
    call void @llvm.lifetime.start.p0i8(i64 1, i8* %3) #4, !dbg !50
    call void @llvm.dbg.declare(metadata i8* %3, metadata !44, metadata !DIExpression()), !dbg !51
    %4 = load i32 (i8*, i32, i8*)*, i32 (i8*, i32, i8*)** @bpf_probe_read, align 8, !dbg !52, !tbaa !45
    %5 = load %struct.sk_buff*, %struct.sk_buff** %2, align 8, !dbg !53, !tbaa !45
    %6 = call [10 x %union.anon]* @llvm.preserve.struct.access.index.p0a10s_union.anons.p0s_struct.sk_buffs(
         %struct.sk_buff* %5, i32 2, i32 3), !dbg !53, !llvm.preserve.access.index !19
    %7 = call %union.anon* @llvm.preserve.array.access.index.p0s_union.anons.p0a10s_union.anons(
         [10 x %union.anon]* %6, i32 1, i32 5), !dbg !53
    %8 = call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(
         %union.anon* %7, i32 1), !dbg !53, !llvm.preserve.access.index !26
    %9 = bitcast %union.anon* %8 to %struct.anon.0*, !dbg !53
    %10 = call i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.anon.0s(
         %struct.anon.0* %9, i32 1, i32 1), !dbg !53, !llvm.preserve.access.index !34
    %11 = call i32 %4(i8* %3, i32 1, i8* %10), !dbg !52
    %12 = load i8, i8* %3, align 1, !dbg !54, !tbaa !55
    %13 = sext i8 %12 to i32, !dbg !54
    call void @llvm.lifetime.end.p0i8(i64 1, i8* %3) #4, !dbg !56
    ret i32 %13, !dbg !57
  }

  !19 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "sk_buff", file: !3, line: 1, size: 704, elements: !20)
  !26 = distinct !DICompositeType(tag: DW_TAG_union_type, scope: !19, file: !3, line: 5, size: 64, elements: !27)
  !34 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !26, file: !3, line: 10, size: 16, elements: !35)

Note that @llvm.preserve.{struct,union}.access.index calls have metadata llvm.preserve.access.index
attached to instructions to provide struct/union debuginfo type information.

For &ctx->u[5].dev.dev_id,
  . The "%6 = ..." represents struct member "u" with index 2 for IR layout and index 3 for DI layout.
  . The "%7 = ..." represents array subscript "5".
  . The "%8 = ..." represents union member "dev" with index 1 for DI layout.
  . The "%10 = ..." represents struct member "dev_id" with index 1 for both IR and DI layout.

Basically, traversing the use-def chain recursively for the 3rd argument of bpf_probe_read() and
examining all preserve_*_access_index calls, the debuginfo struct/union/array access index
can be achieved.

The intrinsics also contain enough information to regenerate codes for IR layout.
For array and structure intrinsics, the proper GEP can be constructed.
For union intrinsics, replacing all uses of "addr" with "base" should be enough.

Signed-off-by: Yonghong Song <yhs@fb.com>
Differential Revision: https://reviews.llvm.org/D61809

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

5 years agoRevert "[BPF] Preserve debuginfo array/union/struct type/access index"
Yonghong Song [Tue, 9 Jul 2019 04:15:12 +0000 (04:15 +0000)]
Revert "[BPF] Preserve debuginfo array/union/struct type/access index"

This reverts commit r365435.

Forgot adding the Differential Revision link. Will add to the
commit message and resubmit.

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

5 years ago[BPF] Preserve debuginfo array/union/struct type/access index
Yonghong Song [Tue, 9 Jul 2019 04:04:21 +0000 (04:04 +0000)]
[BPF] Preserve debuginfo array/union/struct type/access index

For background of BPF CO-RE project, please refer to
  http://vger.kernel.org/bpfconf2019.html
In summary, BPF CO-RE intends to compile bpf programs
adjustable on struct/union layout change so the same
program can run on multiple kernels with adjustment
before loading based on native kernel structures.

In order to do this, we need keep track of GEP(getelementptr)
instruction base and result debuginfo types, so we
can adjust on the host based on kernel BTF info.
Capturing such information as an IR optimization is hard
as various optimization may have tweaked GEP and also
union is replaced by structure it is impossible to track
fieldindex for union member accesses.

Three intrinsic functions, preserve_{array,union,struct}_access_index,
are introducted.
  addr = preserve_array_access_index(base, index, dimension)
  addr = preserve_union_access_index(base, di_index)
  addr = preserve_struct_access_index(base, gep_index, di_index)
here,
  base: the base pointer for the array/union/struct access.
  index: the last access index for array, the same for IR/DebugInfo layout.
  dimension: the array dimension.
  gep_index: the access index based on IR layout.
  di_index: the access index based on user/debuginfo types.

If using these intrinsics blindly, i.e., transforming all GEPs
to these intrinsics and later on reducing them to GEPs, we have
seen up to 7% more instructions generated. To avoid such an overhead,
a clang builtin is proposed:
  base = __builtin_preserve_access_index(base)
such that user wraps to-be-relocated GEPs in this builtin
and preserve_*_access_index intrinsics only apply to
those GEPs. Such a buyin will prevent performance degradation
if people do not use CO-RE, even for programs which use
bpf_probe_read().

For example, for the following example,
  $ cat test.c
  struct sk_buff {
     int i;
     int b1:1;
     int b2:2;
     union {
       struct {
         int o1;
         int o2;
       } o;
       struct {
         char flags;
         char dev_id;
       } dev;
       int netid;
     } u[10];
  };

  static int (*bpf_probe_read)(void *dst, int size, const void *unsafe_ptr)
      = (void *) 4;

  #define _(x) (__builtin_preserve_access_index(x))

  int bpf_prog(struct sk_buff *ctx) {
    char dev_id;
    bpf_probe_read(&dev_id, sizeof(char), _(&ctx->u[5].dev.dev_id));
    return dev_id;
  }
  $ clang -target bpf -O2 -g -emit-llvm -S -mllvm -print-before-all \
    test.c >& log

The generated IR looks like below:
  ...
  define dso_local i32 @bpf_prog(%struct.sk_buff*) #0 !dbg !15 {
    %2 = alloca %struct.sk_buff*, align 8
    %3 = alloca i8, align 1
    store %struct.sk_buff* %0, %struct.sk_buff** %2, align 8, !tbaa !45
    call void @llvm.dbg.declare(metadata %struct.sk_buff** %2, metadata !43, metadata !DIExpression()), !dbg !49
    call void @llvm.lifetime.start.p0i8(i64 1, i8* %3) #4, !dbg !50
    call void @llvm.dbg.declare(metadata i8* %3, metadata !44, metadata !DIExpression()), !dbg !51
    %4 = load i32 (i8*, i32, i8*)*, i32 (i8*, i32, i8*)** @bpf_probe_read, align 8, !dbg !52, !tbaa !45
    %5 = load %struct.sk_buff*, %struct.sk_buff** %2, align 8, !dbg !53, !tbaa !45
    %6 = call [10 x %union.anon]* @llvm.preserve.struct.access.index.p0a10s_union.anons.p0s_struct.sk_buffs(
         %struct.sk_buff* %5, i32 2, i32 3), !dbg !53, !llvm.preserve.access.index !19
    %7 = call %union.anon* @llvm.preserve.array.access.index.p0s_union.anons.p0a10s_union.anons(
         [10 x %union.anon]* %6, i32 1, i32 5), !dbg !53
    %8 = call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(
         %union.anon* %7, i32 1), !dbg !53, !llvm.preserve.access.index !26
    %9 = bitcast %union.anon* %8 to %struct.anon.0*, !dbg !53
    %10 = call i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.anon.0s(
         %struct.anon.0* %9, i32 1, i32 1), !dbg !53, !llvm.preserve.access.index !34
    %11 = call i32 %4(i8* %3, i32 1, i8* %10), !dbg !52
    %12 = load i8, i8* %3, align 1, !dbg !54, !tbaa !55
    %13 = sext i8 %12 to i32, !dbg !54
    call void @llvm.lifetime.end.p0i8(i64 1, i8* %3) #4, !dbg !56
    ret i32 %13, !dbg !57
  }

  !19 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "sk_buff", file: !3, line: 1, size: 704, elements: !20)
  !26 = distinct !DICompositeType(tag: DW_TAG_union_type, scope: !19, file: !3, line: 5, size: 64, elements: !27)
  !34 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !26, file: !3, line: 10, size: 16, elements: !35)

Note that @llvm.preserve.{struct,union}.access.index calls have metadata llvm.preserve.access.index
attached to instructions to provide struct/union debuginfo type information.

For &ctx->u[5].dev.dev_id,
  . The "%6 = ..." represents struct member "u" with index 2 for IR layout and index 3 for DI layout.
  . The "%7 = ..." represents array subscript "5".
  . The "%8 = ..." represents union member "dev" with index 1 for DI layout.
  . The "%10 = ..." represents struct member "dev_id" with index 1 for both IR and DI layout.

Basically, traversing the use-def chain recursively for the 3rd argument of bpf_probe_read() and
examining all preserve_*_access_index calls, the debuginfo struct/union/array access index
can be achieved.

The intrinsics also contain enough information to regenerate codes for IR layout.
For array and structure intrinsics, the proper GEP can be constructed.
For union intrinsics, replacing all uses of "addr" with "base" should be enough.

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365435 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse `ln -n` to prevent forming a symlink cycle, instead of rm'ing the source
Nico Weber [Tue, 9 Jul 2019 00:36:18 +0000 (00:36 +0000)]
Use `ln -n` to prevent forming a symlink cycle, instead of rm'ing the source

This is a better fix for the problem fixed in r334972.

Also remove the rm'ing of the symlink destination that was there to
clean up the bots -- it's over a year later, bots should be happy now.

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

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

5 years agoLet unaliased Args track which Alias they were created from, and use that in Arg...
Nico Weber [Tue, 9 Jul 2019 00:34:08 +0000 (00:34 +0000)]
Let unaliased Args track which Alias they were created from, and use that in Arg::getAsString() for diagnostics

With this, `clang-cl /source-charset:utf-16 test.cc` now prints `invalid
value 'utf-16' in '/source-charset:utf-16'` instead of `invalid value
'utf-16' in '-finput-charset=utf-16'` before, and several other clang-cl
flags produce much less confusing output as well.

Fixes PR29106.

Since an arg and its alias can have different arg types (joined vs not)
and different values (because of AliasArgs<>), I chose to give the Alias
its own Arg object. For convenience, I just store the alias directly in
the unaliased arg – there aren't many arg objects at runtime, so that
seems ok.

Finally, I changed Arg::getAsString() to use the alias's representation
if it's present – that function was already documented as being the
suitable function for diagnostics, and most callers already used it for
diagnostics.

Implementation-wise, Arg::accept() previously used to parse things as
the unaliased option. The core of that switch is now extracted into a
new function acceptInternal() which parses as the _aliased_ option, and
the previously-intermingled unaliasing is now done as an explicit step
afterwards.

(This also changes one place in lld that didn't use getAsString() for
diagnostics, so that that one place now also prints the flag as the user
wrote it, not as it looks after it went through unaliasing.)

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

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

5 years ago[X86][PPC] Support -mlong-double-64
Fangrui Song [Tue, 9 Jul 2019 00:27:43 +0000 (00:27 +0000)]
[X86][PPC] Support -mlong-double-64

-mlong-double-64 is supported on some ports of gcc (i386, x86_64, and ppc{32,64}).
On many other targets, there will be an error:

    error: unrecognized command line option '-mlong-double-64'

This patch makes the driver option -mlong-double-64 available for x86
and ppc. The CC1 option -mlong-double-64 is available on all targets for
users to test on unsupported targets.

LongDoubleSize is added as a VALUE_LANGOPT so that the option can be
shared with -mlong-double-128 when we support it in clang.

Also, make powerpc*-linux-musl default to use 64-bit long double. It is
currently the only supported ABI on musl and is also how people
configure powerpc*-linux-musl-gcc.

Reviewed By: rnk

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

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

5 years agoclang-cl: Port cl.exe's C4659 to clang-cl
Nico Weber [Tue, 9 Jul 2019 00:02:23 +0000 (00:02 +0000)]
clang-cl: Port cl.exe's C4659 to clang-cl

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

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

5 years ago[analyzer] exploded-graph-rewriter: Implement a topology-only mode.
Artem Dergachev [Mon, 8 Jul 2019 23:54:14 +0000 (23:54 +0000)]
[analyzer] exploded-graph-rewriter: Implement a topology-only mode.

In this mode the rewriter will only rewrite program points
and omit program states. Useful for understanding
the rough topology of the graph.

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

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

5 years ago[analyzer] exploded-graph-rewriter: Implement a single-path mode.
Artem Dergachev [Mon, 8 Jul 2019 23:54:11 +0000 (23:54 +0000)]
[analyzer] exploded-graph-rewriter: Implement a single-path mode.

Instead of rewriting the whole graph, rewrite the leftmost path in the
graph. Useful for trimmed graphs that are still too large to display due
to multiple equivalent reports mixed into them.

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

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