]> granicus.if.org Git - clang/log
clang
6 years ago[clang-format] Wildcard expansion on Windows.
Alexander Kornienko [Mon, 26 Mar 2018 13:54:17 +0000 (13:54 +0000)]
[clang-format] Wildcard expansion on Windows.

Summary:
Add support for wildcard expansion in command line arguments on Windows.
See https://docs.microsoft.com/en-us/cpp/c-language/expanding-wildcard-arguments

Fixes https://bugs.llvm.org/show_bug.cgi?id=17217

Reviewers: klimek, djasper, rnk

Reviewed By: rnk

Subscribers: rnk, smeenai, zturner, alexfh, mgorny, cfe-commits

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

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

6 years ago[SemaCXX] _Pragma("clang optimize off") not affecting lambda.
Carlos Alberto Enciso [Mon, 26 Mar 2018 13:48:03 +0000 (13:48 +0000)]
[SemaCXX] _Pragma("clang optimize off") not affecting lambda.

Declaring "_Pragma("clang optimize off")" before the body of a
function with a lambda leads to the lambda functions in the body
not being affected.

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

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

6 years agoRemove reference to stale (2009) python version.
Yaron Keren [Sun, 25 Mar 2018 13:12:05 +0000 (13:12 +0000)]
Remove reference to stale (2009) python version.

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

6 years ago[C++17] Fix class template argument deduction for default constructors without an...
Zhihao Yuan [Sat, 24 Mar 2018 04:32:11 +0000 (04:32 +0000)]
[C++17] Fix class template argument deduction for default constructors without an initializer

Summary:
As the title says, this makes following code compile:

```
template<typename> struct Foo {};
Foo() -> Foo<void>;

Foo f; // ok
```

Thanks Nicolas Lesser for coining the fix.

Reviewers: rsmith, lichray

Reviewed By: rsmith, lichray

Subscribers: lichray, cfe-commits

Tags: #clang

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

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

6 years ago[analyzer] Do not crash in CallEvent.getReturnType()
George Karpenkov [Sat, 24 Mar 2018 01:53:12 +0000 (01:53 +0000)]
[analyzer] Do not crash in CallEvent.getReturnType()

When the call expression is not available.

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

6 years ago[ODRHash] Support pointer and reference types.
Richard Trieu [Sat, 24 Mar 2018 00:52:44 +0000 (00:52 +0000)]
[ODRHash] Support pointer and reference types.

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

6 years ago[libFuzzer] Use OptForFuzzing attribute with -fsanitize=fuzzer.
Matt Morehouse [Fri, 23 Mar 2018 23:35:28 +0000 (23:35 +0000)]
[libFuzzer] Use OptForFuzzing attribute with -fsanitize=fuzzer.

Summary:
Disables certain CMP optimizations to improve fuzzing signal under -O1
and -O2.

Switches all fuzzer tests to -O2 except for a few leak tests where the
leak is optimized out under -O2.

Reviewers: kcc, vitalybuka

Reviewed By: vitalybuka

Subscribers: cfe-commits, llvm-commits

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

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

6 years agoChange for an LLVM header file move
David Blaikie [Fri, 23 Mar 2018 22:16:59 +0000 (22:16 +0000)]
Change for an LLVM header file move

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

6 years ago[CUDA] Fixed false error reporting in case of calling H->G->HD->D.
Artem Belevich [Fri, 23 Mar 2018 19:49:03 +0000 (19:49 +0000)]
[CUDA] Fixed false error reporting in case of calling H->G->HD->D.

Launching a kernel from the host code does not generate code for the
kernel itself. This fixes an issue with clang erroneously reporting
an error for a HD->D call from within the kernel.

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

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

6 years ago[HWASan] Port HWASan to Linux x86-64 (clang)
Alex Shlyapnikov [Fri, 23 Mar 2018 19:47:45 +0000 (19:47 +0000)]
[HWASan] Port HWASan to Linux x86-64 (clang)

Summary: Porting HWASan to Linux x86-64, the third of the three patches, clang part.

Reviewers: eugenis

Subscribers: cryptoad, cfe-commits

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

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

6 years ago[AMDGPU] Fix codegen for inline assembly
Yaxun Liu [Fri, 23 Mar 2018 19:43:42 +0000 (19:43 +0000)]
[AMDGPU] Fix codegen for inline assembly

Need to override convertConstraint to recognise amdgpu specific register names.

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

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

6 years ago[AMDGPU] Update OpenCL to use 48 bytes of implicit arguments for AMDGPU (CLANG)
Tony Tye [Fri, 23 Mar 2018 18:51:45 +0000 (18:51 +0000)]
[AMDGPU] Update OpenCL to use 48 bytes of implicit arguments for AMDGPU (CLANG)

Add two additional implicit arguments for OpenCL for the AMDGPU target using the AMDHSA runtime to support device enqueue.

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

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

6 years ago[AMDGPU] Remove use of OpenCL triple environment and replace with function attribute...
Tony Tye [Fri, 23 Mar 2018 18:43:15 +0000 (18:43 +0000)]
[AMDGPU] Remove use of OpenCL triple environment and replace with function attribute for AMDGPU (CLANG)

- Remove use of the opencl and amdopencl environment member of the target triple for the AMDGPU target.
- Use a function attribute to communicate to the AMDGPU backend.

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

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

6 years ago[vfs] Don't bail out after a missing -ivfsoverlay file
Ben Langmuir [Fri, 23 Mar 2018 17:37:27 +0000 (17:37 +0000)]
[vfs] Don't bail out after a missing -ivfsoverlay file

