]> granicus.if.org Git - clang/log
clang
7 years ago[clang-proto-fuzzer] Fix clang-proto-to-cxx build.
Matt Morehouse [Wed, 23 Aug 2017 19:58:07 +0000 (19:58 +0000)]
[clang-proto-fuzzer] Fix clang-proto-to-cxx build.

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

7 years ago[ubsan] PR34266: When sanitizing the 'this' value for a member function that happens...
Richard Smith [Wed, 23 Aug 2017 19:39:04 +0000 (19:39 +0000)]
[ubsan] PR34266: When sanitizing the 'this' value for a member function that happens to be a lambda call operator, use the lambda's 'this' pointer, not the captured enclosing 'this' pointer (if any).

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

7 years agoHeaders: explicitly specify double-word alignment
Saleem Abdulrasool [Wed, 23 Aug 2017 16:57:55 +0000 (16:57 +0000)]
Headers: explicitly specify double-word alignment

GCC will interpret `__attribute__((__aligned__))` as 8-byte alignment on
ARM, but clang will not.  Explicitly specify the alignment.  This
mirrors the declaration in libunwind.

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

7 years ago[clang-diff] Properly clear the selection in HTML diff
Johannes Altmanninger [Wed, 23 Aug 2017 16:52:15 +0000 (16:52 +0000)]
[clang-diff] Properly clear the selection in HTML diff

Reviewers: arphaman

Subscribers: cfe-commits

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

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

7 years ago[clang-diff] Reformat test, NFC
Johannes Altmanninger [Wed, 23 Aug 2017 16:32:35 +0000 (16:32 +0000)]
[clang-diff] Reformat test, NFC

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

7 years ago[clang-diff] HTML diff navigation
Johannes Altmanninger [Wed, 23 Aug 2017 16:32:13 +0000 (16:32 +0000)]
[clang-diff] HTML diff navigation

Summary:
This adds shortcuts j and k to jump between changes.
It is especially useful in diffs with few changes.

Reviewers: arphaman

Subscribers: cfe-commits

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

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

7 years ago[analyzer] Make StmtDataCollector customizable
Johannes Altmanninger [Wed, 23 Aug 2017 16:28:26 +0000 (16:28 +0000)]
[analyzer] Make StmtDataCollector customizable

Summary:
This moves the data collection macro calls for Stmt nodes
to lib/AST/StmtDataCollectors.inc

Users can subclass ConstStmtVisitor and include StmtDataCollectors.inc
to define visitor methods for each Stmt subclass. This makes it also
possible to customize the visit methods as exemplified in
lib/Analysis/CloneDetection.cpp.

Move helper methods for data collection to a new module,
AST/DataCollection.

Add data collection for DeclRefExpr, MemberExpr and some literals.

Reviewers: arphaman, teemperor!

Subscribers: mgorny, xazax.hun, cfe-commits

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

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

7 years agoRevert "[clang-format] Emit absolute splits before lines for comments"
Krasimir Georgiev [Wed, 23 Aug 2017 15:58:10 +0000 (15:58 +0000)]
Revert "[clang-format] Emit absolute splits before lines for comments"

This reverts commit r311559, which added a test containing raw string
literals in macros, which chokes gcc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55971

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

7 years agoHeaders: give _Unwind_Control_Block double-word alignment
Saleem Abdulrasool [Wed, 23 Aug 2017 15:35:33 +0000 (15:35 +0000)]
Headers: give _Unwind_Control_Block double-word alignment

The C++ ABI requires that the exception object (which under AEABI is the
`_Unwind_Control_Block`) is double-word aligned.  The attribute was
applied to the `_Unwind_Exception` type, but not the
`_Unwind_Control_Block`.  This should fix the libunwind test for the
alignment of the exception type.

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

7 years agoImplement CFG construction for __try / __except / __leave.
Nico Weber [Wed, 23 Aug 2017 15:33:16 +0000 (15:33 +0000)]
Implement CFG construction for __try / __except / __leave.

This makes -Wunreachable-code work for programs containing SEH (except for
__finally, which is still missing for now).

