Commit Graph

70101 Commits

Author SHA1 Message Date
Krasimir Georgiev fe268fc1c8 [clang-format] Break non-trailing block comments
Summary:
This patch is an alternative to https://reviews.llvm.org/D36614, by resolving a
non-idempotency issue by breaking non-trailing comments:

Consider formatting the following code with column limit at `V`:
```
                    V
const /* comment comment */ A = B;
```
The comment is not a trailing comment, breaking before it doesn't bring it under
the column limit. The formatter breaks after it, resulting in:

```
                    V
const /* comment comment */
    A = B;
```
For a next reformat, the formatter considers the comment as a trailing comment,
so it is free to break it further, resulting in:

```
                    V
const /* comment
         comment */
    A = B;
```
This patch improves the situation by directly producing the third case.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 311457
2017-08-22 14:40:05 +00:00
Krasimir Georgiev 5fb51ddf29 [clang-format] Fix lines regression in clang-format.py
Summary:
This patch fixes a regression after https://reviews.llvm.org/rL305665,
which updates the structure of the `lines` variable.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 311456
2017-08-22 14:28:01 +00:00
Petar Jovanovic 9d1c094670 [mips] Rename getSupportedNanEncoding() to getIEEE754Standard()
Rename the function getSupportedNanEncoding() to getIEEE754Standard(), since
this function will be used for non-nan related features.

Patch by Aleksandar Beserminji.

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

llvm-svn: 311454
2017-08-22 13:35:27 +00:00
Erik Verbruggen aa603c3bef Revert r311442 (Fix templated type alias completion when using global completion cache)
Failing Tests (2):
    Clang :: CXX/dcl.dcl/dcl.spec/dcl.type/p3-0x.cpp
    Clang :: SemaCXX/alias-template.cpp

llvm-svn: 311445
2017-08-22 10:54:40 +00:00
Alex Lorenz 34d070f3e5 [ObjC] Check written attributes only when synthesizing ambiguous property
This commit fixes a bug introduced in r307903. The attribute ambiguity checker
that was introduced in r307903 checked all property attributes, which caused
errors for source-compatible properties, like:

@property (nonatomic, readonly) NSObject *prop;
@property (nonatomic, readwrite) NSObject *prop;

because the readwrite property would get implicit 'strong' attribute. The
ambiguity checker should be concerned about explicitly specified attributes
only.

rdar://33748089

llvm-svn: 311443
2017-08-22 10:38:07 +00:00
Erik Verbruggen 1ca8bbb078 Fix templated type alias completion when using global completion cache
When we have enabled cache for global completions we did not have
diagnostics for Bar and could not complete Ba as in provided code
example.

template <typename T>
struct Foo { T member; };

template<typename T> using Bar = Foo<T>;

int main() {
    Ba
}

Patch by Ivan Donchevskii!

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

llvm-svn: 311442
2017-08-22 10:25:48 +00:00
Johannes Altmanninger bc7d817c22 [clang-diff] Fix getRelativeName
Handle the case when DeclContext is null.

llvm-svn: 311434
2017-08-22 08:59:13 +00:00
Johannes Altmanninger 2b955ffaed [clang-diff] Use the relative name for NamedDecl
Summary:
If a node referring to a name is within a class or namespace, do not use
the full qualified name, but strip the namespace prefix.

Reviewers: arphaman, bkramer

Subscribers: klimek

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

llvm-svn: 311433
2017-08-22 08:56:26 +00:00
Vitaly Buka 46f15d3788 Update libprotobuf-mutator revision
llvm-svn: 311428
2017-08-22 05:18:28 +00:00
George Karpenkov 5509c73a14 Test fix: only add shared libraries to rpath.
llvm-svn: 311422
2017-08-22 02:10:53 +00:00
George Karpenkov a2f383d072 Fixed driver tests for -fsanitize=fuzzer.
llvm-svn: 311412
2017-08-22 00:04:05 +00:00
George Karpenkov 9f6f74c2c5 Moving libFuzzer to compiler-rt: required updates to the Clang driver.
Differential Revision: https://reviews.llvm.org/D36909

llvm-svn: 311406
2017-08-21 23:25:19 +00:00
Akira Hatanaka a423cb431d [Driver][Darwin] Do not pass -munwind-table if -fno-excpetions is
supplied.

With this change, -fno-exceptions disables unwind tables unless
-funwind-tables is supplied too or the target is x86-64 (x86-64 requires
emitting unwind tables).

rdar://problem/33934446

llvm-svn: 311397
2017-08-21 22:46:46 +00:00
Stephan T. Lavavej 4c30b74390 [Driver] Recognize DevDiv internal builds of MSVC, with a different directory structure.
This is a reasonably non-intrusive change, which I've verified
works for both x86 and x64 DevDiv-internal builds.

The idea is to change `bool IsVS2017OrNewer` into a 3-state
`ToolsetLayout VSLayout`. Either a build is DevDiv-internal,
released VS 2017 or newer, or released VS 2015 or older. When looking at
the directory structure, if instead of `"VC"` we see `"x86ret"`, `"x86chk"`,
`"amd64ret"`, or `"amd64chk"`, we recognize this as a DevDiv-internal build.

After we get past the directory structure validation, we use this knowledge
to regenerate paths appropriately. `llvmArchToDevDivInternalArch()` knows how
we use `"i386"` subdirectories, and `MSVCToolChain::getSubDirectoryPath()`
uses that. It also knows that DevDiv-internal builds have an `"inc"`
subdirectory instead of `"include"`.

This may still not be the "right" fix in any sense, but I believe that it's
non-intrusive in the sense that if the special directory names aren't found,
no codepaths are affected. (`ToolsetLayout::OlderVS` and
`ToolsetLayout::VS2017OrNewer` correspond to `IsVS2017OrNewer` being `false`
or `true`, respectively.) I searched for all references to `IsVS2017OrNewer`,
which are places where Clang cares about VS's directory structure, and the
only one that isn't being patched is some logic to deal with
cross-compilation. I'm fine with that not working for DevDiv-internal builds
for the moment (we typically test the native compilers), so I added a comment.

Fixes D36860.

llvm-svn: 311391
2017-08-21 22:19:33 +00:00
Kamil Rytarowski d986545df6 Enable libfuzzer on NetBSD/amd64
Summary:
Enable SanitizerKind::Fuzzer and SanitizerKind::FuzzerNoLink on x86_64.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, kcc, vitalybuka, george.karpenkov