This make -ivfsoverlay behave more like other fatal errors (e.g. missing
-include file) by skipping the missing file instead of bailing out of
the whole compilation. This makes it possible for libclang to still
provide some functionallity as well as to correctly produce the fatal
error diagnostic (previously we lost the diagnostic in libclang since
there was no TU to tie it to).

rdar://33385423

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

6 years agoBring r328238 back with a fix.
Rafael Espindola [Fri, 23 Mar 2018 01:36:23 +0000 (01:36 +0000)]
Bring r328238 back with a fix.

The issues was that we were setting hidden visibility if, when
processing a hidden class, we found out that we needed to emit a
reference to a vtable provided by the standard library.

Original message:

Set dso_local on vtables.

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

6 years agoRemove problematic PrettyStackTrace entry added in r328276
Jordan Rose [Fri, 23 Mar 2018 01:12:09 +0000 (01:12 +0000)]
Remove problematic PrettyStackTrace entry added in r328276

I'm not sure /why/ this is causing issues for libclang, but it is.
Unbreak the buildbots since it's already consumed an hour of my time.

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

6 years ago[Modules] Update test to mention it requires C++14.
Volodymyr Sapsai [Fri, 23 Mar 2018 00:16:06 +0000 (00:16 +0000)]
[Modules] Update test to mention it requires C++14.

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

6 years ago[analyzer] Trust _Nonnull annotations for system framework
George Karpenkov [Fri, 23 Mar 2018 00:16:03 +0000 (00:16 +0000)]
[analyzer] Trust _Nonnull annotations for system framework

Changes the analyzer to believe that methods annotated with _Nonnull
from system frameworks indeed return non null objects.
Local methods with such annotation are still distrusted.
rdar://24291919

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

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

6 years ago[analyzer] Extend GCDAntipatternChecker to match group_enter/group_leave pattern
George Karpenkov [Fri, 23 Mar 2018 00:16:02 +0000 (00:16 +0000)]
[analyzer] Extend GCDAntipatternChecker to match group_enter/group_leave pattern

rdar://38480416

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

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

6 years ago[analyzer] [NFC] Move worklist implementation to WorkList.cpp
George Karpenkov [Fri, 23 Mar 2018 00:16:01 +0000 (00:16 +0000)]
[analyzer] [NFC] Move worklist implementation to WorkList.cpp

Current location is very confusing, especially because there is already
WorkList.h, and other code in CoreEngine.cpp is not related to work list
implementation.

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

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

6 years ago[ARM] Add ARMv8.2-A FP16 vector intrinsic
Abderrazek Zaafrani [Fri, 23 Mar 2018 00:08:40 +0000 (00:08 +0000)]
[ARM] Add ARMv8.2-A FP16 vector intrinsic

Putting back the code in commit r327189 that was reverted in r322737. The code is being committed in three stages and this one is the last stage: 1) r327455 fp16 feature flags, 2) r327836 pass half type or i16 based on FullFP16, and 3) the code here which the front-end fp16 vector intrinsic for ARM.

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

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

6 years agoSink PrettyDeclStackTrace down to the AST library
Jordan Rose [Fri, 23 Mar 2018 00:07:18 +0000 (00:07 +0000)]
Sink PrettyDeclStackTrace down to the AST library

...and add some very basic stack trace entries for module building.
This would have helped track down rdar://problem/38434694 sooner.

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

6 years agoSet dso_local on __ImageBase.
Rafael Espindola [Thu, 22 Mar 2018 23:02:19 +0000 (23:02 +0000)]
Set dso_local on __ImageBase.

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

6 years agoAdd a test.
Rafael Espindola [Thu, 22 Mar 2018 22:57:48 +0000 (22:57 +0000)]
Add a test.

This would have found the regression in r328238.

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

6 years ago[analyzer] Enable temporary object destructor inlining by default.
Artem Dergachev [Thu, 22 Mar 2018 22:05:53 +0000 (22:05 +0000)]
[analyzer] Enable temporary object destructor inlining by default.

When a temporary is constructed with a proper construction context, it should
be safe to inline the destructor. We have added suppressions for some of the
common false positives caused by such inlining, so there should be - and from my
observations there indeed is - more benefit than harm from enabling destructor
inlining.

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

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

6 years ago[CFG] [analyzer] Add C++17-specific ctor-initializer construction contexts.
Artem Dergachev [Thu, 22 Mar 2018 22:02:38 +0000 (22:02 +0000)]
[CFG] [analyzer] Add C++17-specific ctor-initializer construction contexts.

CXXCtorInitializer-based constructors are also affected by the C++17 mandatory
copy elision, like variable constructors and return value constructors.
Extend r328248 to support those.

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

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

6 years ago[analyzer] Remove an assertion that doesn't hold in C++17.
Artem Dergachev [Thu, 22 Mar 2018 21:54:48 +0000 (21:54 +0000)]
[analyzer] Remove an assertion that doesn't hold in C++17.

Function return values can be constructed directly in variables or passed
directly into return statements, without even an elidable copy in between.
This is how the C++17 mandatory copy elision AST behaves. The behavior we'll
have in such cases is the "old" behavior that we've had before we've
implemented destructor inlining and proper lifetime extension support.

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

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

6 years ago[CFG] [analyzer] NFC: Move construction context allocation into a helper method.
Artem Dergachev [Thu, 22 Mar 2018 21:40:24 +0000 (21:40 +0000)]
[CFG] [analyzer] NFC: Move construction context allocation into a helper method.