__try is modeled like try (but simpler since it can only have a single __except
or __finally), __except is fairly similar to catch (but simpler, since it can't
contain declarations). __leave is implemented similarly to break / continue.

Use the existing addTryDispatchBlock infrastructure (which
FindUnreachableCode() in ReachableCode.cpp uses via cfg->try_blocks_begin()) to
mark things in the __except blocks as reachable.

Re-use TryTerminatedBlock. This means we add EH edges from calls to the __try
block, but not from all other statements. While this is incomplete, it matches
LLVM's SEH codegen support. Also, in practice, BuildOpts.AddEHEdges is always
false in practice from what I can tell, so we never even insert the call EH
edges either.

https://reviews.llvm.org/D36914

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

7 years ago[clang-format] Emit absolute splits before lines for comments
Krasimir Georgiev [Wed, 23 Aug 2017 15:16:47 +0000 (15:16 +0000)]
[clang-format] Emit absolute splits before lines for comments

Summary:
This patch makes the splits emitted for the beginning of comment lines during
reformatting absolute. Previously, they were relative to the start of the
non-whitespace content of the line, which messes up further TailOffset
calculations in breakProtrudingToken. This fixes an assertion failure reported
in bug 34236: https://bugs.llvm.org/show_bug.cgi?id=34236.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

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

7 years agoRevert r311552: [Bash-autocompletion] Add support for static analyzer flags
Rui Ueyama [Wed, 23 Aug 2017 14:48:58 +0000 (14:48 +0000)]
Revert r311552: [Bash-autocompletion] Add support for static analyzer flags

This reverts commit r311552 because it broke ubsan and asan bots.

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

7 years ago[Bash-autocompletion] Add support for static analyzer flags
Yuka Takahashi [Wed, 23 Aug 2017 13:39:47 +0000 (13:39 +0000)]
[Bash-autocompletion] Add support for static analyzer flags

Summary:
This is a patch for clang autocomplete feature.

It will collect values which -analyzer-checker takes, which is defined in
clang/StaticAnalyzer/Checkers/Checkers.inc, dynamically.
First, from ValuesCode class in Options.td, TableGen will generate C++
code in Options.inc. Options.inc will be included in DriverOptions.cpp, and
calls OptTable's addValues function. addValues function will add second
argument to Option's Values class. Values contains string like "foo,bar,.."
which is handed to Values class
in OptTable.

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: hiraditya, cfe-commits

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

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

7 years agoFix typos, remove unused private members of CommonOptionsParser, NFC
Johannes Altmanninger [Wed, 23 Aug 2017 10:43:26 +0000 (10:43 +0000)]
Fix typos, remove unused private members of CommonOptionsParser, NFC

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

7 years ago[clang-format] Align trailing comments if ColumnLimit is 0
Krasimir Georgiev [Wed, 23 Aug 2017 07:18:36 +0000 (07:18 +0000)]
[clang-format] Align trailing comments if ColumnLimit is 0

Summary:
ColumnLimit = 0 means no limit, so comment should always be aligned if requested. This was broken with

  https://llvm.org/svn/llvm-project/cfe/trunk@304687

introduced via

  https://reviews.llvm.org/D33830

and is included in 5.0.0-rc2. This commit fixes it and adds a unittest for this property.

Should go into clang-5.0 IMHO.

Contributed by @pboettch!

Reviewers: djasper, krasimir

Reviewed By: djasper, krasimir

Subscribers: hans, klimek

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

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

7 years agobpf: add -mcpu=# support for bpf
Yonghong Song [Wed, 23 Aug 2017 04:26:17 +0000 (04:26 +0000)]
bpf: add -mcpu=# support for bpf

-mcpu=# will support:
  . generic: the default insn set
  . v1: insn set version 1, the same as generic
  . v2: insn set version 2, version 1 + additional jmp insns
  . probe: the compiler will probe the underlying kernel to
           decide proper version of insn set.

Examples:
$ clang -target bpf -mcpu=v1 -c t.c
$ clang -target bpf -mcpu=v2 -c t.c
$ clang -target bpf -mcpu=generic -c t.c
$ clang -target bpf -mcpu=probe -c t.c
$ clang -target bpf -mcpu=v3 -c t.c
error: unknown target CPU 'v3'

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