Reviewed By: vitalybuka

Subscribers: cfe-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 311365
2017-08-21 19:12:14 +00:00
Sam Elliott 2307905561 [clang] Fix tests for Emitting Single Inline Remark
Summary: This change depends on https://reviews.llvm.org/D36054 and should be landed at the same time.

Reviewers: anemet

Reviewed By: anemet

Subscribers: cfe-commits

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

llvm-svn: 311347
2017-08-21 16:40:35 +00:00
Peter Szecsi 3c3e1b0b54 [StaticAnalyzer] LoopUnrolling: Track a LoopStack in order to completely unroll specific loops
The LoopExit CFG information provides the opportunity to not mark the loops but
having a stack which tracks if a loop is unrolled or not. So in case of
simulating a loop we just add it and the information if it meets the
requirements to be unrolled to the top of the stack.

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

llvm-svn: 311346
2017-08-21 16:32:57 +00:00
Matt Morehouse bf6c9bb84b [clang-proto-fuzzer] Update README.
Add instructions on how to modify the compiler invocation.

llvm-svn: 311345
2017-08-21 16:18:43 +00:00
Peter Szecsi 4aa5e10fcc [StaticAnalyzer] Handle LoopExit CFGElement in the analyzer
This patch adds handling of the LoopExit CFGElements to the StaticAnalyzer.
This is reached by introducing a new ProgramPoint.
Tests will be added in a following commit.

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

llvm-svn: 311344
2017-08-21 16:10:19 +00:00
Simon Atanasyan 29706f24e2 [mips] Remove checking of the redundant condition. NFC
llvm-svn: 311334
2017-08-21 14:08:29 +00:00
Ilya Biryukov f315000613 Fixed a crash on replaying Preamble's PP conditional stack.
Summary:
The crash occurs when the first token after a preamble is a macro
expansion.
Fixed by moving replayPreambleConditionalStack from Parser into
Preprocessor. It is now called right after the predefines file is
processed.

Reviewers: erikjv, bkramer, klimek, yvvan

Reviewed By: bkramer

Subscribers: cfe-commits

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

llvm-svn: 311330
2017-08-21 12:03:08 +00:00
Oliver Stannard 7f18864473 [ObjC] Use consistent comment style in inline asm
The comment markers accepted by the assembler vary between different targets,
but '//' is always accepted, so we should use that for consistency.

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

llvm-svn: 311325
2017-08-21 09:54:46 +00:00
Sam Parker ffccda6303 [ARM][AArch64] Cortex-A75 and Cortex-A55 tests
Add frontend tests for Cortex-A75 and Cortex-A55, Arm's latest
big.LITTLE A-class cores. They implement the ARMv8.2-A architecture,
including the cryptography and RAS extensions, plus the optional dot
product extension. They also implement the RCpc AArch64 extension
from ARMv8.3-A.

Cortex-A75:
https://developer.arm.com/products/processors/cortex-a/cortex-a75

Cortex-A55:
https://developer.arm.com/products/processors/cortex-a/cortex-a55

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

llvm-svn: 311319
2017-08-21 08:52:45 +00:00
Johannes Altmanninger d6491f2c4a Allow thiscall attribute in test/Tooling/clang-diff-ast.cpp
llvm-svn: 311301
2017-08-20 20:13:33 +00:00
Johannes Altmanninger 0dd86dc5f1 [clang-diff] Improve and test getNodeValue
Summary: Use qualified names if available.

Reviewers: arphaman

Subscribers: klimek

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

llvm-svn: 311292
2017-08-20 16:18:43 +00:00
Benjamin Kramer bffdf4ce93 [ODRHash] Move into anonymous namespace. NFC.
llvm-svn: 311286
2017-08-20 13:02:57 +00:00
Johannes Altmanninger d196930799 [clang-diff] Fix similarity computation
Summary:
Add separate tests for the top-down and the bottom-up phase, as well as
one for the optimal matching.

Reviewers: arphaman

Subscribers: klimek

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

llvm-svn: 311284
2017-08-20 12:09:07 +00:00
Johannes Altmanninger d5b56a8619 [clang-diff] Filter AST nodes
Summary:
Ignore macros and implicit AST nodes, as well as anything outside of the
main source file.

Reviewers: arphaman

Subscribers: klimek

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

llvm-svn: 311280
2017-08-20 10:22:32 +00:00
NAKAMURA Takumi 6adf81b1d5 clang/test/Tooling/clang-diff-ast.cpp: Satisfy thiscall.
clang/test/Tooling/clang-diff-ast.cpp:45:12: error: expected string not found in input
   // CHECK: CXXConstructorDecl: X(void (char, int))
             ^
  <stdin>:43:25: note: scanning from here
   AccessSpecDecl: public(42)
                          ^
  <stdin>:44:2: note: possible intended match here
   CXXConstructorDecl: X(void (char, int) __attribute__((thiscall)))(43)
   ^

llvm-svn: 311270
2017-08-20 00:02:20 +00:00
Johannes Altmanninger 51321aef8e [clang-diff] Simplify mapping
Summary:
Until we find a decent heuristic on how to choose between multiple
identical trees, there is no point in supporting multiple mappings.

This also enables matching of nodes with parents of different types,
because there are many instances where this is appropriate.  For
example for and foreach statements; functions in the global or
other namespaces.

Reviewers: arphaman

Subscribers: klimek

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

llvm-svn: 311251
2017-08-19 17:53:01 +00:00
Johannes Altmanninger 4933a6a2b2 Add clang-diff to tool_patterns in test/lit.cfg
llvm-svn: 311250
2017-08-19 17:52:29 +00:00
Johannes Altmanninger e1a89fbf6d [clang-diff] Fix compiler warning
llvm-svn: 311249
2017-08-19 17:12:25 +00:00
Johannes Altmanninger a29d6aeced [clang-diff] Add HTML side-by-side diff output
Reviewers: arphaman

Subscribers: mgorny

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

llvm-svn: 311241
2017-08-19 15:40:45 +00:00
Johannes Altmanninger 14be1839e8 [clang-diff] Fix warning about useless comparison
llvm-svn: 311240
2017-08-19 13:29:44 +00:00
Johannes Altmanninger 683876ca6d [clang-diff] Make printing of matches optional
Reviewers: arphaman