Improve readability of ConstructionContext::createFromLayers().

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

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

6 years ago[CFG] [analyzer] Add C++17-specific variable and return construction contexts.
Artem Dergachev [Thu, 22 Mar 2018 21:37:39 +0000 (21:37 +0000)]
[CFG] [analyzer] Add C++17-specific variable and return construction contexts.

In C++17 copy elision is mandatory for variable and return value constructors
(as long as it doesn't involve type conversion) which results in AST that does
not contain elidable constructors in their usual places. In order to provide
construction contexts in this scenario we need to cover more AST patterns.

This patch makes the CFG prepared for these scenarios by:

- Fork VariableConstructionContext and ReturnedValueConstructionContext into
  two different sub-classes (each) one of which indicates the C++17 case and
  contains a reference to an extra CXXBindTemporaryExpr.
- Allow CFGCXXRecordTypedCall element to accept VariableConstructionContext and
  ReturnedValueConstructionContext as its context.

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

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

6 years ago[analyzer] Make symbol_iterator iterate over SVal's symbolic base.
Artem Dergachev [Thu, 22 Mar 2018 21:30:58 +0000 (21:30 +0000)]
[analyzer] Make symbol_iterator iterate over SVal's symbolic base.

If a memory region (or an SVal that represents a pointer to that memory region)
is a (direct or indirect, not necessarily proper) sub-region of a SymbolicRegion
then it is said to have a symbolic base.

For now SVal::symbol_iterator explores the symbol within a symbolic region
only when the SVal represents a pointer to the symbolic region itself,
not to any of its sub-regions.

This behavior is not indended by any user of symbol_iterator; all users who
cared about such behavior were expecting the iterator to descend into the
symbolic base of an arbitrary region, find the parent symbol of the symbolic
base region, and iterate over that symbol. Lack of such behavior resulted in
bugs demonstarted by the test cases.

Hence the decision to change the API to behave more intuitively.

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

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

6 years agoFix test failure on Windows caused by different underlying enumeration type rules
Eric Fiselier [Thu, 22 Mar 2018 21:17:07 +0000 (21:17 +0000)]
Fix test failure on Windows caused by different underlying enumeration type rules

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

6 years agoRevert "Set dso_local on vtables."
Rafael Espindola [Thu, 22 Mar 2018 21:14:16 +0000 (21:14 +0000)]
Revert "Set dso_local on vtables."

This reverts commit r328238.

Looks like it broke some buildbots.

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

6 years agoSet dso_local on vtables.
Rafael Espindola [Thu, 22 Mar 2018 20:33:01 +0000 (20:33 +0000)]
Set dso_local on vtables.

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

6 years agoSet dso_local on builtin functions.
Rafael Espindola [Thu, 22 Mar 2018 18:03:13 +0000 (18:03 +0000)]
Set dso_local on builtin functions.

The difference between CreateRuntimeFunction and CreateBuiltinFunction
is that CreateBuiltinFunction would not set dllimport or dso_local.

To keep the current semantics, just forward to CreateRuntimeFunction
with Local=true so it doesn't add dllimport.

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

6 years ago[clang-format] Fix ObjC style guesser to also iterate over child lines
Ben Hamilton [Thu, 22 Mar 2018 17:37:19 +0000 (17:37 +0000)]
[clang-format] Fix ObjC style guesser to also iterate over child lines

Summary:
When I wrote `ObjCHeaderStyleGuesser`, I incorrectly assumed the
correct way to iterate over all tokens in `AnnotatedLine` was to
iterate over the linked list tokens starting with
`AnnotatedLine::First`.

However, `AnnotatedLine` also contains a vector
`AnnotedLine::Children` with child `AnnotedLine`s which have their own
tokens which we need to iterate over.

Because I didn't iterate over the tokens in the children lines, the
ObjC style guesser would fail on syntax like:

  #define FOO ({ NSString *s = ... })

as the statement(s) inside { ... } are child lines.

This fixes the bug and adds a test. I confirmed the test
failed before the fix, and passed after the fix.

Test Plan: New tests added. Ran tests with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, jolesiak, Wizard

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

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

6 years ago[OpenMP][Clang] Add call to global data sharing stack initialization on the workers...
Gheorghe-Teodor Bercea [Thu, 22 Mar 2018 17:33:27 +0000 (17:33 +0000)]
[OpenMP][Clang] Add call to global data sharing stack initialization on the workers side

Summary: The workers also need to initialize the global stack. The call to the initialization function needs to happen after the kernel_init() function is called by the master. This ensures that the per-team data structures of the runtime have been initialized.

Reviewers: ABataev, grokos, carlo.bertolli, caomhin

Reviewed By: ABataev

Subscribers: jholewinski, guansong, cfe-commits

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

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

6 years ago[CUDA] add REQUIRES fields for CUDA variants of LTO tests.
Artem Belevich [Thu, 22 Mar 2018 16:47:41 +0000 (16:47 +0000)]
[CUDA] add REQUIRES fields for CUDA variants of LTO tests.

Also relax checking for nvptx triple. This should avoid test failure if
the test is executed on 32-bit platform.

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

6 years agoclang-format: Narrow down raw string literal line break exception.
Daniel Jasper [Thu, 22 Mar 2018 14:43:54 +0000 (14:43 +0000)]
clang-format: Narrow down raw string literal line break exception.

For multiline raw string literals, we generally want to respect the
author's choice of linebreak before the 'R"(' as the rest of the raw
string might be aligned to it and we cannot (commonly) modify the
content.

For single-line raw string literals, this doesn't make any sense and so
we should just treat them as regular string literals in this regard.

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

6 years agoclang-format: Fix SpacesInParentheses with fully qualified names.
Daniel Jasper [Thu, 22 Mar 2018 14:30:28 +0000 (14:30 +0000)]
clang-format: Fix SpacesInParentheses with fully qualified names.

When SpacesInParentheses is set to true clang-format does not add a
space before fully qualified names. For example:

  do_something(::globalVar );

Fix by Darby Payne. Thank you!

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

6 years ago[CodeGen] Emit DWARF "constructor" calling convention
Jonas Devlieghere [Thu, 22 Mar 2018 13:53:30 +0000 (13:53 +0000)]
[CodeGen] Emit DWARF "constructor" calling convention

Now that LLVM has support for emitting calling conventions in DWARF (see
r328191) have clang emit them.

Patch by: Adrien Guinet

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

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

6 years ago[clang-format] Add a few more Core Graphics identifiers to ObjC heuristic
Ben Hamilton [Thu, 22 Mar 2018 03:25:22 +0000 (03:25 +0000)]
[clang-format] Add a few more Core Graphics identifiers to ObjC heuristic

Summary:
We received reports of the Objective-C style guesser getting a false
negative on header files like:

CGSize SizeOfThing(MyThing thing);

This adds more Core Graphics identifiers to the Objective-C style
guesser.

Test Plan: New tests added. Ran tests with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: jolesiak, djasper

Reviewed By: jolesiak, djasper

Subscribers: krasimir, klimek, cfe-commits

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

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

6 years ago[clang-format] Don't insert space between r_paren and 'new' in ObjC decl
Ben Hamilton [Thu, 22 Mar 2018 03:23:53 +0000 (03:23 +0000)]
[clang-format] Don't insert space between r_paren and 'new' in ObjC decl

Summary:
Previously, clang-format would insert a space between
the closing parenthesis and 'new' in the following valid Objective-C
declaration:

  + (instancetype)new;

This was because 'new' is treated as a keyword, not an identifier.

TokenAnnotator::spaceRequiredBefore() already handled the case where
r_paren came before an identifier, so this diff extends it to
handle r_paren before 'new'.

Test Plan: New tests added. Ran tests with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, jolesiak, stephanemoore

Reviewed By: djasper, jolesiak, stephanemoore

Subscribers: stephanemoore, klimek, cfe-commits

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

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

6 years agoImprove -Winfinite-recursion
Robert Widmann [Thu, 22 Mar 2018 03:16:23 +0000 (03:16 +0000)]
Improve -Winfinite-recursion

Summary: Rewrites -Winfinite-recursion to remove the state dictionary and explore paths in loops - especially infinite loops.  The new check now detects recursion in loop bodies dominated by a recursive call.

Reviewers: rsmith, rtrieu

Reviewed By: rtrieu

Subscribers: lebedev.ri, cfe-commits

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

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

6 years ago[Frontend] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Thu, 22 Mar 2018 00:53:26 +0000 (00:53 +0000)]
[Frontend] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years agoFix for LLVM change (Transforms/Utils/Local.h -> Analysis/Utils/Local.h)
David Blaikie [Wed, 21 Mar 2018 22:34:27 +0000 (22:34 +0000)]
Fix for LLVM change (Transforms/Utils/Local.h -> Analysis/Utils/Local.h)

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