7 years ago[ODRHash] Diagnose differing template parameters.
Richard Trieu [Wed, 23 Aug 2017 02:43:59 +0000 (02:43 +0000)]
[ODRHash] Diagnose differing template parameters.

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

7 years agoUpdate Clang fuzzers to use libFuzzer bundled with the toolchain.
George Karpenkov [Wed, 23 Aug 2017 00:42:22 +0000 (00:42 +0000)]
Update Clang fuzzers to use libFuzzer bundled with the toolchain.

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

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

7 years agoRemove LLVMFuzzer from list of bundled libraries for Fuchsia
George Karpenkov [Wed, 23 Aug 2017 00:09:33 +0000 (00:09 +0000)]
Remove LLVMFuzzer from list of bundled libraries for Fuchsia

As of now, libFuzzer is located in compiler-rt and is bundled with
Clang's toolchain by default.

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

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

7 years agoDegeneralize more tests.
Dan Albert [Tue, 22 Aug 2017 21:16:22 +0000 (21:16 +0000)]
Degeneralize more tests.

As before, not every platform supports LTO. Make sure the platform
we're targeting is one that supports it (regardless of the *host*
platform).

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

7 years agoRevert "Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""""
Dan Albert [Tue, 22 Aug 2017 21:05:01 +0000 (21:05 +0000)]
Revert "Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""""

With tests fixed for Windows style paths now that they are going
through path canonicalization.

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

7 years ago[Parser] Correct initalizer typos before lambda capture type is deduced.
Volodymyr Sapsai [Tue, 22 Aug 2017 17:55:19 +0000 (17:55 +0000)]
[Parser] Correct initalizer typos before lambda capture type is deduced.

This is the same assertion as in https://reviews.llvm.org/D25206 that is
triggered when RecordLayoutBuilder tries to compute the size of a field
(for capture "typo_boo" in the test case) whose type hasn't been
deduced.

The fix is to add CorrectDelayedTyposInExpr call to the cases when we
aren't disambiguating between an Obj-C message send and a lambda
expression.

rdar://problem/31760839

Reviewers: rsmith, ahatanak

Reviewed By: arphaman

Subscribers: cfe-commits

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

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

7 years ago[OPENMP] Fix for PR34014: OpenMP 4.5: Target construct in static method
Alexey Bataev [Tue, 22 Aug 2017 17:54:52 +0000 (17:54 +0000)]
[OPENMP] Fix for PR34014: OpenMP 4.5: Target construct in static method
of class fails to map class static variable.

If the global variable is captured and it has several redeclarations,
sometimes it may lead to a compiler crash. Patch fixes this by working
only with canonical declarations.

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

7 years ago[clang-diff] Refactor stop-after command-line flag
Jacob Gravelle [Tue, 22 Aug 2017 17:42:44 +0000 (17:42 +0000)]
[clang-diff] Refactor stop-after command-line flag

Summary:
Rename stop-after to stop-diff-after. When building LLVM with
-DLLVM_BUILD_LLVM_DYLIB=ON, stop-after collides with the stop-after
already present in LLVM.

Reviewers: johannes, arphaman

Subscribers: klimek, aheejin, cfe-commits

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

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

7 years agoTest commit access.
Volodymyr Sapsai [Tue, 22 Aug 2017 17:39:25 +0000 (17:39 +0000)]
Test commit access.

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