Subscribers: klimek

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

llvm-svn: 311237
2017-08-19 12:04:04 +00:00
Peter Szecsi 999a25ff72 [CFG] Add LoopExit information to CFG
This patch introduces a new CFG element CFGLoopExit that indicate when a loop
ends. It does not deal with returnStmts yet (left it as a TODO).
It hidden behind a new analyzer-config flag called cfg-loopexit (false by
default).
Test cases added.

The main purpose of this patch right know is to make loop unrolling and loop
widening easier and more efficient. However, this information can be useful for
future improvements in the StaticAnalyzer core too.

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

llvm-svn: 311235
2017-08-19 11:19:16 +00:00
Peter Szecsi 8de103f2f0 [StaticAnalyzer] LoopUnrolling: Exclude cases where the counter is escaped before the loop
Adding escape check for the counter variable of the loop.
It is achieved by jumping back on the ExplodedGraph to its declStmt.

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

llvm-svn: 311234
2017-08-19 10:24:52 +00:00
Johannes Altmanninger c58ac104d1 [clang-diff] Fix test
llvm-svn: 311233
2017-08-19 10:05:24 +00:00
Johannes Altmanninger a1d2b5d54f [clang-diff] Add option to dump the AST, one node per line
Summary:
This is done with -ast-dump; the JSON variant has been renamed to
-ast-dump-json.

Reviewers: arphaman

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

llvm-svn: 311232
2017-08-19 09:36:14 +00:00
Faisal Vali 8194a3e975 [c++2a] Implement P0409R2 - Allow lambda capture [=,this] (by hamzasood)
This patch, by hamzasood, implements P0409R2, and allows [=, this] pre-C++2a as an extension (with appropriate warnings) for consistency.

https://reviews.llvm.org/D36572

Thanks Hamza!

llvm-svn: 311224
2017-08-19 03:43:07 +00:00
Johannes Altmanninger e0fe5cd4f3 Revert "Revert "[clang-diff] Move printing of matches and changes to clang-diff""
Fix build by renaming ChangeKind -> Change

This reverts commit 0c78c5729f29315d7945988efd048c0cb86c07ce.

llvm-svn: 311222
2017-08-19 02:56:35 +00:00
Johannes Altmanninger b2d26c303e [clang-diff] Fix test for python 3
llvm-svn: 311220
2017-08-19 01:34:24 +00:00
Johannes Altmanninger 0da12c841a Revert "Revert "[clang-diff] Move the JSON export function to clang-diff""
This reverts commit eac4c13ac9ea8f12bc049e040c7b9c8a517f54e7, the
original commit *should* not have caused the build failure.

llvm-svn: 311216
2017-08-19 00:57:38 +00:00
Vlad Tsyrklevich deb2a2adc8 Revert "[clang-diff] Move the JSON export function to clang-diff"
This reverts commit r311199, it was causing widespread build failures.

llvm-svn: 311211
2017-08-18 23:21:11 +00:00
Vlad Tsyrklevich ebcb773f7d Revert "[clang-diff] Move printing of matches and changes to clang-diff"
This reverts commit r311200, it was causing widespread build failures.

llvm-svn: 311210
2017-08-18 23:21:10 +00:00
Johannes Altmanninger 69774d67c8 [clang-diff] Move printing of matches and changes to clang-diff
Summary:
This also changes the output order of the changes. Now the matches are
printed in pre-order, intertwined with insertions, updates, and moves.
Deletions are printed afterwards.

Reviewers: arphaman

Subscribers: klimek

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

llvm-svn: 311200
2017-08-18 21:26:34 +00:00
Johannes Altmanninger 0ad4cc61ac [clang-diff] Move the JSON export function to clang-diff
Reviewers: arphaman

Subscribers: klimek

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

llvm-svn: 311199
2017-08-18 21:26:13 +00:00
Erik Pilkington ba87c626f9 [Sema] Don't emit -Wunguarded-availability for switch cases
This made it awkward to switch over an enum where some entries
are partial and is unlikley to catch any bugs.

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

llvm-svn: 311191
2017-08-18 20:20:56 +00:00
Matt Morehouse 5c7fc76983 [SanitizerCoverage] Add stack depth tracing instrumentation.
Summary:
Augment SanitizerCoverage to insert maximum stack depth tracing for
use by libFuzzer.  The new instrumentation is enabled by the flag
-fsanitize-coverage=stack-depth and is compatible with the existing
trace-pc-guard coverage.  The user must also declare the following
global variable in their code:
  thread_local uintptr_t __sancov_lowest_stack

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

Reviewers: vitalybuka, kcc

Reviewed By: vitalybuka

Subscribers: kubamracek, hiraditya, cfe-commits, llvm-commits

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

llvm-svn: 311186
2017-08-18 18:43:30 +00:00
Matt Morehouse 6178cfaf7b [clang-proto-fuzzer] Allow user-specified compiler arguments.
Summary:
Arguments can be specified after -ignore_remaining_args=1 to modify
the compiler invocation.  For example, the following command-line
will fuzz LLVM with a custom optimization level and target triple:
  clang-proto-fuzzer CORPUS/ -ignore_remaining_args -O3 \
      -triple arm64-apple-ios9

Reviewers: vitalybuka, kcc

Reviewed By: vitalybuka

Subscribers: aemerson, cfe-commits, kristof.beyls

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

llvm-svn: 311185
2017-08-18 18:34:39 +00:00
Alexander Shaposhnikov 291d658e19 [analyzer] Fix modeling of constructors
This diff fixes analyzer's crash (triggered assert) on the newly added test case.
The assert being discussed is assert(!B.lookup(R, BindingKey::Direct))
in lib/StaticAnalyzer/Core/RegionStore.cpp, however the root cause is different.
For classes with empty bases the offsets might be tricky.
For example, let's assume we have
 struct S: NonEmptyBase, EmptyBase {
     ...
 };
In this case Clang applies empty base class optimization and 
the offset of EmptyBase will be 0, it can be verified via
clang -cc1 -x c++ -v -fdump-record-layouts main.cpp -emit-llvm -o /dev/null.
When the analyzer tries to perform zero initialization of EmptyBase
it will hit the assert because that region
has already been "written" by the constructor of NonEmptyBase.

Test plan:
make check-all

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