6 years ago[CUDA] Disable LTO for device-side compilations.
Artem Belevich [Wed, 21 Mar 2018 22:22:59 +0000 (22:22 +0000)]
[CUDA] Disable LTO for device-side compilations.

This fixes host-side LTO during CUDA compilation. Before, LTO
pipeline construction was clashing with CUDA pipeline construction.

At the moment there's no point doing LTO on device side as each
device-side TU is a complete program.  We will need to figure out
compilation pipeline construction for the device-side LTO when we
have working support for multi-TU device-side CUDA compilation.

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

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

6 years ago[NVPTX] Make tensor shape part of WMMA intrinsic's name.
Artem Belevich [Wed, 21 Mar 2018 21:55:02 +0000 (21:55 +0000)]
[NVPTX] Make tensor shape part of WMMA intrinsic's name.

This is needed for the upcoming implementation of the
new 8x32x16 and 32x8x16 variants of WMMA instructions
introduced in CUDA 9.1.

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

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

6 years ago[Modules] Fix creating fake definition data for lambdas.
Volodymyr Sapsai [Wed, 21 Mar 2018 21:28:54 +0000 (21:28 +0000)]
[Modules] Fix creating fake definition data for lambdas.

During reading C++ definition data for lambda we can access
CXXRecordDecl representing lambda before we finished reading the
definition data. This can happen by reading a captured variable which is
VarDecl, then reading its decl context which is CXXMethodDecl `operator()`,
then trying to merge redeclarable methods and accessing
enclosing CXXRecordDecl. The call stack looks roughly like

    VisitCXXRecordDecl
      ReadCXXRecordDefinition
        VisitVarDecl
          VisitCXXMethodDecl
            mergeRedeclarable
              getPrimaryContextForMerging

If we add fake definition data at this point, later we'll hit the assertion

    Assertion failed: (!DD.IsLambda && !MergeDD.IsLambda && "faked up lambda definition?"), function MergeDefinitionData, file clang/lib/Serialization/ASTReaderDecl.cpp, line 1675.

The fix is to assign definition data before reading it. Fixes PR32556.

rdar://problem/37461072

