]> granicus.if.org Git - clang/log
clang
8 years agoRemove non-existing file from modulemap.
Benjamin Kramer [Fri, 21 Oct 2016 10:19:37 +0000 (10:19 +0000)]
Remove non-existing file from modulemap.

This picked up a builtin header if it happened to be available.

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

8 years agoRevert "DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules."
Renato Golin [Fri, 21 Oct 2016 08:03:49 +0000 (08:03 +0000)]
Revert "DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules."

This reverts commit r284800, as it failed all ARM/AArch64 bots.

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

8 years agoclang-format: [JS] Fix template string ASI.
Martin Probst [Fri, 21 Oct 2016 05:11:38 +0000 (05:11 +0000)]
clang-format: [JS] Fix template string ASI.

Summary:
Previously, automatic semicolon insertion would add an unwrapped line
when a template string contained a line break.

    var x = `foo${
        bar}`;

Would be formatted with `bar...` on a separate line and no indent.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

8 years agoDon't try to use !Previous.empty() as a proxy for "Is this a redeclaration?" --
Richard Smith [Fri, 21 Oct 2016 03:15:03 +0000 (03:15 +0000)]
Don't try to use !Previous.empty() as a proxy for "Is this a redeclaration?" --
we don't collapse that down to a single entry if it's not a redeclaration.
Instead, set the Redeclaration bit on the Declarator to indicate whether a
function is a redeclaration (which may not have been linked into the
redeclaration chain if it's a dependent context friend).

Fixes a rejects-valid; see testcase.

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

8 years agoDR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.
Richard Smith [Fri, 21 Oct 2016 02:36:37 +0000 (02:36 +0000)]
DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.
This has two significant effects:

1) Direct relational comparisons between null pointer constants (0 and nullopt)
   and pointers are now ill-formed. This was always the case for C, and it
   appears that C++ only ever permitted by accident. For instance, cases like
     nullptr < &a
   are now rejected.

2) Comparisons and conditional operators between differently-cv-qualified
   pointer types now work, and produce a composite type that both source
   pointer types can convert to (when possible). For instance, comparison
   between 'int **' and 'const int **' is now valid, and uses an intermediate
   type of 'const int *const *'.

Clang previously supported #2 as an extension.

We do not accept the cases in #1 as an extension. I've tested a fair amount of
code to check that this doesn't break it, but if it turns out that someone is
relying on this, we can easily add it back as an extension.

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

8 years ago[Driver][Darwin] Pass -no_deduplicate to ld64
Bruno Cardoso Lopes [Fri, 21 Oct 2016 01:49:14 +0000 (01:49 +0000)]
[Driver][Darwin] Pass -no_deduplicate to ld64

Recent versions of ld64 run a deduplicate pass, which is on by default.
Disable the pass by using -no_deduplicate in certain condition and
enhance total compile time.

rdar://problem/25455336

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

8 years ago[Modules] Add 'no_undeclared_includes' module map attribute
Bruno Cardoso Lopes [Fri, 21 Oct 2016 01:41:56 +0000 (01:41 +0000)]
[Modules] Add 'no_undeclared_includes' module map attribute

The 'no_undeclared_includes' attribute should be used in a module to
tell that only non-modular headers and headers from used modules are
accepted.

The main motivation behind this is to prevent dep cycles between system
libraries (such as darwin) and libc++.

Patch by Richard Smith!

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

8 years agoRevert 9 changes from r284793, they still fail on some bots
Reid Kleckner [Thu, 20 Oct 2016 23:30:39 +0000 (23:30 +0000)]
Revert 9 changes from r284793, they still fail on some bots

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

8 years agoRemove 24 instances of 'REQUIRES: shell'
Reid Kleckner [Thu, 20 Oct 2016 23:11:45 +0000 (23:11 +0000)]
Remove 24 instances of 'REQUIRES: shell'

Tests fall into one of the following categories:

- The requirement was unnecessary