llvm-svn: 311182
2017-08-18 18:20:43 +00:00
Konstantin Zhuravlyov 0ebd9e18ef AMDGPU: Rename r600-mcpu.cl->amdgpu-mcpu.cl
llvm-svn: 311178
2017-08-18 17:29:07 +00:00
Johannes Altmanninger 849f20e4a2 [clang-diff] Add commandline arguments.
Summary:
Support command line options for build path and extra arguments
This emulates the options accepted by clang tools that use CommonOptionsParser.

Add a flag for controlling the maximum size parameter for bottom up matching.

Reviewers: arphaman

Subscribers: klimek

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

llvm-svn: 311173
2017-08-18 16:34:22 +00:00
Johannes Altmanninger fa524d7b24 [clang-diff] Fix some errors and inconsistencies
Fix to the computation of the rightmost descendant.

Prevents root nodes from being mapped if they are already mapped.  This
only makes a difference when we compare AST Nodes other than entire
translation units, a feature which still has to be tested.

Reviewers: arphaman

Subscribers: klimek

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

llvm-svn: 311172
2017-08-18 16:34:15 +00:00
Johannes Altmanninger 5d2fd55fd9 [CommonOptionsParser] Expose ArgumentsAdjustingCompilationDatabase
This is useful for tools such as clang-diff which do not use
CommonOptionsParser due to the need for multiple compilation databases.

llvm-svn: 311170
2017-08-18 16:21:08 +00:00
Konstantin Zhuravlyov a42719406f AMDGPU: add missing amdgcn processors and tests
- gfx600
  - gfx601
  - gfx703
  - gfx902
  - gfx903

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

llvm-svn: 311141
2017-08-18 01:13:39 +00:00
Tim Northover b6a826bdc7 Revert r311137 (GlobalISel ABI commit).
It was committed by mistake since it was in the same monorepo as the
LLVM change I was working on.

llvm-svn: 311140
2017-08-18 00:33:24 +00:00
Tim Northover 48fff995d6 GlobalISel (AArch64): fix ABI at border between GPRs and SP.
If a struct would end up half in GPRs and half on SP the ABI says it should
actually go entirely on the stack. We were getting this wrong in GlobalISel
before, causing compatibility issues.

llvm-svn: 311137
2017-08-17 23:14:01 +00:00
Richard Smith 7cd577bb0d PR34161: support evaluation of 'void()' expressions in C++14 onwards.
llvm-svn: 311115
2017-08-17 19:35:50 +00:00
Alex Lorenz 98f9fcdb1b Unguarded availability diagnoser should use TraverseStmt instead of
Base::TraverseStmt when visiting the then/else branches of if statements

This ensures that the statement stack is correctly tracked and correct
multi-statement fixit is generated inside of an if (@available)

llvm-svn: 311088
2017-08-17 14:22:27 +00:00
Alex Lorenz 36070ed8d2 Print enum constant values using the original source formatting
if possible when creating "Declaration" nodes in XML comments

rdar://14765746

llvm-svn: 311085
2017-08-17 13:41:55 +00:00
Daniel Jasper a7e061f07b Fix undefined behavior that is caused by not always initializing a bool.
The fix in r310994 is incomplete, as moveFromAndCancel can set the
pointer without initializing OldIsSpeculativelyEvaluating.

llvm-svn: 311070
2017-08-17 06:33:46 +00:00
John McCall 99e5e98eec Further refactoring of the constant emitter. NFC.
llvm-svn: 311065
2017-08-17 05:03:55 +00:00
Devin Coughlin a179e171dc [analyzer] Add support for reference counting of parameters on the callee side
This commit adds the functionality of performing reference counting on the
callee side for Integer Set Library (ISL) to Clang Static Analyzer's
RetainCountChecker.

Reference counting on the callee side can be extensively used to perform
debugging within a function (For example: Finding leaks on error paths).

Patch by Malhar Thakkar!

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

llvm-svn: 311063
2017-08-17 04:19:07 +00:00
Ben Langmuir fd6e39c40b [index] Add indexing for unresolved-using declarations
In dependent contexts we end up referencing these, so make sure they
have USRs, and have their declarations indexed. For the most part they
behave like typedefs, but we also need to worry about having multiple
using declarations with the same "name".

rdar://problem/33883650

llvm-svn: 311053
2017-08-16 23:12:21 +00:00
George Burgess IV 03d5db48fc Fix typos in comments; NFC
llvm-svn: 311051
2017-08-16 22:44:17 +00:00
Hal Finkel e85a818add Don't use -no-integrated-as in test/Driver/opt-record.c
-no-integrated-as is not supported on some targets (e.g.,
x86_64-pc-windows-msvc). Testing using -save-temps is good enough to cover the
relevant logic, and that should work everywhere.

llvm-svn: 311043
2017-08-16 21:51:31 +00:00
Hal Finkel 67814df3ea Base optimization-record file names on the final output
Using Output.getFilename() to construct the file name used for optimization
recording in Clang::ConstructJob, when -c is provided, does not work correctly
if we're not using the integrated assembler. With -no-integrated-as (or
-save-temps) Output.getFilename() gives the name of the temporary assembly
file, not the final output file. Instead, use the final output (as provided by
-o). If this is not available, then fall back to using a name based on the
input file.

Fixes PR31532.

llvm-svn: 311041
2017-08-16 21:34:27 +00:00
Taewook Oh 0fb5b78892 Use the file name from linemarker for debug info if an input is preprocessed source.
Summary:
Even in the case of the input file is a preprocessed source, clang uses the file name of the preprocesses source for debug info (DW_AT_name attribute for DW_TAG_compile_unit). However, gcc uses the file name specified in the first linemarker instead. This makes more sense because the one specified in the linemarker represents the "actual" source file name.