Reviewers: rsmith, bruno

Reviewed By: rsmith

Subscribers: cfe-commits, jkorous-apple, aprantl

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

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

6 years ago[Builtins] Overload __builtin_operator_new/delete to allow forwarding to usual alloca...
Eric Fiselier [Wed, 21 Mar 2018 19:19:48 +0000 (19:19 +0000)]
[Builtins] Overload __builtin_operator_new/delete to allow forwarding to usual allocation/deallocation functions.

Summary:
Libc++'s default allocator uses `__builtin_operator_new` and `__builtin_operator_delete` in order to allow the calls to new/delete to be ellided. However, libc++ now needs to support over-aligned types in the default allocator. In order to support this without disabling the existing optimization Clang needs to support calling the aligned new overloads from the builtins.

See llvm.org/PR22634 for more information about the libc++ bug.

This patch changes `__builtin_operator_new`/`__builtin_operator_delete` to call any usual `operator new`/`operator delete` function. It does this by performing overload resolution with the arguments passed to the builtin to determine which allocation function to call. If the selected function is not a usual allocation function a diagnostic is issued.

One open issue is if the `align_val_t` overloads should be considered "usual" when `LangOpts::AlignedAllocation` is disabled.

In order to allow libc++ to detect this new behavior the value for `__has_builtin(__builtin_operator_new)` has been updated to `201802`.

Reviewers: rsmith, majnemer, aaron.ballman, erik.pilkington, bogner, ahatanak

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

6 years ago[Fuchsia] Don't install libc++, libc++abi or libunwind on Darwin
Petr Hosek [Wed, 21 Mar 2018 16:48:26 +0000 (16:48 +0000)]
[Fuchsia] Don't install libc++, libc++abi or libunwind on Darwin

The Clang driver doesn't currently know how to use the libraries
that are shipped as part of the toolchain so there's no reason to
ship them at all.

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

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

6 years agoclang-interpreter example cmake fix
Luke Cheeseman [Wed, 21 Mar 2018 12:05:19 +0000 (12:05 +0000)]
clang-interpreter example cmake fix

Add in a space when appending the export to the linker options. Without
the space the export is appended onto whatever the last link option
was, which might be a file.

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

6 years ago[ASTMatchers] Remove extra qualifier for consistency (LibASTMatchersReference.html)
Clement Courbet [Wed, 21 Mar 2018 10:54:29 +0000 (10:54 +0000)]
[ASTMatchers] Remove extra qualifier for consistency (LibASTMatchersReference.html)

+ Regenerate doc.

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

6 years ago[ASTMatchers] Regenerate doc.
Clement Courbet [Wed, 21 Mar 2018 10:48:00 +0000 (10:48 +0000)]
[ASTMatchers] Regenerate doc.

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

6 years agoSet dso_local on runtime variables.
Rafael Espindola [Wed, 21 Mar 2018 01:30:16 +0000 (01:30 +0000)]
Set dso_local on runtime variables.

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

6 years agoRevert r326782 "[analyzer] CStringChecker.cpp: Remove the duplicated check...".
Artem Dergachev [Wed, 21 Mar 2018 00:57:37 +0000 (00:57 +0000)]
Revert r326782 "[analyzer] CStringChecker.cpp: Remove the duplicated check...".

It seems that the refactoring was causing a functional change and some warnings
have disappeared.

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

6 years ago[analyzer] Suppress more MallocChecker positives in smart pointer destructors.
Artem Dergachev [Wed, 21 Mar 2018 00:49:47 +0000 (00:49 +0000)]
[analyzer] Suppress more MallocChecker positives in smart pointer destructors.

r326249 wasn't quite enough because we often run out of inlining stack depth
limit and for that reason fail to see the atomics we're looking for.

Add a more straightforward false positive suppression that is based on the name
of the class. I.e. if we're releasing a pointer in a destructor of a "something
shared/intrusive/reference/counting something ptr/pointer something", then any
use-after-free or double-free that occurs later would likely be a false
positive.

rdar://problem/38013606

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

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

6 years ago[Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Wed, 21 Mar 2018 00:14:43 +0000 (00:14 +0000)]
[Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[Modules] Honor -fmodule-name when handling private framework modules
Bruno Cardoso Lopes [Tue, 20 Mar 2018 22:36:39 +0000 (22:36 +0000)]
[Modules] Honor -fmodule-name when handling private framework modules

When skipping building the module for a private framework module,
LangOpts.CurrentModule isn't enough for implict modules builds; for
instance, in case a private module is built while building a public one,
LangOpts.CurrentModule doesn't reflect the -fmodule-name being passed
down, but instead the module name which triggered the build.

Store the actual -fmodule-name in LangOpts.ModuleName and actually
check a name was provided during compiler invocation in order to
skip building the private module.

rdar://problem/38434694

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

6 years agoChange ImplicitConverionKind comments to refer to C++ stable names[NFC]
Erich Keane [Tue, 20 Mar 2018 22:05:01 +0000 (22:05 +0000)]
Change ImplicitConverionKind comments to refer to C++ stable names[NFC]

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

6 years agoDelete BuiltinCC. NFC.
Rafael Espindola [Tue, 20 Mar 2018 22:02:57 +0000 (22:02 +0000)]
Delete BuiltinCC. NFC.

It is always identical to RuntimeCC.

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

6 years agoAdd CHECKs for a few declarations. NFC.
Rafael Espindola [Tue, 20 Mar 2018 21:54:14 +0000 (21:54 +0000)]
Add CHECKs for a few declarations. NFC.

We were just missing test coverage for this.

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

6 years ago[format] Eliminate global destructors.
Benjamin Kramer [Tue, 20 Mar 2018 21:52:19 +0000 (21:52 +0000)]
[format] Eliminate global destructors.

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

6 years ago[Driver] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Tue, 20 Mar 2018 21:08:59 +0000 (21:08 +0000)]
[Driver] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[format] Initialize regex lazily
Benjamin Kramer [Tue, 20 Mar 2018 20:43:12 +0000 (20:43 +0000)]
[format] Initialize regex lazily