- Additional quoting was required for backslashes in paths (see "sed -e
  's/\\/\\\\/g'") in the sanitizer tests.

- OpenMP used 'REQUIRES: shell' as a proxy for the test failing on
  Windows. Those tests fail there reliably, so use XFAIL instead.

I tried not to remove shell requirements that were added to suppress
flaky test failures, but if I screwed up, we can add it back as needed.

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

8 years agoRe-commit r284753, reverted in r284778, with a fix for PR30749.
Richard Smith [Thu, 20 Oct 2016 21:53:09 +0000 (21:53 +0000)]
Re-commit r284753, reverted in r284778, with a fix for PR30749.

Original commit message:

[c++1z] Teach composite pointer type computation how to compute the composite
pointer type of two function pointers with different noexcept specifications.
While I'm here, also teach it how to merge dynamic exception specifications.

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

8 years ago[clang] Remove FileEntry copy-constructor
Alexander Shaposhnikov [Thu, 20 Oct 2016 21:20:35 +0000 (21:20 +0000)]
[clang] Remove FileEntry copy-constructor

Code cleanup: address FIXME in the file
include/clang/Basic/FileManager.h and remove
copy-constructor of the class FileEntry.

Test plan: make check-clang

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

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

8 years agoRevert "Disable swiftcall test on windows: More brutal way to appease windows bots"
Reid Kleckner [Thu, 20 Oct 2016 21:17:28 +0000 (21:17 +0000)]
Revert "Disable swiftcall test on windows: More brutal way to appease windows bots"

This reverts commit r284174. The tests pass for me locally. It must have
been a 2015 only crash.

Fixes PR30699

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

8 years agoRevert r284753 "[c++1z] Teach composite pointer type computation how to compute the...
Hans Wennborg [Thu, 20 Oct 2016 20:54:32 +0000 (20:54 +0000)]
Revert r284753 "[c++1z] Teach composite pointer type computation how to compute the composite"

It caused PR30749.

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

8 years agoFix off-by-one error in PPCaching.cpp token annotation assertion
Reid Kleckner [Thu, 20 Oct 2016 20:53:20 +0000 (20:53 +0000)]
Fix off-by-one error in PPCaching.cpp token annotation assertion

This assert is intended to defend against backtracking into the middle
of a sequence of tokens that is being replaced with an annotation, but
it's OK if we backtrack to the exact position of the start of the
annotation sequence. Use a <= comparison instead of <.

Fixes PR25946

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

8 years ago[Driver] Refactor DetectDistro() parameters to take VFS ref only. NFC
Michal Gorny [Thu, 20 Oct 2016 20:45:40 +0000 (20:45 +0000)]
[Driver] Refactor DetectDistro() parameters to take VFS ref only. NFC

Refactor the DetectDistro() function to take a single vfs::FileSystem
reference only, instead of Driver and llvm::Triple::ArchType.
The ArchType parameter was not used anyway, and Driver was only used to
obtain the VFS.

Aside to making the API simpler and more transparent, it makes it
easier to add unit tests for the function in the future -- since
the tests would need only to provide an appropriate VFS.

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

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

8 years ago[Driver] Parse Debian version as integer when possible. NFC
Michal Gorny [Thu, 20 Oct 2016 20:13:35 +0000 (20:13 +0000)]
[Driver] Parse Debian version as integer when possible. NFC

Replace the string matching for /etc/debian_version with split
integer/string matching algorithm. When the file contains 'major.minor'
version number, parse the major version as integer and use a switch
clause to match it. Otherwise, attempt 'codename/sid' matching using
a StringSwitch.

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

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

8 years ago[CodeGen] Devirtualize calls to methods marked final in a derived class
Vedant Kumar [Thu, 20 Oct 2016 18:44:14 +0000 (18:44 +0000)]
[CodeGen] Devirtualize calls to methods marked final in a derived class

If we see a virtual method call to Base::foo() but can infer that the
object is an instance of Derived, and that 'foo' is marked 'final' in
Derived, we can devirtualize the call to Derived::foo().

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

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

8 years ago[c++1z] Fix assertion failure when using the wrong number of bindings for a
Richard Smith [Thu, 20 Oct 2016 18:29:25 +0000 (18:29 +0000)]
[c++1z] Fix assertion failure when using the wrong number of bindings for a
struct with unnamed bitfields.

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

8 years agoAdd more doxygen comments to emmintrin.h's intrinsics.
Ekaterina Romanova [Thu, 20 Oct 2016 17:59:15 +0000 (17:59 +0000)]
Add more doxygen comments to emmintrin.h's intrinsics.

With this patch, 75% of the intrinsics in this file will be documented now. The patches for the rest of the intrisics in this file will be send out later.

The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. This patch was internally reviewed by Yunzhong Gao.

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

8 years ago[c++1z] Teach composite pointer type computation how to compute the composite
Richard Smith [Thu, 20 Oct 2016 17:57:33 +0000 (17:57 +0000)]
[c++1z] Teach composite pointer type computation how to compute the composite
pointer type of two function pointers with different noexcept specifications.
While I'm here, also teach it how to merge dynamic exception specifications.

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

8 years ago[clang-cl] Fix test that shouldn't be running on non-x86
Renato Golin [Thu, 20 Oct 2016 17:41:08 +0000 (17:41 +0000)]
[clang-cl] Fix test that shouldn't be running on non-x86

The clang-cl test required x86-registered-target but it defaulted to the
host's triple and AArch64 still doesn't support COFF, so the test failed.

The triple was "aarch64-pc-windows-msvc18.0.0" with ObjectFormat equals
llvm::Triple::COFF, failing assertion:

Assertion `(TT.isOSBinFormatELF() || TT.isOSBinFormatMachO()) &&
          "Only expect Darwin and ELF targets"

in AArch64MCTargetDesc.cpp:78.

Making the test only run on Windows hosts obviously fixes the problem.

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

8 years ago[Format] Cleanup after replacing constructor body with = default
Malcolm Parsons [Thu, 20 Oct 2016 14:58:45 +0000 (14:58 +0000)]
[Format] Cleanup after replacing constructor body with = default

Summary:
Remove colon and commas after replacing constructor body with = default.
Fix annotation of TT_CtorInitializerColon when preceded by a comment.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

8 years agoRetire llvm::alignOf in favor of C++11 alignof.
Benjamin Kramer [Thu, 20 Oct 2016 14:27:22 +0000 (14:27 +0000)]
Retire llvm::alignOf in favor of C++11 alignof.

No functionality change intended.

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

8 years agoClean up alignment hacks now that MSVC 2013 and GCC 4.7 are gone.
Benjamin Kramer [Thu, 20 Oct 2016 13:52:26 +0000 (13:52 +0000)]
Clean up alignment hacks now that MSVC 2013 and GCC 4.7 are gone.

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

8 years agoWork around MSVC rejects-valid. Apparenty (some versions of) MSVC will check
Richard Smith [Thu, 20 Oct 2016 07:53:17 +0000 (07:53 +0000)]
Work around MSVC rejects-valid. Apparenty (some versions of) MSVC will check
that a member is default-initializable even if it's initialized by a default
member initializer.

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

8 years agoReplace uses of LLVM_FUNCTION_NAME with __func__, this was macro was removed from...
Erik Pilkington [Thu, 20 Oct 2016 02:46:22 +0000 (02:46 +0000)]
Replace uses of LLVM_FUNCTION_NAME with __func__, this was macro was removed from llvm/Support in r284681

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

8 years agoRefactor and simplify Sema::FindCompositePointerType. No functionality change intended.
Richard Smith [Thu, 20 Oct 2016 01:20:00 +0000 (01:20 +0000)]
Refactor and simplify Sema::FindCompositePointerType. No functionality change intended.

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

8 years agoPR26276: Fix detection of non-cast-expressions as operands of fold-expressions.
Richard Smith [Thu, 20 Oct 2016 00:55:15 +0000 (00:55 +0000)]
PR26276: Fix detection of non-cast-expressions as operands of fold-expressions.

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

8 years agoUpgrade debug-info-vla test: we do not pass default alignment now
Victor Leschuk [Thu, 20 Oct 2016 00:37:07 +0000 (00:37 +0000)]
Upgrade debug-info-vla test: we do not pass default alignment now

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

8 years agoDebugInfo: pass alignment value only if it was forced
Victor Leschuk [Thu, 20 Oct 2016 00:13:19 +0000 (00:13 +0000)]
DebugInfo: pass alignment value only if it was forced

Preparation to implement DW_AT_alignment support:
 - We pass non-zero align value to DIBuilder only when alignment was forced
 - Modify tests to match this change

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

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

8 years agoFix crash on noreturn conversion in unprototyped function type. Thanks to Keith
Richard Smith [Thu, 20 Oct 2016 00:01:36 +0000 (00:01 +0000)]
Fix crash on noreturn conversion in unprototyped function type. Thanks to Keith
Walker for spotting the bug.

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

8 years agoExtend hack to work around bad exception specifications for 'swap' members to
Richard Smith [Wed, 19 Oct 2016 23:47:37 +0000 (23:47 +0000)]
Extend hack to work around bad exception specifications for 'swap' members to
also cover libstdc++'s std::__debug::array and std::__profile::array.

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

8 years agoUse noexcept instead of LLVM_NOEXCEPT now that all compilers support it
Reid Kleckner [Wed, 19 Oct 2016 23:39:55 +0000 (23:39 +0000)]
Use noexcept instead of LLVM_NOEXCEPT now that all compilers support it

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

8 years ago[cmake] Follow LLVM's lead in creating exported tool targets for clang tools.
Michael Gottesman [Wed, 19 Oct 2016 22:46:06 +0000 (22:46 +0000)]
[cmake] Follow LLVM's lead in creating exported tool targets for clang tools.

This is needed by downstream projects such as swift to get proper cmake
dependency information for LLVM/Clang targets.

A few months ago I added support for exporting this information for Clang
libraries. In order to be incremental, I did not add support for exporting clang
tools as well at that time. Now such support is needed, so I am committing this
incremental code.

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

8 years agoAdd optimization to sizeof...(X) handling: if none of parameter pack X's
Richard Smith [Wed, 19 Oct 2016 22:18:42 +0000 (22:18 +0000)]
Add optimization to sizeof...(X) handling: if none of parameter pack X's
corresponding arguments are unexpanded pack expansions, we can compute the
result without substituting them. This significantly improves the memory usage
and performance of make_integer_sequence implementations that do this kind of
thing:

  using result = integer_sequence<T, Ns ..., sizeof...(Ns) + Ns ...>;

... but note that such an implementation will still perform O(sizeof...(Ns)^2)
work while building the second pack expansion (we just have a somewhat lower
constant now).

In principle we could get this down to linear time by caching whether the
number of expansions of a pack is constant, or checking whether we're within an
alias template before scanning the pack for pack expansions (since that's the
only case in which we do substitutions within a dependent context at the
moment), but this patch doesn't attempt that.

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

8 years agoDon't crash generating debug info for VLA in function prototype.
Eli Friedman [Wed, 19 Oct 2016 22:16:32 +0000 (22:16 +0000)]
Don't crash generating debug info for VLA in function prototype.

Fixes regression from r279445.

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

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

8 years agoDebugInfo: use uint32_t for alignment variables.
Victor Leschuk [Wed, 19 Oct 2016 22:11:07 +0000 (22:11 +0000)]
DebugInfo: use uint32_t for alignment variables.

LLVM now uses uint32_t for DebugInfo alignment for space efficiency,
in this patch we change frontend DebugInfo-related variables to uint32_t too.

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

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

8 years ago[CMake] Add clang-bootstrap-deps target
Chris Bieneman [Wed, 19 Oct 2016 21:18:48 +0000 (21:18 +0000)]
[CMake] Add clang-bootstrap-deps target

Having this target allows other parts of the build system to add to the bootstrap dependencies without needing to be defined before the bootstrap targets are created.

This will specifically be used connect the builtins build from the LLVM runtimes directory as a dependency of the next build stage.

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

8 years ago[CUDA] When we emit an error that might have been deferred, also print a callstack.
Justin Lebar [Wed, 19 Oct 2016 21:15:01 +0000 (21:15 +0000)]
[CUDA] When we emit an error that might have been deferred, also print a callstack.

Summary:
Previously, when you did something not allowed in a host+device function
and then caused it to be codegen'ed, we would print out an error telling
you that you did something bad, but we wouldn't tell you how we decided
that the function needed to be codegen'ed.

This change causes us to print out a callstack when emitting deferred
errors.  This is immensely helpful when debugging highly-templated code,
where it's often unclear how a function became known-emitted.

We only print the callstack once per function, after we print the all
deferred errors.

This patch also switches all of our hashtables to using canonical
FunctionDecls instead of regular FunctionDecls.  This prevents a number
of bugs, some of which are caught by tests added here, in which we
assume that two FDs for the same function have the same pointer value.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

8 years ago[CMake] Support thin LTO in PGO CMake cache
Chris Bieneman [Wed, 19 Oct 2016 21:12:04 +0000 (21:12 +0000)]
[CMake] Support thin LTO in PGO CMake cache

This allows you to set PGO_INSTRUMENT_LTO=Thin and have it work correctly.

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

8 years ago[AST] Add CanonicalDeclPtr<T>.
Justin Lebar [Wed, 19 Oct 2016 21:03:42 +0000 (21:03 +0000)]
[AST] Add CanonicalDeclPtr<T>.

Summary:
CanonicalDeclPtr<T> is just like a T*, except it calls
T::getCanonicalDecl() on construction.

This is useful as the key in a "set of canonical Decls" -- it's much
less error-prone than calling getCanonicalDecl() every time you touch
the set.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

8 years ago[CUDA] Emit errors for wrong-side calls made on the same line as non-wrong-side calls.
Justin Lebar [Wed, 19 Oct 2016 21:03:38 +0000 (21:03 +0000)]
[CUDA] Emit errors for wrong-side calls made on the same line as non-wrong-side calls.

Summary:
This fixes two related bugs:

1) Previously, if you had a non-wrong side call at some source code
location L, we wouldn't emit errors for wrong-side calls that appeared
at L.

2) We'd only emit one wrong-side error per source code location, when we
actually want to emit it twice if we hit this line more than once due to
e.g. template instantiation.

Reviewers: tra

Subscribers: rnk, cfe-commits

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

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

8 years ago[ubsan] Drop dependency on a 64-bit arch in a test (NFC)
Vedant Kumar [Wed, 19 Oct 2016 20:53:16 +0000 (20:53 +0000)]
[ubsan] Drop dependency on a 64-bit arch in a test (NFC)

This should fix:

    http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/46184

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

8 years ago[ubsan] Re-work check lines to try to appease a bot (NFC)
Vedant Kumar [Wed, 19 Oct 2016 20:28:35 +0000 (20:28 +0000)]
[ubsan] Re-work check lines to try to appease a bot (NFC)

This bot does not produce the IR I expect -- it's missing some
'handler.dynamic_type_cache_miss:' labels. We don't need to rely on
those labels, so get rid of them in hopes of making the bot happy.

    http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55493

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

8 years agoNew clang option -mpie-copy-relocations to use copy relocations for PIE builds.
Sriraman Tallam [Wed, 19 Oct 2016 20:24:06 +0000 (20:24 +0000)]
New clang option -mpie-copy-relocations to use copy relocations for PIE builds.

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

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

8 years ago[ubsan] Use the object pointer's type info for devirtualized calls
Vedant Kumar [Wed, 19 Oct 2016 20:21:16 +0000 (20:21 +0000)]
[ubsan] Use the object pointer's type info for devirtualized calls

ubsan reports a false positive 'invalid member call' diagnostic on the
following example (PR30478):

  struct Base1 {
    virtual int f1() { return 1; }
  };

  struct Base2 {
    virtual int f1() { return 2; }
  };

  struct Derived2 final : Base1, Base2 {
    int f1() override { return 3; }
  };

  int t1() {
    Derived2 d;
    return static_cast<Base2 *>(&d)->f1();
  }

Adding the "final" attribute to a most-derived class allows clang to
devirtualize member calls into an instance of that class. We should pass
along the type info of the object pointer to avoid the FP. In this case,
that means passing along the type info for 'Derived2' instead of 'Base2'
when checking the dynamic type of static_cast<Base2 *>(&d2).

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

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

8 years agoMS ABI: Fix assert when generating virtual function call with virtual bases and ...
Hans Wennborg [Wed, 19 Oct 2016 18:04:27 +0000 (18:04 +0000)]
MS ABI: Fix assert when generating virtual function call with virtual bases and -flto (PR30731)

getClassAtVTableLocation() was calling
ASTRecordLayout::getBaseClassOffset() on a virtual base, causing an
assert.

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

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

8 years ago[mips][msa] Range check MSA intrinsics with immediates
Simon Dardis [Wed, 19 Oct 2016 17:50:52 +0000 (17:50 +0000)]
[mips][msa] Range check MSA intrinsics with immediates

This patch teaches clang to range check immediates for MIPS MSA instrinsics.
This checking is done strictly in comparison to some existing GCC
implementations. E.g. msa_andvi_b(var, 257) does not result in andvi $wX, 1.
Similarily msa_ldi_b takes a range of -128 to 127.

As part of this effort, correct the existing MSA test as it has both illegal
types and immediates.

Reviewers: vkalintiris

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

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

8 years ago[Myriad] Find libc++ headers next to clang binary
Douglas Katzman [Wed, 19 Oct 2016 17:30:40 +0000 (17:30 +0000)]
[Myriad] Find libc++ headers next to clang binary

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

8 years agoRemove unused diagnostics. NFC.
Benjamin Kramer [Wed, 19 Oct 2016 14:22:38 +0000 (14:22 +0000)]
Remove unused diagnostics. NFC.

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

8 years agoDon't copy replacements in for-range loop. NFC.
Benjamin Kramer [Wed, 19 Oct 2016 13:50:17 +0000 (13:50 +0000)]
Don't copy replacements in for-range loop. NFC.

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

8 years ago[cmake] Use LLVM_CMAKE_PATH for GetSVN script
Michal Gorny [Wed, 19 Oct 2016 12:21:39 +0000 (12:21 +0000)]
[cmake] Use LLVM_CMAKE_PATH for GetSVN script

Use the LLVM_CMAKE_PATH variable to locate the GetSVN.cmake script.
The variable was already available in stand-alone builds, and is also
set by LLVM since r284581.

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

8 years ago[Sema] Gcc compatibility of vector shift
Andrey Bokhanko [Wed, 19 Oct 2016 12:06:10 +0000 (12:06 +0000)]
[Sema] Gcc compatibility of vector shift

Gcc prints error if elements of left and right parts of a shift have different
sizes. This patch is provided the GCC compatibility.

Patch by Vladimir Yakovlev.

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

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

8 years ago[modules] Do not report missing definitions of demoted constexpr variable templates.
Vassil Vassilev [Wed, 19 Oct 2016 11:19:30 +0000 (11:19 +0000)]
[modules] Do not report missing definitions of demoted constexpr variable templates.

This is a followup to regression introduced in r284284.

This should fix our libstdc++ modules builds.

https://reviews.llvm.org/D25678

Reviewed by Richard Smith!

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

8 years ago[clang-format] Add comment manipulation header
Eric Liu [Wed, 19 Oct 2016 08:19:46 +0000 (08:19 +0000)]
[clang-format] Add comment manipulation header

Summary:
Introduces a separate target for comment manipulation.
Currently, comment manipulation is in BreakableComment.cpp.
Towards implementing comment reflowing, we want to factor out the
comment-related functionality, so it can be reused.
Start simple by just moving out getLineCommentIndentPrefix.

Patch by Krasimir Georgiev!

Reviewers: djasper

Subscribers: klimek, beanz, mgorny, modocache

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

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

8 years agoResolve exception specifications when selecting an overloaded operator.
Richard Smith [Wed, 19 Oct 2016 00:14:23 +0000 (00:14 +0000)]
Resolve exception specifications when selecting an overloaded operator.

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

8 years ago[CUDA] Rework tests now that we emit deferred diagnostics during sema. Test-only...
Justin Lebar [Wed, 19 Oct 2016 00:06:49 +0000 (00:06 +0000)]
[CUDA] Rework tests now that we emit deferred diagnostics during sema.  Test-only change.

Summary:
Previously we had to split out a lot of our tests into a test that
checked only immediate errors and a test that checked only deferred
errors.  This was because, if you emitted any immediate errors, we
wouldn't run codegen, where the deferred errors were emitted.

We've fixed this, and now emit deferred errors during sema.  This lets
us merge a bunch of tests, and lets us convert some other tests to
-fsyntax-only.

Reviewers: tra

Subscribers: cfe-commits

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

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

8 years agoDR1330: instantiate exception-specifications when "needed". We previously did
Richard Smith [Tue, 18 Oct 2016 23:39:12 +0000 (23:39 +0000)]
DR1330: instantiate exception-specifications when "needed". We previously did
not instantiate exception specifications of functions if they were only used in
unevaluated contexts (other than 'noexcept' expressions).

In C++17 onwards, this becomes essential since the exception specification is
now part of the function's type.

Note that this means that constructs like the following no longer work:

  struct A {
    static T f() noexcept(...);
    decltype(f()) *p;
  };

... because the decltype expression now needs the exception specification of
'f', which has not yet been parsed.

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

8 years agoAdd missing warning for use of C++1z init-statements in C++14 and before.
Richard Smith [Tue, 18 Oct 2016 20:27:16 +0000 (20:27 +0000)]
Add missing warning for use of C++1z init-statements in C++14 and before.

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

8 years ago[c++1z] Fix corner case where we could create a function type whose canonical type...
Richard Smith [Tue, 18 Oct 2016 20:13:25 +0000 (20:13 +0000)]
[c++1z] Fix corner case where we could create a function type whose canonical type is not actually canonical.

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

8 years agoWhen two function types have equivalent (but distinct) noexcept specifications, creat...
Richard Smith [Tue, 18 Oct 2016 19:29:18 +0000 (19:29 +0000)]
When two function types have equivalent (but distinct) noexcept specifications, create separate type sugar nodes. This is necessary so that substitution into the exception specification will substitute into the correct expression.

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

8 years agoFix clang tests
Mandeep Singh Grang [Tue, 18 Oct 2016 19:22:20 +0000 (19:22 +0000)]
Fix clang tests

Summary:
Add REQUIRES for target specific tests.

Patch by Azharuddin Mohammed.

Reviewers: apazos, weimingz, rsmith, ddunbar, spop, mgrang

Subscribers: sebpop, llvm-commits

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

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

8 years ago[CodeGen][ObjC] Do not call objc_storeStrong when initializing a
Akira Hatanaka [Tue, 18 Oct 2016 19:05:41 +0000 (19:05 +0000)]
[CodeGen][ObjC] Do not call objc_storeStrong when initializing a
constexpr variable.

When compiling a constexpr NSString initialized with an objective-c
string literal, CodeGen emits objc_storeStrong on an uninitialized
alloca, which causes a crash.

This patch folds the code in EmitScalarInit into EmitStoreThroughLValue
and fixes the crash by calling objc_retain on the string instead of
using objc_storeStrong.

rdar://problem/28562009

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

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

8 years agoDrop a redundant ".get()" call (NFC)
Vedant Kumar [Tue, 18 Oct 2016 18:19:02 +0000 (18:19 +0000)]
Drop a redundant ".get()" call (NFC)

Pointed out by Malcolm Parsons.

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

8 years ago[cmake] Update lit search to match the one in LLVM
Michal Gorny [Tue, 18 Oct 2016 17:07:30 +0000 (17:07 +0000)]
[cmake] Update lit search to match the one in LLVM

Update the lit search logic to support all names supported in LLVM
(since r283029). The search order (i.e. PATHS vs HINTS) does no really
matter since the established path is not used, except for determining
whether lit is available.

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

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

8 years agoRevert r284265 "[Sema] Refactor context checking for availability diagnostics"
Erik Pilkington [Tue, 18 Oct 2016 15:26:43 +0000 (15:26 +0000)]
Revert r284265 "[Sema] Refactor context checking for availability diagnostics"

This has a bug in it, pointed out by Bob Wilson!

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

8 years agoalpha.core.UnreachableCode - don't warn about unreachable code inside macro
Daniel Marjamaki [Tue, 18 Oct 2016 13:16:53 +0000 (13:16 +0000)]
alpha.core.UnreachableCode - don't warn about unreachable code inside macro

In macros, 'do {...} while (0)' is often used. Don't warn about the condition 0 when it is unreachable.

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

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

8 years ago[analyzer] Add NumberObjectConversion checker.
Artem Dergachev [Tue, 18 Oct 2016 11:06:28 +0000 (11:06 +0000)]
[analyzer] Add NumberObjectConversion checker.

When dealing with objects that represent numbers, such as Objective-C NSNumber,
the language provides little protection from accidentally interpreting
the value of a pointer to such object as the value of the number represented
by the object. Results of such mis-interpretation may be unexpected.

The checker attempts to fill this gap in cases when the code is obviously
incorrect.

With "Pedantic" option enabled, this checker enforces a coding style to
completely prevent errors of this kind (off by default).

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

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

8 years ago[CodeCompletion] Add a block property setter completion result
Alex Lorenz [Tue, 18 Oct 2016 10:55:01 +0000 (10:55 +0000)]
[CodeCompletion] Add a block property setter completion result

This commit changes code completion results for Objective-C block properties:
clang now suggests an additional completion result that displays the block
property together with '=' and the block literal placeholder for the appropriate
readwrite block properties.

This commit uses a simple heuristic to determine when it's appropriate to
suggest a setter completion for block properties: the additional block setter
completion is provided iff the member access that's being completed is a
standalone statement.

rdar://28481726

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

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

8 years ago[CodeCompletion][NFC] Extract a function that formats block placeholders.
Alex Lorenz [Tue, 18 Oct 2016 10:38:58 +0000 (10:38 +0000)]
[CodeCompletion][NFC] Extract a function that formats block placeholders.

This commit extracts a new function named `formatBlockPlaceholder` from
the function `FormatFunctionParameter` so that it can be reused in follow-up
commits that improve code completion for block property setters.

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

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

8 years ago[CodeCompletion][NFC] Extract a function that looks for block decl type locs.
Alex Lorenz [Tue, 18 Oct 2016 10:35:27 +0000 (10:35 +0000)]
[CodeCompletion][NFC] Extract a function that looks for block decl type locs.

This commit extracts a new function named `findTypeLocationForBlockDecl` from
the function `FormatFunctionParameter` so that it can be reused in follow-up
commits that improve code completion for block property setters.

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

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

8 years ago[libclang] Add missing cursor kinds to python bindings.
Igor Kudrin [Tue, 18 Oct 2016 09:42:03 +0000 (09:42 +0000)]
[libclang] Add missing cursor kinds to python bindings.

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

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

8 years ago[libclang] Fix a failure in a test for python bindings on CursorKind.OVERLOAD_CANDIDATE.
Igor Kudrin [Tue, 18 Oct 2016 09:30:33 +0000 (09:30 +0000)]
[libclang] Fix a failure in a test for python bindings on CursorKind.OVERLOAD_CANDIDATE.

The test fails because the value does not lay in any existing group.

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

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

8 years ago[c++1z] Include "noexcept" in builtin function types where appropriate. Fixes
Richard Smith [Tue, 18 Oct 2016 07:13:55 +0000 (07:13 +0000)]
[c++1z] Include "noexcept" in builtin function types where appropriate. Fixes
an assertion failure looking up a matching ::operator delete for
__builtin_operator_delete.

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

8 years ago[c++1z] Use canonical expression equivalence to determine whether two different
Richard Smith [Tue, 18 Oct 2016 06:47:03 +0000 (06:47 +0000)]
[c++1z] Use canonical expression equivalence to determine whether two different
dependent noexcept specifications result in the same canonical function type.

We still use non-canonical hashing when deduplicating type sugar so that
diagnostics will point to the right place.

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

8 years ago[analyzer] Update alpha and potential checker documentation, esp. alpha.valist
Dominic Chen [Tue, 18 Oct 2016 01:15:19 +0000 (01:15 +0000)]
[analyzer] Update alpha and potential checker documentation, esp. alpha.valist

Summary:
Move alpha.valist from potential to alpha since it was implemented in D15227

Cleanup some HTML comments, add a missing link

Reviewers: jordan_rose, zaks.anna

Subscribers: cfe-commits, xazax.hun

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

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

8 years ago[CMake] Add a few default passthrough variables for bootstrap builds
Chris Bieneman [Tue, 18 Oct 2016 00:50:20 +0000 (00:50 +0000)]
[CMake] Add a few default passthrough variables for bootstrap builds

This just passes through a few missing CMake variables for multi-stage builds.

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

8 years ago[Basic] unique_ptr-ify SourceManager::MacroArgsCacheMap (NFC)
Vedant Kumar [Tue, 18 Oct 2016 00:23:27 +0000 (00:23 +0000)]
[Basic] unique_ptr-ify SourceManager::MacroArgsCacheMap (NFC)

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

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

8 years ago[Driver] Use stem rather than filename for executable name
Petr Hosek [Mon, 17 Oct 2016 22:02:53 +0000 (22:02 +0000)]
[Driver] Use stem rather than filename for executable name

When comparing the linker name in Fuchsia driver, use stem rather
than filename to get the name of the linker becase on Windows, the
filename will have an extension.

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

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

8 years agoExplicitly pass an isysroot to avoid the SDKROOT overriding the deployment target.
Adrian Prantl [Mon, 17 Oct 2016 20:37:56 +0000 (20:37 +0000)]
Explicitly pass an isysroot to avoid the SDKROOT overriding the deployment target.
This fixes the green dragon builders after r284416.

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

8 years agoImprove the CHECK lines in debug-options.c by separating out the check
Adrian Prantl [Mon, 17 Oct 2016 20:14:23 +0000 (20:14 +0000)]
Improve the CHECK lines in debug-options.c by separating out the check
for debug info kind and dwarf version.

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

8 years ago[Coverage] Update test after r284418.
Davide Italiano [Mon, 17 Oct 2016 20:06:32 +0000 (20:06 +0000)]
[Coverage] Update test after r284418.

We now strip coverage metadata if debug info are not present.

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

8 years agoUpdate testcase for r284416.
Adrian Prantl [Mon, 17 Oct 2016 19:46:26 +0000 (19:46 +0000)]
Update testcase for r284416.

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

8 years agoDriver/Darwin: Set the DWARF version based on the deployment target.
Adrian Prantl [Mon, 17 Oct 2016 19:36:18 +0000 (19:36 +0000)]
Driver/Darwin: Set the DWARF version based on the deployment target.

System utilities such as atos only support DWARF 4 on OS X 10.11+ and
iOS 9+. We thus want to enable DWARF 4 only if the deployment target
has a recent enough operating system version and use DWARF 2 for older
systems.

<rdar://problem/28766743>

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

8 years ago[Driver] Use VFS to perform all distribution checks
Michal Gorny [Mon, 17 Oct 2016 18:07:15 +0000 (18:07 +0000)]
[Driver] Use VFS to perform all distribution checks

Use the VFS provided by D.getVFS() for all distribution checks,
including those performing read of the release file. Requested
by @bruno on D24954.

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

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

8 years agoAdd a dummy file in each subdirectory in test/Driver/Inputs/hexagon_tree
Krzysztof Parzyszek [Mon, 17 Oct 2016 18:04:05 +0000 (18:04 +0000)]
Add a dummy file in each subdirectory in test/Driver/Inputs/hexagon_tree

Git does not store empty subdirectories (while SVN does). Git clone of
the clang repository did not create the fake Hexagon installation tree
used for testing the driver. This only became evident after a change
in the Hexagon toolchain that started checking for existence of certain
directories.

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

8 years agoHexagon: add dummy files to test dir so git keeps them.
Tim Northover [Mon, 17 Oct 2016 18:00:27 +0000 (18:00 +0000)]
Hexagon: add dummy files to test dir so git keeps them.

Should fix hexagon-elf-toolchain.c tests on Git.

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

8 years agoFix a typo.
Adrian Prantl [Mon, 17 Oct 2016 17:41:51 +0000 (17:41 +0000)]
Fix a typo.

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

8 years agoReapply r284383. The test failures were due to a missing dir in test/
Krzysztof Parzyszek [Mon, 17 Oct 2016 15:30:10 +0000 (15:30 +0000)]
Reapply r284383. The test failures were due to a missing dir in test/

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

8 years agoRevert r284383, while I figure out how to reproduce the failures locally
Krzysztof Parzyszek [Mon, 17 Oct 2016 14:47:29 +0000 (14:47 +0000)]
Revert r284383, while I figure out how to reproduce the failures locally

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

8 years agoReturn correct path from HexagonToolChain::getHexagonTargetDir
Krzysztof Parzyszek [Mon, 17 Oct 2016 13:23:41 +0000 (13:23 +0000)]
Return correct path from HexagonToolChain::getHexagonTargetDir

This problem was exposed by r284129, causing clang-hexagon-elf to fail
clang tests.

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

8 years agoRevert "Reinstate r281429, reverted in r281452, with a fix for its mishandling of"
Benjamin Kramer [Mon, 17 Oct 2016 13:00:44 +0000 (13:00 +0000)]
Revert "Reinstate r281429, reverted in r281452, with a fix for its mishandling of"

This reverts commit r284176. It still marks some modules as invisible
that should be visible. Will follow up with the author with a test case.

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

8 years agoDo not reset TUScope when we are in incremental processing mode.
Vassil Vassilev [Mon, 17 Oct 2016 10:15:25 +0000 (10:15 +0000)]
Do not reset TUScope when we are in incremental processing mode.

Patch by Axel Naumann!

Reviewed by Richard Smith and me.

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

8 years agoAST: Prefer LLVM_NODISCARD to LLVM_ATTRIBUTE_UNUSED_RESULT
Justin Bogner [Mon, 17 Oct 2016 06:46:35 +0000 (06:46 +0000)]
AST: Prefer LLVM_NODISCARD to LLVM_ATTRIBUTE_UNUSED_RESULT

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

8 years ago[CUDA] Fix false-positive in known-emitted handling.
Justin Lebar [Mon, 17 Oct 2016 02:25:55 +0000 (02:25 +0000)]
[CUDA] Fix false-positive in known-emitted handling.

Previously: When compiling for host, our constructed call graph went
*through* kernel calls.  This meant that if we had

  host calls kernel calls HD

we would incorrectly mark the HD function as known-emitted on the host
side, and thus perform host-side checks on it.

Fixing this exposed another issue, wherein when marking a function as
known-emitted, we also need to traverse the callgraph of its template,
because non-dependent calls are attached to a function's template, not
its instantiation.

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

8 years agoclang/test/CXX/conv/conv.fctptr/p1.cpp: Appease for targeting i686-win32.
NAKAMURA Takumi [Sun, 16 Oct 2016 23:00:18 +0000 (23:00 +0000)]
clang/test/CXX/conv/conv.fctptr/p1.cpp: Appease for targeting i686-win32.

  error: 'error' diagnostics seen but not expected:
    File clang\test\CXX\conv\conv.fctptr\p1.cpp Line 16: assigning to 'void (S::*)() __attribute__((thiscall)) noexcept' from incompatible type 'void (S::*)() __attribute__((thiscall))': different exception specifications

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

8 years agoRevert "Revert "[analyzer] Make MallocChecker more robust against custom redeclarations""
Devin Coughlin [Sun, 16 Oct 2016 22:19:03 +0000 (22:19 +0000)]
Revert "Revert "[analyzer] Make MallocChecker more robust against custom redeclarations""

This reverts commit r284340 to reapply r284335. The bot breakage was due to
an unrelated change in the polybench test suite.

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

8 years agoAST: Improve a couple of comments and cast unused values to void
Justin Bogner [Sun, 16 Oct 2016 20:12:42 +0000 (20:12 +0000)]
AST: Improve a couple of comments and cast unused values to void

Make these comments a bit more explicit that they're initializing the
RawText member, and explicitly cast the unused result of getRawText to
void for clarity.

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

8 years agoRevert "[analyzer] Make MallocChecker more robust against custom redeclarations"
Devin Coughlin [Sun, 16 Oct 2016 19:26:07 +0000 (19:26 +0000)]
Revert "[analyzer] Make MallocChecker more robust against custom redeclarations"

This reverts commit r284335.

It appears to be causing test-suite compile-time and execution-time
performance measurements to take longer than expected on several bots.
This is surprising, because r284335 is a static-analyzer-only change.

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

8 years agoP0012R1: Make exception specifications be part of the type system. This
Richard Smith [Sun, 16 Oct 2016 17:54:23 +0000 (17:54 +0000)]
P0012R1: Make exception specifications be part of the type system. This
implements the bulk of the change (modifying the type system to include
exception specifications), but not all the details just yet.

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