Clang already uses the file name specified in the first linemarker for Module name (https://github.com/llvm-mirror/clang/blob/master/lib/Frontend/FrontendAction.cpp#L779) if the input is preprocessed. This patch makes clang to use the same value for debug info as well.

Reviewers: compnerd, rnk, dblaikie, rsmith

Reviewed By: rnk

Subscribers: aprantl, cfe-commits

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

llvm-svn: 311037
2017-08-16 19:36:24 +00:00
Petr Hosek 766288b191 [Driver] SafeStack does not need a runtime library on Fuchsia
Patch by Roland McGrath

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

llvm-svn: 311034
2017-08-16 19:06:05 +00:00
Petr Hosek 1ed7135e65 [CMake] Build sanitized C++ runtimes for Fuchsia
Differential Revision: https://reviews.llvm.org/D36349

llvm-svn: 311033
2017-08-16 19:06:04 +00:00
Alexey Bataev 8c3edfef6b [OPENMP] Fix for PR28581: OpenMP linear clause - wrong results.
If worksharing construct has at least one linear item, an implicit
synchronization point must be emitted to avoid possible conflict with
the loading/storing values to the original variables. Added implicit
barrier if the linear item is found before actual start of the
worksharing construct.

llvm-svn: 311013
2017-08-16 15:58:46 +00:00
Alexey Bataev aee18557f7 [OPRNMP] Fix for PR33445: ICE: OpenMP target containing ordered for.
If exceptions are enabled, there may be a problem with the codegen of
the finalization functions from OpenMP runtime. It happens because of
the problem with the getting of thread identifier value. Patch tries to
fix it by using the result of the call of function
__kmpc_global_thread_num() rather than loading of value of outlined
function parameter.

llvm-svn: 311007
2017-08-16 14:01:00 +00:00
Chandler Carruth bacb80d0d9 Fix a UBSan failure where this boolean was copied when uninitialized.
When r310905 moved the pointer and bool out of a PointerIntPair, it made
them end up uninitialized and caused UBSan failures when copying the
uninitialized boolean. However, making the pointer be null should avoid
the reference to the boolean entirely.

llvm-svn: 310994
2017-08-16 07:22:49 +00:00
Yaxun Liu 0c6374e513 Fix comments about __OPENCL_MEMORY_SCOPE_* macros
llvm-svn: 310986
2017-08-16 04:15:28 +00:00
Richard Smith 96cd671cd6 PR19668, PR23034: Fix handling of move constructors and deleted copy
constructors when deciding whether classes should be passed indirectly.

This fixes ABI differences between Clang and GCC:

 * Previously, Clang ignored the move constructor when making this
   determination. It now takes the move constructor into account, per
   https://github.com/itanium-cxx-abi/cxx-abi/pull/17 (this change may
   seem recent, but the ABI change was agreed on the Itanium C++ ABI
   list a long time ago).

 * Previously, Clang's behavior when the copy constructor was deleted
   was unstable -- depending on whether the lazy declaration of the
   copy constructor had been triggered, you might get different behavior.
   We now eagerly declare the copy constructor whenever its deletedness
   is unclear, and ignore deleted copy/move constructors when looking for
   a trivial such constructor.

This also fixes an ABI difference between Clang and MSVC:

 * If the copy constructor would be implicitly deleted (but has not been
   lazily declared yet), for instance because the class has an rvalue
   reference member, we would pass it directly. We now pass such a class
   indirectly, matching MSVC.

Based on a patch by Vassil Vassilev, which was based on a patch by Bernd
Schmidt, which was based on a patch by Reid Kleckner!

This is a re-commit of r310401, which was reverted in r310464 due to ARM
failures (which should now be fixed).