No need to pay for this on program startup, and also no need to destroy
it on process end.

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

6 years agoSet dso_local on string literals.
Rafael Espindola [Tue, 20 Mar 2018 20:42:55 +0000 (20:42 +0000)]
Set dso_local on string literals.

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

6 years ago[AArch64] Add vmulxh_lane fp16 vector intrinsic
Abderrazek Zaafrani [Tue, 20 Mar 2018 20:37:31 +0000 (20:37 +0000)]
[AArch64] Add vmulxh_lane fp16 vector intrinsic

https://reviews.llvm.org/D44591

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

6 years agoSet dso_local for runtime function.
Rafael Espindola [Tue, 20 Mar 2018 20:27:30 +0000 (20:27 +0000)]
Set dso_local for runtime function.

This is another case where there is special logic for adding dllimport
and so we cannot use setGVProperties.

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

6 years agoBasic: support PreserveMost and PreserveAll on Windows ARM
Saleem Abdulrasool [Tue, 20 Mar 2018 17:33:26 +0000 (17:33 +0000)]
Basic: support PreserveMost and PreserveAll on Windows ARM

Do not ignore these calling conventions on Windows ARM.  They are used
by the swift runtime for certain calls.

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

6 years ago[NVPTX] Make tensor load/store intrinsics overloaded.
Artem Belevich [Tue, 20 Mar 2018 17:18:59 +0000 (17:18 +0000)]
[NVPTX] Make tensor load/store intrinsics overloaded.

This way we can support address-space specific variants without explicitly
encoding the space in the name of the intrinsic. Less intrinsics to deal with ->
less boilerplate.

Added a bit of tablegen magic to match/replace an intrinsics with a pointer
argument in particular address space with the space-specific instruction
variant.

Updated tests to use non-default address spaces.

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

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

6 years agoSet dso_local for CFConstantStringClassReference.
Rafael Espindola [Tue, 20 Mar 2018 15:48:00 +0000 (15:48 +0000)]
Set dso_local for CFConstantStringClassReference.

This one cannot use setGVProperties since it has special logic for
when it is dllimport or not.

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

6 years agoSet dso_local for guid decls.
Rafael Espindola [Tue, 20 Mar 2018 15:42:58 +0000 (15:42 +0000)]
Set dso_local for guid decls.

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

6 years ago[OPENMP, NVPTX] Codegen for target distribute parallel combined
Alexey Bataev [Tue, 20 Mar 2018 15:41:05 +0000 (15:41 +0000)]
[OPENMP, NVPTX] Codegen for target distribute parallel combined
constructs in generic mode.

Fixed codegen for distribute parallel combined constructs. We have to
pass and read the shared lower and upper bound from the distribute
region in the inner parallel region. Patch is for generic mode.

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

6 years ago[clang-format] Fix ObjC selectors with multiple params passed to macro
Ben Hamilton [Tue, 20 Mar 2018 14:53:25 +0000 (14:53 +0000)]
[clang-format] Fix ObjC selectors with multiple params passed to macro

Summary:
Objective-C selectors with arguments take the form of:

foo:
foo:bar:
foo:bar:baz:

These can be passed to a macro, like NS_SWIFT_NAME():

https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html

and must never have spaces inserted around the colons.

Previously, there was logic in TokenAnnotator's tok::colon parser to
handle the single-argument case, but it failed for the
multiple-argument cases.

This diff fixes the bug and adds more tests.

Test Plan: New tests added. Ran tests with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: jolesiak, djasper, Wizard

Reviewed By: jolesiak, Wizard

Subscribers: klimek, cfe-commits

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

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

6 years ago[OPENMP, NVPTX] Globalization of the private redeclarations.
Alexey Bataev [Tue, 20 Mar 2018 14:45:59 +0000 (14:45 +0000)]
[OPENMP, NVPTX] Globalization of the private redeclarations.

If the generic codegen is enabled and private copy of the original
variable escapes the declaration context, this private copy should be
globalized just like it was the original variable.

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

6 years agoBackport changes from llvm/.clang_tidy to clang/.clang_tidy configs
Ilya Biryukov [Tue, 20 Mar 2018 14:39:12 +0000 (14:39 +0000)]
Backport changes from llvm/.clang_tidy to clang/.clang_tidy configs

Summary: LLVM .clang_tidy seems to be more up-to-date.

Reviewers: alexfh, simark

Reviewed By: alexfh

Subscribers: simark, cfe-commits

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

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

6 years ago[analyzer] Fix the crash in IteratorChecker.cpp when 'SymbolConjured' has a null...
Henry Wong [Tue, 20 Mar 2018 09:27:02 +0000 (09:27 +0000)]
[analyzer] Fix the crash in IteratorChecker.cpp when 'SymbolConjured' has a null Stmt.

When the loop has a null terminator statement and sets 'widen-loops=true', 'invalidateRegions' will constructs the 'SymbolConjured' with null 'Stmt'. And this will lead to a crash in 'IteratorChecker.cpp'. This patch use 'dyn_cast_or_null<>' instead of 'dyn_cast<>' in IteratorChecker.cpp.

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

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