7 years ago[clang-format] Break non-trailing block comments
Krasimir Georgiev [Tue, 22 Aug 2017 14:40:05 +0000 (14:40 +0000)]
[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

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

7 years ago[clang-format] Fix lines regression in clang-format.py
Krasimir Georgiev [Tue, 22 Aug 2017 14:28:01 +0000 (14:28 +0000)]
[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

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

7 years ago[mips] Rename getSupportedNanEncoding() to getIEEE754Standard()
Petar Jovanovic [Tue, 22 Aug 2017 13:35:27 +0000 (13:35 +0000)]
[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

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

7 years agoRevert r311442 (Fix templated type alias completion when using global completion...
Erik Verbruggen [Tue, 22 Aug 2017 10:54:40 +0000 (10:54 +0000)]
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

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

7 years ago[ObjC] Check written attributes only when synthesizing ambiguous property
Alex Lorenz [Tue, 22 Aug 2017 10:38:07 +0000 (10:38 +0000)]
[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

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

7 years agoFix templated type alias completion when using global completion cache
Erik Verbruggen [Tue, 22 Aug 2017 10:25:48 +0000 (10:25 +0000)]
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

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

7 years ago[clang-diff] Fix getRelativeName
Johannes Altmanninger [Tue, 22 Aug 2017 08:59:13 +0000 (08:59 +0000)]
[clang-diff] Fix getRelativeName

Handle the case when DeclContext is null.

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

7 years ago[clang-diff] Use the relative name for NamedDecl
Johannes Altmanninger [Tue, 22 Aug 2017 08:56:26 +0000 (08:56 +0000)]
[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

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

7 years agoUpdate libprotobuf-mutator revision
Vitaly Buka [Tue, 22 Aug 2017 05:18:28 +0000 (05:18 +0000)]
Update libprotobuf-mutator revision

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

7 years agoTest fix: only add shared libraries to rpath.
George Karpenkov [Tue, 22 Aug 2017 02:10:53 +0000 (02:10 +0000)]
Test fix: only add shared libraries to rpath.

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

7 years agoFixed driver tests for -fsanitize=fuzzer.
George Karpenkov [Tue, 22 Aug 2017 00:04:05 +0000 (00:04 +0000)]
Fixed driver tests for -fsanitize=fuzzer.

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

7 years agoMoving libFuzzer to compiler-rt: required updates to the Clang driver.
George Karpenkov [Mon, 21 Aug 2017 23:25:19 +0000 (23:25 +0000)]
Moving libFuzzer to compiler-rt: required updates to the Clang driver.

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

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

7 years ago[Driver][Darwin] Do not pass -munwind-table if -fno-excpetions is
Akira Hatanaka [Mon, 21 Aug 2017 22:46:46 +0000 (22:46 +0000)]
[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

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

7 years ago[Driver] Recognize DevDiv internal builds of MSVC, with a different directory structure.
Stephan T. Lavavej [Mon, 21 Aug 2017 22:19:33 +0000 (22:19 +0000)]
[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.

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

7 years agoEnable libfuzzer on NetBSD/amd64
Kamil Rytarowski [Mon, 21 Aug 2017 19:12:14 +0000 (19:12 +0000)]
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

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

7 years ago[clang] Fix tests for Emitting Single Inline Remark
Sam Elliott [Mon, 21 Aug 2017 16:40:35 +0000 (16:40 +0000)]
[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

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

7 years ago[StaticAnalyzer] LoopUnrolling: Track a LoopStack in order to completely unroll speci...
Peter Szecsi [Mon, 21 Aug 2017 16:32:57 +0000 (16:32 +0000)]
[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

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

7 years ago[clang-proto-fuzzer] Update README.
Matt Morehouse [Mon, 21 Aug 2017 16:18:43 +0000 (16:18 +0000)]
[clang-proto-fuzzer] Update README.

Add instructions on how to modify the compiler invocation.

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

7 years ago[StaticAnalyzer] Handle LoopExit CFGElement in the analyzer
Peter Szecsi [Mon, 21 Aug 2017 16:10:19 +0000 (16:10 +0000)]
[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

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

7 years ago[mips] Remove checking of the redundant condition. NFC
Simon Atanasyan [Mon, 21 Aug 2017 14:08:29 +0000 (14:08 +0000)]
[mips] Remove checking of the redundant condition. NFC

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

7 years agoFixed a crash on replaying Preamble's PP conditional stack.
Ilya Biryukov [Mon, 21 Aug 2017 12:03:08 +0000 (12:03 +0000)]
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

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

7 years ago[ObjC] Use consistent comment style in inline asm
Oliver Stannard [Mon, 21 Aug 2017 09:54:46 +0000 (09:54 +0000)]
[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

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

7 years ago[ARM][AArch64] Cortex-A75 and Cortex-A55 tests
Sam Parker [Mon, 21 Aug 2017 08:52:45 +0000 (08:52 +0000)]
[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

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

7 years agoAllow thiscall attribute in test/Tooling/clang-diff-ast.cpp
Johannes Altmanninger [Sun, 20 Aug 2017 20:13:33 +0000 (20:13 +0000)]
Allow thiscall attribute in test/Tooling/clang-diff-ast.cpp

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

7 years ago[clang-diff] Improve and test getNodeValue
Johannes Altmanninger [Sun, 20 Aug 2017 16:18:43 +0000 (16:18 +0000)]
[clang-diff] Improve and test getNodeValue

Summary: Use qualified names if available.

Reviewers: arphaman

Subscribers: klimek

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

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

7 years ago[ODRHash] Move into anonymous namespace. NFC.
Benjamin Kramer [Sun, 20 Aug 2017 13:02:57 +0000 (13:02 +0000)]
[ODRHash] Move into anonymous namespace. NFC.

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

7 years ago[clang-diff] Fix similarity computation
Johannes Altmanninger [Sun, 20 Aug 2017 12:09:07 +0000 (12:09 +0000)]
[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

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

7 years ago[clang-diff] Filter AST nodes
Johannes Altmanninger [Sun, 20 Aug 2017 10:22:32 +0000 (10:22 +0000)]
[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

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

7 years agoclang/test/Tooling/clang-diff-ast.cpp: Satisfy thiscall.
NAKAMURA Takumi [Sun, 20 Aug 2017 00:02:20 +0000 (00:02 +0000)]
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)
   ^

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

7 years ago[clang-diff] Simplify mapping
Johannes Altmanninger [Sat, 19 Aug 2017 17:53:01 +0000 (17:53 +0000)]
[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

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

7 years agoAdd clang-diff to tool_patterns in test/lit.cfg
Johannes Altmanninger [Sat, 19 Aug 2017 17:52:29 +0000 (17:52 +0000)]
Add clang-diff to tool_patterns in test/lit.cfg

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

7 years ago[clang-diff] Fix compiler warning
Johannes Altmanninger [Sat, 19 Aug 2017 17:12:25 +0000 (17:12 +0000)]
[clang-diff] Fix compiler warning

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

7 years ago[clang-diff] Add HTML side-by-side diff output
Johannes Altmanninger [Sat, 19 Aug 2017 15:40:45 +0000 (15:40 +0000)]
[clang-diff] Add HTML side-by-side diff output

Reviewers: arphaman

Subscribers: mgorny

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

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

7 years ago[clang-diff] Fix warning about useless comparison
Johannes Altmanninger [Sat, 19 Aug 2017 13:29:44 +0000 (13:29 +0000)]
[clang-diff] Fix warning about useless comparison

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

7 years ago[clang-diff] Make printing of matches optional
Johannes Altmanninger [Sat, 19 Aug 2017 12:04:04 +0000 (12:04 +0000)]
[clang-diff] Make printing of matches optional

Reviewers: arphaman

Subscribers: klimek

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

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

7 years ago[CFG] Add LoopExit information to CFG
Peter Szecsi [Sat, 19 Aug 2017 11:19:16 +0000 (11:19 +0000)]
[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

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

7 years ago[StaticAnalyzer] LoopUnrolling: Exclude cases where the counter is escaped before...
Peter Szecsi [Sat, 19 Aug 2017 10:24:52 +0000 (10:24 +0000)]
[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

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

7 years ago[clang-diff] Fix test
Johannes Altmanninger [Sat, 19 Aug 2017 10:05:24 +0000 (10:05 +0000)]
[clang-diff] Fix test

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

7 years ago[clang-diff] Add option to dump the AST, one node per line
Johannes Altmanninger [Sat, 19 Aug 2017 09:36:14 +0000 (09:36 +0000)]
[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

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

7 years ago[c++2a] Implement P0409R2 - Allow lambda capture [=,this] (by hamzasood)
Faisal Vali [Sat, 19 Aug 2017 03:43:07 +0000 (03:43 +0000)]
[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!

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

7 years agoRevert "Revert "[clang-diff] Move printing of matches and changes to clang-diff""
Johannes Altmanninger [Sat, 19 Aug 2017 02:56:35 +0000 (02:56 +0000)]
Revert "Revert "[clang-diff] Move printing of matches and changes to clang-diff""

Fix build by renaming ChangeKind -> Change

This reverts commit 0c78c5729f29315d7945988efd048c0cb86c07ce.

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

7 years ago[clang-diff] Fix test for python 3
Johannes Altmanninger [Sat, 19 Aug 2017 01:34:24 +0000 (01:34 +0000)]
[clang-diff] Fix test for python 3

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

7 years agoRevert "Revert "[clang-diff] Move the JSON export function to clang-diff""
Johannes Altmanninger [Sat, 19 Aug 2017 00:57:38 +0000 (00:57 +0000)]
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.

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

7 years agoRevert "[clang-diff] Move the JSON export function to clang-diff"
Vlad Tsyrklevich [Fri, 18 Aug 2017 23:21:11 +0000 (23:21 +0000)]
Revert "[clang-diff] Move the JSON export function to clang-diff"

This reverts commit r311199, it was causing widespread build failures.

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

7 years agoRevert "[clang-diff] Move printing of matches and changes to clang-diff"
Vlad Tsyrklevich [Fri, 18 Aug 2017 23:21:10 +0000 (23:21 +0000)]
Revert "[clang-diff] Move printing of matches and changes to clang-diff"

This reverts commit r311200, it was causing widespread build failures.

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

7 years ago[clang-diff] Move printing of matches and changes to clang-diff
Johannes Altmanninger [Fri, 18 Aug 2017 21:26:34 +0000 (21:26 +0000)]
[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

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

7 years ago[clang-diff] Move the JSON export function to clang-diff
Johannes Altmanninger [Fri, 18 Aug 2017 21:26:13 +0000 (21:26 +0000)]
[clang-diff] Move the JSON export function to clang-diff

Reviewers: arphaman

Subscribers: klimek

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

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

7 years ago[Sema] Don't emit -Wunguarded-availability for switch cases
Erik Pilkington [Fri, 18 Aug 2017 20:20:56 +0000 (20:20 +0000)]
[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

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

7 years ago[SanitizerCoverage] Add stack depth tracing instrumentation.
Matt Morehouse [Fri, 18 Aug 2017 18:43:30 +0000 (18:43 +0000)]
[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

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

7 years ago[clang-proto-fuzzer] Allow user-specified compiler arguments.
Matt Morehouse [Fri, 18 Aug 2017 18:34:39 +0000 (18:34 +0000)]
[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

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

7 years ago[analyzer] Fix modeling of constructors
Alexander Shaposhnikov [Fri, 18 Aug 2017 18:20:43 +0000 (18:20 +0000)]
[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

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

7 years agoAMDGPU: Rename r600-mcpu.cl->amdgpu-mcpu.cl
Konstantin Zhuravlyov [Fri, 18 Aug 2017 17:29:07 +0000 (17:29 +0000)]
AMDGPU: Rename r600-mcpu.cl->amdgpu-mcpu.cl

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

7 years ago[clang-diff] Add commandline arguments.
Johannes Altmanninger [Fri, 18 Aug 2017 16:34:22 +0000 (16:34 +0000)]
[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

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

7 years ago[clang-diff] Fix some errors and inconsistencies
Johannes Altmanninger [Fri, 18 Aug 2017 16:34:15 +0000 (16:34 +0000)]
[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

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

7 years ago[CommonOptionsParser] Expose ArgumentsAdjustingCompilationDatabase
Johannes Altmanninger [Fri, 18 Aug 2017 16:21:08 +0000 (16:21 +0000)]
[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.

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

7 years agoAMDGPU: add missing amdgcn processors and tests
Konstantin Zhuravlyov [Fri, 18 Aug 2017 01:13:39 +0000 (01:13 +0000)]
AMDGPU: add missing amdgcn processors and tests

  - gfx600
  - gfx601
  - gfx703
  - gfx902
  - gfx903

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

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

7 years agoRevert r311137 (GlobalISel ABI commit).
Tim Northover [Fri, 18 Aug 2017 00:33:24 +0000 (00:33 +0000)]
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.

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

7 years agoGlobalISel (AArch64): fix ABI at border between GPRs and SP.
Tim Northover [Thu, 17 Aug 2017 23:14:01 +0000 (23:14 +0000)]
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.

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

7 years agoPR34161: support evaluation of 'void()' expressions in C++14 onwards.
Richard Smith [Thu, 17 Aug 2017 19:35:50 +0000 (19:35 +0000)]
PR34161: support evaluation of 'void()' expressions in C++14 onwards.

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

7 years agoUnguarded availability diagnoser should use TraverseStmt instead of
Alex Lorenz [Thu, 17 Aug 2017 14:22:27 +0000 (14:22 +0000)]
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)

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

7 years agoPrint enum constant values using the original source formatting
Alex Lorenz [Thu, 17 Aug 2017 13:41:55 +0000 (13:41 +0000)]
Print enum constant values using the original source formatting
if possible when creating "Declaration" nodes in XML comments

rdar://14765746

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

7 years agoFix undefined behavior that is caused by not always initializing a bool.
Daniel Jasper [Thu, 17 Aug 2017 06:33:46 +0000 (06:33 +0000)]
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.

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

7 years agoFurther refactoring of the constant emitter. NFC.
John McCall [Thu, 17 Aug 2017 05:03:55 +0000 (05:03 +0000)]
Further refactoring of the constant emitter.  NFC.

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

7 years ago[analyzer] Add support for reference counting of parameters on the callee side
Devin Coughlin [Thu, 17 Aug 2017 04:19:07 +0000 (04:19 +0000)]
[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

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

7 years ago[index] Add indexing for unresolved-using declarations
Ben Langmuir [Wed, 16 Aug 2017 23:12:21 +0000 (23:12 +0000)]
[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

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

7 years agoFix typos in comments; NFC
George Burgess IV [Wed, 16 Aug 2017 22:44:17 +0000 (22:44 +0000)]
Fix typos in comments; NFC

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

7 years agoDon't use -no-integrated-as in test/Driver/opt-record.c
Hal Finkel [Wed, 16 Aug 2017 21:51:31 +0000 (21:51 +0000)]
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.

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

7 years agoBase optimization-record file names on the final output
Hal Finkel [Wed, 16 Aug 2017 21:34:27 +0000 (21:34 +0000)]
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.

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

7 years agoUse the file name from linemarker for debug info if an input is preprocessed source.
Taewook Oh [Wed, 16 Aug 2017 19:36:24 +0000 (19:36 +0000)]
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

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

7 years ago[Driver] SafeStack does not need a runtime library on Fuchsia
Petr Hosek [Wed, 16 Aug 2017 19:06:05 +0000 (19:06 +0000)]
[Driver] SafeStack does not need a runtime library on Fuchsia

Patch by Roland McGrath

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

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

7 years ago[CMake] Build sanitized C++ runtimes for Fuchsia
Petr Hosek [Wed, 16 Aug 2017 19:06:04 +0000 (19:06 +0000)]
[CMake] Build sanitized C++ runtimes for Fuchsia

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

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

7 years ago[OPENMP] Fix for PR28581: OpenMP linear clause - wrong results.
Alexey Bataev [Wed, 16 Aug 2017 15:58:46 +0000 (15:58 +0000)]
[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.

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

7 years ago[OPRNMP] Fix for PR33445: ICE: OpenMP target containing ordered for.
Alexey Bataev [Wed, 16 Aug 2017 14:01:00 +0000 (14:01 +0000)]
[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.

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

7 years agoFix a UBSan failure where this boolean was copied when uninitialized.
Chandler Carruth [Wed, 16 Aug 2017 07:22:49 +0000 (07:22 +0000)]
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.

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

7 years agoFix comments about __OPENCL_MEMORY_SCOPE_* macros
Yaxun Liu [Wed, 16 Aug 2017 04:15:28 +0000 (04:15 +0000)]
Fix comments about __OPENCL_MEMORY_SCOPE_* macros

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