llvm-svn: 310983
2017-08-16 01:49:53 +00:00
Richard Smith c38d51f892 Add test that we get the correct calling convention and mangling for va_list.
llvm-svn: 310982
2017-08-16 01:46:46 +00:00
Richard Smith 55eb844259 Add missing test for warning added in r310803.
llvm-svn: 310978
2017-08-16 00:06:07 +00:00
Dan Albert 5671b890ea Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux."""
llvm-svn: 310977
2017-08-15 23:57:34 +00:00
Dan Albert 8afdd2f81e Revert "Add a target for new LTO plugin name tests."
llvm-svn: 310976
2017-08-15 23:57:32 +00:00
Richard Smith f26d551387 Do not look through pack expansions when looking for unexpanded parameter packs.
Fixes a selection of rejects-valids when pack-expanding a lambda that itself
contains a pack expansion.

llvm-svn: 310972
2017-08-15 22:58:45 +00:00
Dan Albert 255387650a Add a target for new LTO plugin name tests.
Not all targets will use -plugin with -flto. Pick a fixed target so
this works regardless of the default target (regardless of host OS,
the toolchain should be picking the correct LTO plugin for a target
that supports it).

llvm-svn: 310966
2017-08-15 22:10:44 +00:00
John McCall de0fe07eef Extract IRGen's constant-emitter into its own helper class and clean up
the interface.

The ultimate goal here is to make it easier to do some more interesting
things in constant emission, like emit constant initializers that have
ignorable side-effects, or doing the majority of an initialization
in-place and then patching up the last few things with calls.  But for
now this is mostly just a refactoring.

llvm-svn: 310964
2017-08-15 21:42:52 +00:00
John McCall f1ef796fd9 Allow the target field of a CK_ToUnion to be more easily recovered.
llvm-svn: 310963
2017-08-15 21:42:47 +00:00
John McCall 477b123ead Allow StmtVisitor visitation to be parameterized. NFC.
llvm-svn: 310962
2017-08-15 21:42:42 +00:00
Dan Albert fe9f1e60c5 Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""
Summary:
Relanding https://reviews.llvm.org/D35739 which was reverted because
it broke the tests on non-Linux. The tests have been fixed to be
platform agnostic, and additional tests have been added to make sure
that the plugin has the correct extension on each platform
(%pluginext doesn't work in CHECK lines).

Reviewers: srhines, pirama

Reviewed By: srhines

Subscribers: emaste, mehdi_amini, eraman, cfe-commits

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

llvm-svn: 310960
2017-08-15 21:31:17 +00:00
Stephen Hines 14ccaedbb8 Switch to consumeError(), since this can crash otherwise.
Summary:
If assertions are disabled, but LLVM_ABI_BREAKING_CHANGES is enabled,
this will cause an issue with an unchecked Success. Switching to
consumeError() is the correct way to bypass the check.

Reviewers: llvm-commits, cfe-commits, arphaman

Reviewed By: arphaman

Subscribers: arphaman, klimek, pirama

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

llvm-svn: 310958
2017-08-15 21:20:41 +00:00
Kuba Mracek cea6267cc6 Fixup for r310950: Also remove the new instance of %T from html-diags.c
llvm-svn: 310952
2017-08-15 19:54:04 +00:00
Kuba Mracek 5b57633a45 [clang] Get rid of "%T" expansions
The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t.

This patch removes %T in clang.

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

llvm-svn: 310950
2017-08-15 19:47:06 +00:00
Alexander Shaposhnikov ab0400d5af [clang] Code cleanup in clang/tooling
1. Add missing explicit for SymbolName constructor.
2. Add missing std::move in createRenameReplacements.

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

llvm-svn: 310948
2017-08-15 19:23:54 +00:00
Richard Smith 78a07ba438 PR33082: Improve tracking of unexpanded parameter packs within variadic generic lambdas.
llvm-svn: 310946
2017-08-15 19:11:21 +00:00
Yaxun Liu 504d4e2403 Attempt to fix failure in CodeGenOpenCL/atomic-ops.cl again
llvm-svn: 310937
2017-08-15 17:59:26 +00:00
Argyrios Kyrtzidis 478276271b [index] Update indexing to handle CXXDeductionGuideDecls properly
CXXDeductionGuideDecls can't be referenced so there's no need to output a symbol occurrence for them.
Also handle DeducedTemplateSpecializationTypeLocs in the TypeIndexer so we don't miss the symbol occurrences of the corresponding template decls.

Patch by Nathan Hawes!

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

llvm-svn: 310933
2017-08-15 17:20:37 +00:00
Yaxun Liu adcfe5d881 Attempt to fix failure in CodeGenOpenCL/atomic-ops.cl
llvm-svn: 310932
2017-08-15 17:16:44 +00:00
Yaxun Liu 99d56d291f Remove -finclude-default-header in OpenCL atomic tests
Differential Revision: https://reviews.llvm.org/D36676

llvm-svn: 310927
2017-08-15 16:30:31 +00:00
Yaxun Liu 30d652a447 [OpenCL] Support variable memory scope in atomic builtins
Differential Revision: https://reviews.llvm.org/D36580

llvm-svn: 310924
2017-08-15 16:02:49 +00:00
Alex Lorenz 0b1ce8b8e6 Allow pretty platform names in availability attributes
rdar://32076651

llvm-svn: 310921
2017-08-15 14:42:01 +00:00
Alexey Bataev 07ed94a7c7 [OPENMP] Fix compiler crash on argument translate for NVPTX.
When translating arguments for NVPTX target it is not taken into account
that function may have variable number of arguments. Patch fixes this
problem.

llvm-svn: 310920
2017-08-15 14:34:04 +00:00
Alex Lorenz 1e23dd6315 [Sema] Silence -Wobjc-missing-property-synthesis for unavailable properties
rdar://30296911

llvm-svn: 310916
2017-08-15 12:40:01 +00:00
Sven van Haastregt efb4d4c78c [OpenCL] Allow targets to select address space per type
Generalize getOpenCLImageAddrSpace into getOpenCLTypeAddrSpace, such
that targets can select the address space per type.

No functional changes intended.

Initial patch by Simon Perretta.

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

llvm-svn: 310911
2017-08-15 09:38:18 +00:00
Reid Kleckner fdb3df65b6 Avoid PointerIntPair of constexpr EvalInfo structs
They are stack allocated, so their alignment is not to be trusted.
32-bit MSVC only guarantees 4 byte stack alignment, even though alignof
would tell you otherwise. I tried fixing this with __declspec align, but
that apparently upsets GCC. Hopefully this version will satisfy all
compilers.

See PR32018 for some info about the mingw issues.

Should supercede https://reviews.llvm.org/D34873

llvm-svn: 310905
2017-08-15 01:17:47 +00:00
Dan Albert 1e29ee9d95 Revert "Fix LLVMgold plugin name/path for non-Linux."
Broke a test. Will fix the test and re-land later.

llvm-svn: 310903
2017-08-15 00:31:44 +00:00
Petr Hosek 3450d7e7f7 [CMake] Include LLVMFuzzer in Fuchsia toolchain
Differential Revision: https://reviews.llvm.org/D36541

llvm-svn: 310901
2017-08-15 00:22:00 +00:00
Dan Albert 25efd75df4 Fix LLVMgold plugin name/path for non-Linux.
Summary:
It's only named LLVMgold.so on Linux. Fix the name for Windows and
Darwin.

Also fix the path for Windows so binutils doesn't have to.

Reviewers: srhines, pirama

Reviewed By: srhines

Subscribers: cfe-commits

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

llvm-svn: 310895
2017-08-14 23:19:38 +00:00
Alexander Shaposhnikov 901d61561c [analyzer] Fix SimpleSValBuilder::simplifySVal
This diff fixes a crash (triggered assert) on the newly added test case.
In the method Simplifier::VisitSymbolData we check the type of S and return
Loc/NonLoc accordingly.

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

llvm-svn: 310887
2017-08-14 21:23:08 +00:00
Erik Pilkington 8b352c4d9d [Sema] Improve some -Wunguarded-availability diagnostics
rdar://33543523
Differential revision: https://reviews.llvm.org/D36200

llvm-svn: 310874
2017-08-14 19:49:12 +00:00
Alexey Bataev 0f87dbee4e [OPENMP] Fix for PR33922: New ident_t flags for
__kmpc_for_static_init().

OpenMP 5.0 will include OpenMP Tools interface that requires distinguishing different worksharing constructs.

Since the same entry point (__kmp_for_static_init(ident_t *loc,
kmp_int32 global_tid,........)) is called in case static
loop/sections/distribute it is suggested using 'flags' field of the
ident_t structure to pass the type of the construct.

llvm-svn: 310865
2017-08-14 17:56:13 +00:00
Alex Lorenz 44b94c7eb3 [rename] Introduce symbol occurrences
Symbol occurrences store the results of local rename and will also be used for
the global, indexed rename results. Their kind is used to determine whether they
should be renamed automatically or not. They can be converted to a set of
AtomicChanges as well.

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

llvm-svn: 310853
2017-08-14 16:19:24 +00:00
Martin Probst 325ff7c5e0 clang-format: [JS] wrap optional properties in type aliases.
Summary:
clang-format wraps object literal keys in an object literal if they are
marked as `TT_SelectorName`s and/or the colon is marked as
`TT_DictLiteral`. Previously, clang-format would accidentally work
because colons in type aliases were marked as `TT_DictLiteral`. r310367
fixed this to assing `TT_JsTypeColon`, which broke wrapping in certain
situations. However the root cause was that clang-format incorrectly
didn't skip questionmarks when detecting selector name.

This change fixes both locations to (1) assign `TT_SelectorName` and (2)
treat `TT_JsTypeColon` like `TT_DictLiteral`.

Previously:

    type X = {
      a: string, b?: string,
    };

Now:

    type X = {
      a: string,
      b?: string,
    };

Reviewers: djasper, sammccall

Subscribers: cfe-commits, klimek

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

llvm-svn: 310852
2017-08-14 16:09:08 +00:00
Martin Probst 83e0220b3f clang-format: [JS] do not insert whitespace in call positions.
Summary:
In JavaScript, may keywords can be used in method names and thus call sites:

    foo.delete();
    foo.instanceof();

clang-format would previously insert whitespace after the `instanceof`. This
change generically skips inserting whitespace between a keyword and a
parenthesis if preceded by a dot, i.e. in a callsite.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 310851
2017-08-14 16:08:16 +00:00
Alexey Bataev 6e01dc1b84 [OPENMP][DEBUG] Fix for PR33676: Debug info for OpenMP region is broken.
After some changes in clang/LLVM debug info for task-based regions was
not generated at all. Patch fixes this problem.

llvm-svn: 310850
2017-08-14 16:03:47 +00:00
Alexey Bataev 3c595a6b2c [OPENMP] Generalization of calls of the outlined functions.
General improvement of the outlined functions calls.

llvm-svn: 310840
2017-08-14 15:01:03 +00:00
Brian Gesiak 1333aaca97 [Parse] Fix typo in header docs (NFC)
Summary:
Fix typo "delcarations", added in rL310609 and rL310627.

llvm-svn: 310838
2017-08-14 14:29:11 +00:00
Aaron Ballman 2cf8df6251 Fixes a typo in a comment; NFC.
llvm-svn: 310837
2017-08-14 14:16:00 +00:00
Krasimir Georgiev 9b5a89b0e2 clang-format: Fix left pointer alignment after delctype/typeof
Change 272124* introduced a regression in spaceRequiredBetween for left aligned pointers to decltype and typeof expressions. This fix adds logic to fix this. The test added is based on a related test in determineStarAmpUsage. Also add test cases for the regression.

http://llvm.org/viewvc/llvm-project?view=revision&revision=272124
LLVM bug tracker: https://bugs.llvm.org/show_bug.cgi?id=30407

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

Fix contributed by euhlmann!

llvm-svn: 310831
2017-08-14 11:06:07 +00:00
Alex Lorenz b176693d99 Set the lexical context for dummy tag decl inside createTagFromNewDecl
This is a follow-up to r310706. This change has been recommended by
Bruno Cardoso Lopes and Richard Smith.

llvm-svn: 310829
2017-08-14 10:59:44 +00:00
Artem Dergachev a7c80a4c07 [analyzer] Rename functions responsible for CFG-based suppress-on-sink.
Update comments. No functional change intended.

Addresses Devin's post-commit review comments in https://reviews.llvm.org/D35673
and https://reviews.llvm.org/D35674.

llvm-svn: 310820
2017-08-14 08:38:47 +00:00
Jonas Hahnfeld 21b60edb05 Fix memory leak in ToolChain::TranslateOpenMPTargetArgs
rL310433 introduced a code path where DAL is not returned and must be freed.
This change allows to run openmp-offload.c when Clang is built with ASan.

llvm-svn: 310817
2017-08-14 07:44:05 +00:00
Richard Smith b115e5dda2 Rename cxx1z -> cxx17 across all diagnostic IDs.
llvm-svn: 310805
2017-08-13 23:37:29 +00:00
Richard Smith cbaaa295f0 Replace remaining user-visible mentions of C++1z with C++17.
llvm-svn: 310804
2017-08-13 22:26:53 +00:00
Richard Smith 6c74e32139 [c++2a] Treat 'concept' and 'requires' as keywords, add compat warning for C++17 and before.
llvm-svn: 310803
2017-08-13 21:32:33 +00:00
Martin Storsjo 31cac7a67c [AArch64] Add support for a MinGW AArch64 target
Differential Revision: https://reviews.llvm.org/D36364

llvm-svn: 310798
2017-08-13 19:42:17 +00:00
Sylvestre Ledru d23dd6c633 clang-format: add an option -verbose to list the files being processed
Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

Tags: #clang

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

llvm-svn: 310778
2017-08-12 15:15:10 +00:00
Richard Smith 6c716116df PR34163: Don't cache an incorrect key function for a class if queried between
the class becoming complete and its inline methods being parsed.

This replaces the hack of using the "late parsed template" flag to track member
functions with bodies we've not parsed yet; instead we now use the "will have
body" flag, which carries the desired implication that the function declaration
*is* a definition, and that we've just not parsed its body yet.

llvm-svn: 310776
2017-08-12 01:46:03 +00:00
Bruno Cardoso Lopes 4164dd9167 Revert "[Modules] Prevent #import to reenter header if not building a module."
This reverts commit r310605. Richard pointed out a better way to achieve
this, which I'll post a patch for soon.

llvm-svn: 310775
2017-08-12 01:38:26 +00:00
Kostya Serebryany 3e78c4bddc Add a Dockerfile for clang-proto-fuzzer
Summary: Add a Dockerfile for clang-proto-fuzzer

Reviewers: morehouse, vitalybuka

Reviewed By: morehouse

Subscribers: hintonda, cfe-commits

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

llvm-svn: 310774
2017-08-12 01:27:10 +00:00
Alex Shlyapnikov a9f6a52925 Disabling openmp-offload.c on linux until it is stabilized on all local configurations.
Differential revision: https://reviews.llvm.org/D29660

llvm-svn: 310772
2017-08-11 23:10:39 +00:00
Gheorghe-Teodor Bercea 0499212ebf [OpenMP] Move failing flag tests to disabled GPU
offloading test file. This should prevent further errors
with the sanitizer.

Diff: D29660
llvm-svn: 310765
2017-08-11 21:17:50 +00:00
George Karpenkov 33613f63f6 Add -fsanitize=fuzzer-no-link flag to the driver.
The flag will perform instrumentation necessary to the fuzzing,
but will NOT link libLLVMFuzzer.a library.
Necessary when modifying CFLAGS for projects which may produce
executables as well as a fuzzable target.

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

llvm-svn: 310733
2017-08-11 17:22:58 +00:00
Gheorghe-Teodor Bercea 9c52574886 [OpenMP] Enable previously successful offloading tests.
Create a separate test file to contain all tests for OpenMP
offloading to GPUs.

Make libdevice checking more robust by accounting for
the case in which no libdevice is found.

This changes are in connrection with diff: D29660

llvm-svn: 310718
2017-08-11 15:46:22 +00:00
Simon Dardis 16bddf21cf [mips] Add missing mips-registered-target to mips test.
llvm-svn: 310715
2017-08-11 15:23:23 +00:00
Simon Dardis ad9d05de8f [mips] Support implicit gpopt with N64 when using -fno-pic
As clang defaults to -mno-abicalls when using -fno-pic for N64, implicitly use
-mgpopt in that case.

Reviewers: atanasyan

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

llvm-svn: 310714
2017-08-11 15:01:34 +00:00
Alex Lorenz 213d34330f [modules] Set the lexical DC for dummy tag decls that refer to hidden
declarations that are made visible after the dummy is parsed and ODR verified

Prior to this commit the
"(getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one."),"
assertion failure was triggered during semantic analysis of the dummy
tag declaration that was declared in another tag declaration because its
lexical context did not point to the outer tag decl.

rdar://32292196

llvm-svn: 310706
2017-08-11 12:06:52 +00:00
Stefan Maksimovic ac642ae7c0 Revert r302670 for the upcoming 5.0.0 release
This is causing failures when compiling clang with -O3
as one of the structures used by clang is passed by
value and uses the fastcc calling convention.

Faliures manifest for stage2 mips build.

llvm-svn: 310704
2017-08-11 11:39:07 +00:00
Stefan Maksimovic 76391b101d Revert r310057
Bring back changes which r304953 introduced since
they were in fact not the cause of failures described
in r310057 commit message.

llvm-svn: 310702
2017-08-11 11:03:54 +00:00
Yuka Takahashi 9b6b5d5a88 [Bash-autocompletion] Add --autocomplete flag to 5.0 release notes
Summary:
I thought we should add this information to release notes, because we
added a new flag to clang driver.

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: cfe-commits

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

llvm-svn: 310700
2017-08-11 09:44:42 +00:00
Josh Gao 55afa7504f Revert "Thread Safety Analysis: warn on nonsensical attributes."
This reverts commit rL310403, which caused spurious warnings in libc++,
because it didn't properly handle templated scoped lockable types.

llvm-svn: 310698
2017-08-11 07:54:35 +00:00
Richard Smith 9d07ae77e7 Implement latest feature test macro recommendations, P0096R4.
llvm-svn: 310694
2017-08-11 03:39:40 +00:00
Richard Smith b9e5af2123 Update cxx_status to mention the upcoming Clang 5 release.
llvm-svn: 310693
2017-08-11 03:16:11 +00:00
Richard Smith f8c735c770 PR33850: Update cxx_dr_status for Clang 5 branch.
llvm-svn: 310692
2017-08-11 03:14:20 +00:00
Richard Smith 0887754110 PR33489: A function-style cast to a deduced class template specialization type is type-dependent if it can't be resolved due to a type-dependent argument.
llvm-svn: 310691
2017-08-11 02:04:19 +00:00
Akira Hatanaka 8d7bdf6dff [Sema][ObjC] Fix spurious -Wcast-qual warnings.
We do not meaningfully track object const-ness of Objective-C object
types. Silence the -Wcast-qual warning that is issued when casting to or
from Objective-C object types results in losing const qualification.

rdar://problem/33807915

llvm-svn: 310672
2017-08-11 00:06:49 +00:00
Craig Topper 699ae0c173 [X86] Implement __builtin_cpu_is
This patch adds support for __builtin_cpu_is. I've tried to match the strings supported to the latest version of gcc.

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

llvm-svn: 310657
2017-08-10 20:28:30 +00:00
Kamil Rytarowski 9fef3b3948 Enable bunch of sanitizers on NetBSD/X86 and X86_64
Summary:
Enable more sanitizers:
 - i386 and amd64:
 * SanitizerKind::Vptr;
 * SanitizerKind::Leak;
 * SanitizerKind::SafeStack;
 * SanitizerKind::Function;

 - amd64 only:
 * SanitizerKind::Thread;

These sanitizers are in the process of upstreaming to LLVM projects.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dim, vitalybuka, kcc, filcab, fjricci

Reviewed By: vitalybuka

Subscribers: #sanitizers, cfe-commits

Tags: #sanitizers

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

llvm-svn: 310649
2017-08-10 18:53:52 +00:00
Alex Shlyapnikov 5f1ac1444b Disabling openmp-offload.c on linux until it is stabilized on all local configurations.
llvm-svn: 310640
2017-08-10 17:55:01 +00:00
Brian Gesiak 75023dbf51 [Parse] Document Parser::SkipFunctionBodies
Reviewers: erikjv, doug.gregor

Subscribers: cfe-commits

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

llvm-svn: 310627
2017-08-10 17:02:04 +00:00
Gheorghe-Teodor Bercea 14528c60ba [OpenMP] Delete tests in openmp-offload.c which cuase failures
until a better way to perform these tests is figured out.

Change connected to diff: D29654

llvm-svn: 310625
2017-08-10 16:56:59 +00:00
Bob Wilson 7a85cc52d7 Add a getName accessor for ModuleMacros.
Swift would like to be able to access the name of a ModuleMacro.
There was some discussion of this in
https://github.com/apple/swift-clang/pull/93, suggesting that it makes
sense to have this accessor in Clang.

llvm-svn: 310622
2017-08-10 16:42:46 +00:00
Ilya Biryukov b88de41636 Fixed a race condition in PrecompiledPreamble.
Summary:
Two PrecompiledPreambles, used in parallel on separate threads,
could be writing preamble to the same temporary file.

Reviewers: bkramer, krasimir, klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 310618
2017-08-10 16:10:40 +00:00
Momchil Velikov 57c681f33e Place implictly declared functions at block scope
Such implicitly declared functions behave as if the enclosing block
contained the declaration extern int name() (C90, 6.3.3.2 Function calls),
thus their names should have block scope (C90, 6.1.2.1 Scope of identifiers).

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

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

llvm-svn: 310616
2017-08-10 15:43:06 +00:00