6 years ago[ms] Parse #pragma optimize and ignore it behind its own flag
Hans Wennborg [Tue, 20 Mar 2018 08:53:11 +0000 (08:53 +0000)]
[ms] Parse #pragma optimize and ignore it behind its own flag

This allows users to turn off warnings about this pragma specifically,
while still receiving warnings about other ignored pragmas.

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

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

6 years agoProperly construct `inline` members without initializers
George Burgess IV [Tue, 20 Mar 2018 03:27:44 +0000 (03:27 +0000)]
Properly construct `inline` members without initializers

Digging through commit logs, it appears the checks in this block predate
`inline` class variables. With them, we fail to emit dynamic
initializers for members that don't have an explicit initializer, and we
won't go out of our way to instantiate the class denoted by
`Var->getType()`.

Fixes PR35599.

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

6 years ago[CodeGen] Ignore OpaqueValueExprs that are unique references to their
Akira Hatanaka [Tue, 20 Mar 2018 01:47:58 +0000 (01:47 +0000)]
[CodeGen] Ignore OpaqueValueExprs that are unique references to their
source expressions when iterating over a PseudoObjectExpr's semantic
subexpression list.

Previously the loop in emitPseudoObjectExpr would emit the IR for each
OpaqueValueExpr that was in a PseudoObjectExpr's semantic-form
expression list and use the result when the OpaqueValueExpr later
appeared in other expressions. This caused an assertion failure when
AggExprEmitter tried to copy the result of an OpaqueValueExpr and the
copied type didn't have trivial copy/move constructors or assignment
operators.

This patch adds flag IsUnique to OpaqueValueExpr which indicates it is a
unique reference to its source expression (it is not used in multiple
places). The loop in emitPseudoObjectExpr ignores OpaqueValueExprs that
are unique and CodeGen visitors simply traverse the source expressions
of such OpaqueValueExprs.

rdar://problem/34363596

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

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

6 years ago[analyzer] Improve performance of NoStoreFuncVisitor
George Karpenkov [Tue, 20 Mar 2018 01:16:46 +0000 (01:16 +0000)]
[analyzer] Improve performance of NoStoreFuncVisitor

Compute modifying frames lazily on demand.

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

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

6 years agoAllow builtins for Cross-DSO CFI on Android
Petr Hosek [Tue, 20 Mar 2018 00:56:08 +0000 (00:56 +0000)]
Allow builtins for Cross-DSO CFI on Android

This is needed to avoid the test failure in case when compiler-rt
is set as the default runtime library for Clang.

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

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

6 years ago[analyzer] Fix the assertion failure when static globals are used in lambda by reference
George Karpenkov [Tue, 20 Mar 2018 00:20:58 +0000 (00:20 +0000)]
[analyzer] Fix the assertion failure when static globals are used in lambda by reference

Also use the opportunity to clean up the code and remove unnecessary duplication.

rdar://37625895

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

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

6 years ago[CodeGen] Add funclet token to ARC marker
Shoaib Meenai [Mon, 19 Mar 2018 19:34:39 +0000 (19:34 +0000)]
[CodeGen] Add funclet token to ARC marker

The inline assembly generated for the ARC autorelease elision marker
must have a funclet token if it's emitted inside a funclet, otherwise
the inline assembly (and all subsequent code in the funclet) will be
marked unreachable. r324689 fixed this issue for regular inline assembly
blocks.

Note that clang only emits the marker at -O0, so this only fixes that
case. The optimizations case (where the marker is emitted by the
backend) will be fixed in a separate change.

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

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

6 years ago[OPENMP, NVPTX] Reworked castToType() function, NFC.
Alexey Bataev [Mon, 19 Mar 2018 17:53:56 +0000 (17:53 +0000)]
[OPENMP, NVPTX] Reworked castToType() function, NFC.

Reworked function castToType to use more frontend functionality rather
than the backend.

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

6 years ago[ObjC] Allow declaring __weak pointer fields in C structs in ARC.
Akira Hatanaka [Mon, 19 Mar 2018 17:38:40 +0000 (17:38 +0000)]
[ObjC] Allow declaring __weak pointer fields in C structs in ARC.

This patch uses the infrastructure added in r326307 for enabling
non-trivial fields to be declared in C structs to allow __weak fields in
C structs in ARC.

This recommits r327206, which was reverted because it caused
module-enabled builders to fail. I discovered that the
CXXRecordDecl::CanPassInRegisters flag wasn't being set correctly in
some cases after I moved it to RecordDecl.

Thanks to Eric Liu for helping me investigate the bug.

rdar://problem/33599681

https://reviews.llvm.org/D44095

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

6 years ago[OPENMP] Fix build with MSVC, NFC.
Alexey Bataev [Mon, 19 Mar 2018 17:18:13 +0000 (17:18 +0000)]
[OPENMP] Fix build with MSVC, NFC.

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

6 years ago[OPENMP, NVPTX] Emit correct thread id.
Alexey Bataev [Mon, 19 Mar 2018 17:04:07 +0000 (17:04 +0000)]
[OPENMP, NVPTX] Emit correct thread id.

We emitted fake thread id for the outined function in NVPTX codegen.
Patch adds emission of the real thread id.

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

6 years ago[Driver] Avoid invalidated iterator in insertTargetAndModeArgs
Serge Pavlov [Mon, 19 Mar 2018 16:13:43 +0000 (16:13 +0000)]
[Driver] Avoid invalidated iterator in insertTargetAndModeArgs

Doing an .insert() can potentially invalidate iterators by reallocating the
vector's storage. When all the stars align just right, this causes segfaults
or glibc aborts.

Gentoo Linux bug (crashes while building Chromium): https://bugs.gentoo.org/650082.

Patch by Hector Martin!

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

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

6 years ago[clang-format] Remove empty lines before }[;] // comment
Krasimir Georgiev [Mon, 19 Mar 2018 15:33:40 +0000 (15:33 +0000)]
[clang-format] Remove empty lines before }[;] // comment

Summary:
This addresses bug 36766 and a FIXME in tests about empty lines before
`}[;] // comment` lines.

Subscribers: klimek, cfe-commits

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

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

6 years ago[CMake] Use libc++ and compiler-rt as default libraries in Fuchsia toolchain
Petr Hosek [Mon, 19 Mar 2018 15:19:19 +0000 (15:19 +0000)]
[CMake] Use libc++ and compiler-rt as default libraries in Fuchsia toolchain

Fuchsia already defaults to libc++ and compiler-rt, but we want to use
these as default runtimes even on the host platform.

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

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

6 years agoUpdated a usage of createTemporaryFile that does not expect file to be created.
Ilya Biryukov [Mon, 19 Mar 2018 14:20:25 +0000 (14:20 +0000)]
Updated a usage of createTemporaryFile that does not expect file to be created.

Summary:
This fixes a usage of createTemporaryFile in clang repo after
a change in llvm repo.

Reviewers: klimek, bkramer, krasimir, espindola, ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

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

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

6 years ago[ARM] Pass half or i16 types for NEON intrinsics
Sjoerd Meijer [Mon, 19 Mar 2018 13:22:49 +0000 (13:22 +0000)]
[ARM] Pass half or i16 types for NEON intrinsics

For generating NEON intrinsics, this determines the NEON data type, and whether
it should be a half type or an i16 type. I.e., we always pass a half type for
AArch64, this hasn't changed, but now also for ARM but only when FullFP16 is
enabled, and i16 otherwise.

This is intended to be non-functional change, but together with the backend
work in D44538 which adds support for f16 vectors, this enables adding the
AArch32 FP16 (vector) intrinsics.

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

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

6 years agoResolve unused variable 'VR' warning in RetainCountChecker.cpp
Bjorn Pettersson [Sun, 18 Mar 2018 16:07:20 +0000 (16:07 +0000)]
Resolve unused variable 'VR' warning in RetainCountChecker.cpp

Getting rid of
  error: unused variable 'VR' [-Werror,-Wunused-variable]
warning/error at
  lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp:1933

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

6 years ago[dsymutil] Rename llvm-dsymutil -> dsymutil
Jonas Devlieghere [Sun, 18 Mar 2018 11:38:41 +0000 (11:38 +0000)]
[dsymutil] Rename llvm-dsymutil -> dsymutil

Now that almost all functionality of Apple's dsymutil has been
upstreamed, the open source variant can be used as a drop in
replacement. Hence we feel it's no longer necessary to have the llvm
prefix.

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

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

6 years ago[C++17] Allow an empty expression in an if init statement
Zhihao Yuan [Sat, 17 Mar 2018 21:42:10 +0000 (21:42 +0000)]
[C++17] Allow an empty expression in an if init statement

Summary:
This fixes [PR35381](https://llvm.org/pr35381) and an additional bug where clang didn't warn about the C++17 extension when having an expression in the init statement.

Thanks Nicolas Lesser for contributing the patch.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: erik.pilkington, cfe-commits

Tags: #clang

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

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

6 years agoImplement DR2229, which prohibits unnamed bit-fields from having qualifiers in C++.
Aaron Ballman [Sat, 17 Mar 2018 21:08:40 +0000 (21:08 +0000)]
Implement DR2229, which prohibits unnamed bit-fields from having qualifiers in C++.

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

6 years agoFix codegen for structured binding binding in conditions
Zhihao Yuan [Sat, 17 Mar 2018 21:01:27 +0000 (21:01 +0000)]
Fix codegen for structured binding binding in conditions

Summary:
The codegen for conditions assumes that a normal variable declaration is used in a condition, but this is not the case when a structured binding is used.

This fixes [PR36747](http://llvm.org/pr36747).

Thanks Nicolas Lesser for contributing the patch.

Reviewers: lichray, rsmith

Reviewed By: lichray

Subscribers: cfe-commits

Tags: #clang

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

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

6 years ago[Driver] Fix the descriptions for -Tdata and -Ttext options
Aaron Smith [Sat, 17 Mar 2018 15:24:35 +0000 (15:24 +0000)]
[Driver] Fix the descriptions for -Tdata and -Ttext options

Reviewers: llvm-commits

Subscribers: cfe-commits

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

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

6 years ago[cxx_status] Add entry for the Reflection TS.
Richard Smith [Sat, 17 Mar 2018 14:34:21 +0000 (14:34 +0000)]
[cxx_status] Add entry for the Reflection TS.

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

6 years ago[cxx_status] Update to match Jacksonville 2018 motions.
Richard Smith [Sat, 17 Mar 2018 14:28:47 +0000 (14:28 +0000)]
[cxx_status] Update to match Jacksonville 2018 motions.

Also rearrange how we list DR motions: rather than listing them as part of some
later standard, list them against the feature they are a DR against. Explicitly
add a description of how we handle DRs.

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