]> granicus.if.org Git - clang/log
clang
9 years agoFix reference to sysroot in this test (broken in r226875).
Richard Smith [Fri, 23 Jan 2015 00:30:44 +0000 (00:30 +0000)]
Fix reference to sysroot in this test (broken in r226875).

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

9 years agoPR22299: Relocate code for handling -fmodule-map-file= so that we don't try to
Richard Smith [Fri, 23 Jan 2015 00:01:13 +0000 (00:01 +0000)]
PR22299: Relocate code for handling -fmodule-map-file= so that we don't try to
produce diagnostics with source locations before the diagnostics system is
ready for them.

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

9 years ago[Mips] Fix type of 64-bit integer in case of MIPS N64 ABI
Simon Atanasyan [Thu, 22 Jan 2015 23:16:48 +0000 (23:16 +0000)]
[Mips] Fix type of 64-bit integer in case of MIPS N64 ABI

Differential Revision: http://reviews.llvm.org/D7127

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

9 years agoReorganize test/Modules:
Richard Smith [Thu, 22 Jan 2015 23:07:47 +0000 (23:07 +0000)]
Reorganize test/Modules:
 * Put all input files under Inputs/, move corresponding tests into test/Modules.
 * Rename a modulemap test file to [...].modulemap, and teach lit that such files are tests.

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

9 years agoMake the ?: precedence warning handle pointers to the left of ?
Hans Wennborg [Thu, 22 Jan 2015 22:11:56 +0000 (22:11 +0000)]
Make the ?: precedence warning handle pointers to the left of ?

Previously, Clang would fail to warn on:

  int n = x + foo ? 1 : 2;

when foo is a pointer.

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

9 years agoSema: code completion for pointer and reference to functions.
Francisco Lopes da Silva [Thu, 22 Jan 2015 21:14:08 +0000 (21:14 +0000)]
Sema: code completion for pointer and reference to functions.

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

9 years agoWhen reporting constraints that should be constant, the type doesn't
Joerg Sonnenberger [Thu, 22 Jan 2015 21:01:00 +0000 (21:01 +0000)]
When reporting constraints that should be constant, the type doesn't
really help. Improve diagnostics.

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

9 years agoSema: Add FIXME note
Francisco Lopes da Silva [Thu, 22 Jan 2015 12:41:44 +0000 (12:41 +0000)]
Sema: Add FIXME note

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

9 years agoSupport ‘omp for’ with static chunked schedule kind.
Alexander Musman [Thu, 22 Jan 2015 08:49:35 +0000 (08:49 +0000)]
Support ‘omp for’ with static chunked schedule kind.

Differential Revision: http://reviews.llvm.org/D7006

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

9 years ago[MSan][Clang][MIPS] Enabled memory and dataflow options for MIPS64 platform
Mohit K. Bhakkad [Thu, 22 Jan 2015 07:21:22 +0000 (07:21 +0000)]
[MSan][Clang][MIPS] Enabled memory and dataflow options for MIPS64 platform

Reviewers: kcc, samsonov, petarj, eugenis

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

9 years ago[OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.
Alexey Bataev [Thu, 22 Jan 2015 06:17:56 +0000 (06:17 +0000)]
[OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.
"omp atomic read [seq_cst]" accepts expressions "v=x;". In this patch we perform
an atomic load of "x" (using builtin atomic loading instructions or a call to
"atomic_load()" for simple lvalues and "kmpc_atomic_start();load
<x>;kmpc_atomic_end();" for other lvalues), convert the result of loading to
type of "v" (using EmitScalarConversion() for simple types and
EmitComplexToScalarConversion() for conversions from complex to scalar) and then
store the result in "v".)
Differential Revision: http://reviews.llvm.org/D6431

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

9 years agoRevert commit revision 226786
Alexey Bataev [Thu, 22 Jan 2015 06:09:48 +0000 (06:09 +0000)]
Revert commit revision 226786
Need to add initialization of AtomicInfo::EvaluationKind field

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

9 years ago[OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.
Alexey Bataev [Thu, 22 Jan 2015 05:44:37 +0000 (05:44 +0000)]
[OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.
"omp atomic read [seq_cst]" accepts expressions "v=x;". In this patch we perform
an atomic load of "x" (using builtin atomic loading instructions or a call to
"atomic_load()" for simple lvalues and "kmpc_atomic_start();load
<x>;kmpc_atomic_end();" for other lvalues), convert the result of loading to
type of "v" (using EmitScalarConversion() for simple types and
EmitComplexToScalarConversion() for conversions from complex to scalar) and then
store the result in "v".)
Differential Revision: http://reviews.llvm.org/D6431

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

9 years agoRevert commit r226784.
Alexey Bataev [Thu, 22 Jan 2015 05:35:53 +0000 (05:35 +0000)]
Revert commit r226784.
Accidentally modified file SemaType.cpp must be restored to its original state.

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

9 years ago[OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.
Alexey Bataev [Thu, 22 Jan 2015 05:29:28 +0000 (05:29 +0000)]
[OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.
"omp atomic read [seq_cst]" accepts expressions "v=x;". In this patch we perform
an atomic load of "x" (using builtin atomic loading instructions or a call to
"atomic_load()" for simple lvalues and "kmpc_atomic_start();load
<x>;kmpc_atomic_end();" for other lvalues), convert the result of loading to
type of "v" (using EmitScalarConversion() for simple types and
EmitComplexToScalarConversion() for conversions from complex to scalar) and then
store the result in "v".
Differential Revision: http://reviews.llvm.org/D6431

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

9 years agoMakes a simple member function static.
Francisco Lopes da Silva [Thu, 22 Jan 2015 04:30:23 +0000 (04:30 +0000)]
Makes a simple member function static.

This function has been just included with the initial support for C++
parameter completion and it's trivial enough to be a static member.

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

9 years ago[modules] If we add an implicit special member to a class through an update
Richard Smith [Thu, 22 Jan 2015 03:50:31 +0000 (03:50 +0000)]
[modules] If we add an implicit special member to a class through an update
record, and that class declaration is not the canonical definition of the
class, be sure to add the class to the list of classes that are consulted when
we look up a special member in the canonical definition.

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

9 years agoFix test file names so they're picked up by lit.
Richard Smith [Thu, 22 Jan 2015 03:24:07 +0000 (03:24 +0000)]
Fix test file names so they're picked up by lit.

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

9 years agoSEH: Emit the constant filter 1 as a catch-all
Reid Kleckner [Thu, 22 Jan 2015 02:25:56 +0000 (02:25 +0000)]
SEH: Emit the constant filter 1 as a catch-all

Minor optimization of code like __try { ... } __except(1) { ... }.

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

9 years ago[modules] If we load two declarations with typedef names for linkage purposes
Richard Smith [Thu, 22 Jan 2015 02:21:23 +0000 (02:21 +0000)]
[modules] If we load two declarations with typedef names for linkage purposes
on top of a local declaration of the same entity, we still need to remember
that we loaded the first one or we may fail to merge the second one properly.

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

9 years agoInstrProf: Avoid creating profile names for symbols in system headers
Justin Bogner [Thu, 22 Jan 2015 02:17:23 +0000 (02:17 +0000)]
InstrProf: Avoid creating profile names for symbols in system headers

We don't emit any coverage mapping for uncovered functions that come
from system headers, but we were creating a GlobalVariable with each
of their names. This is wasteful since the linker will need to dead
strip the unused symbols, and it can lead to issues when merging
coverage with others TUs that do have coverage for those functions.

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

9 years ago[modules] It's possible to merge into the pattern of a class template before we
Richard Smith [Thu, 22 Jan 2015 01:41:56 +0000 (01:41 +0000)]
[modules] It's possible to merge into the pattern of a class template before we
load the definition data from the declaration itself. In that case, merge
properly; don't assume the prior definition is the same as our own.

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

9 years agoInitial support for Win64 SEH IR emission
Reid Kleckner [Thu, 22 Jan 2015 01:36:17 +0000 (01:36 +0000)]
Initial support for Win64 SEH IR emission

The lowering looks a lot like normal EH lowering, with the exception
that the exceptions are caught by executing filter expression code
instead of matching typeinfo globals. The filter expressions are
outlined into functions which are used in landingpad clauses where
typeinfo would normally go.

Major aspects that still need work:
- Non-call exceptions in __try bodies won't work yet. The plan is to
  outline the __try block in the frontend to keep things simple.
- Filter expressions cannot use local variables until capturing is
  implemented.
- __finally blocks will not run after exceptions. Fixing this requires
  work in the LLVM SEH preparation pass.

The IR lowering looks like this:

// C code:
bool safe_div(int n, int d, int *r) {
  __try {
    *r = normal_div(n, d);
  } __except(_exception_code() == EXCEPTION_INT_DIVIDE_BY_ZERO) {
    return false;
  }
  return true;
}

; LLVM IR:
define i32 @filter(i8* %e, i8* %fp) {
  %ehptrs = bitcast i8* %e to i32**
  %ehrec = load i32** %ehptrs
  %code = load i32* %ehrec
  %matches = icmp eq i32 %code, i32 u0xC0000094
  %matches.i32 = zext i1 %matches to i32
  ret i32 %matches.i32
}

define i1 zeroext @safe_div(i32 %n, i32 %d, i32* %r) {
  %rr = invoke i32 @normal_div(i32 %n, i32 %d)
      to label %normal unwind to label %lpad

normal:
  store i32 %rr, i32* %r
  ret i1 1

lpad:
  %ehvals = landingpad {i8*, i32} personality i32 (...)* @__C_specific_handler
      catch i8* bitcast (i32 (i8*, i8*)* @filter to i8*)
  %ehptr = extractvalue {i8*, i32} %ehvals, i32 0
  %sel = extractvalue {i8*, i32} %ehvals, i32 1
  %filter_sel = call i32 @llvm.eh.seh.typeid.for(i8* bitcast (i32 (i8*, i8*)* @filter to i8*))
  %matches = icmp eq i32 %sel, %filter_sel
  br i1 %matches, label %eh.except, label %eh.resume

eh.except:
  ret i1 false

eh.resume:
  resume
}

Reviewers: rjmccall, rsmith, majnemer

Differential Revision: http://reviews.llvm.org/D5607

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

9 years agoRevert "Try to fix -Asserts build bots."
Rafael Espindola [Thu, 22 Jan 2015 01:33:41 +0000 (01:33 +0000)]
Revert "Try to fix -Asserts build bots."

This reverts commit r226758.

Looks like rnk's 226757 fixed the real issue.
Sorry for the noise.

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

9 years agoTry to fix -Asserts build bots.
Rafael Espindola [Thu, 22 Jan 2015 01:26:39 +0000 (01:26 +0000)]
Try to fix -Asserts build bots.

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

9 years agoGive the block inlining test a triple to determinise output
Reid Kleckner [Thu, 22 Jan 2015 01:19:19 +0000 (01:19 +0000)]
Give the block inlining test a triple to determinise output

It fails on Windows due to another temporary being emitted first, so the
LLVM internal renaming scheme gives out the name
__block_descriptor_tmp1.

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

9 years agoRemove an out-of-date and incorrect comment.
Richard Smith [Thu, 22 Jan 2015 01:15:51 +0000 (01:15 +0000)]
Remove an out-of-date and incorrect comment.

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

9 years agoFix compiler_builtins.m test to not rely on including system stdlib.h and malloc.h
Hans Wennborg [Thu, 22 Jan 2015 00:45:20 +0000 (00:45 +0000)]
Fix compiler_builtins.m test to not rely on including system stdlib.h and malloc.h

Importing _Builtin_intrinsics.sse and avx would transitively pull in those
headers, and the test would fail when building in an environment where
they were not available on the include path.

This fixes PR20995 for me.

Differential Revision: http://reviews.llvm.org/D7112

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

9 years agoEmit DeferredDeclsToEmit in a DFS order.
Rafael Espindola [Thu, 22 Jan 2015 00:24:57 +0000 (00:24 +0000)]
Emit DeferredDeclsToEmit in a DFS order.

Currently we emit DeferredDeclsToEmit in reverse order. This patch changes that.

The advantages of the change are that

* The output order is a bit closer to the source order. The change to
test/CodeGenCXX/pod-member-memcpys.cpp is a good example.

* If we decide to deffer more, it will not cause as large changes in the
estcases as it would without this patch.

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

9 years agoUse CHECK-LABEL when possible. NFC.
Rafael Espindola [Wed, 21 Jan 2015 23:33:55 +0000 (23:33 +0000)]
Use CHECK-LABEL when possible. NFC.

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

9 years agoAdopt new cl::HideUnrelatedOptions API added r226729.
Chris Bieneman [Wed, 21 Jan 2015 23:26:11 +0000 (23:26 +0000)]
Adopt new cl::HideUnrelatedOptions API added r226729.

Summary: cl::HideUnrelatedOptions allows tools to hide all options not part of a specific OptionCategory. This is the common use case for cl::getRegisteredOptions, which should be deprecated in the future because it exposes implementation details of command line parsing.

Reviewers: dexonsmith

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D7109

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

9 years agoDebugInfo: Remove forced column-info workaround for inlined calls
David Blaikie [Wed, 21 Jan 2015 23:08:17 +0000 (23:08 +0000)]
DebugInfo: Remove forced column-info workaround for inlined calls

This workaround was to provide unique call sites to ensure LLVM's inline
debug info handling would properly unique two calls to the same function
on the same line. Instead, this has now been fixed in LLVM (r226736) and
the workaround here can be removed.

Originally committed in r176895, but this isn't a straight revert due to
all the changes since then. I just searched for anything ForcedColumn*
related and removed them.

We could test this - but it didn't strike me as terribly valuable once
we're no longer adding this workaround everything just works as expected
& it's no longer a special case to test for.

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

9 years agoDebugInfo: Remove distinct-call-inlining test case as this is being fixed in LLVM.
David Blaikie [Wed, 21 Jan 2015 22:57:22 +0000 (22:57 +0000)]
DebugInfo: Remove distinct-call-inlining test case as this is being fixed in LLVM.

This test will start failing shortly once this bug is fixed in LLVM. At
that point this behavior is no longer required in Clang and will be
removed. In the interim, remove this test just to avoid the race between
the LLVM and Clang commits.

After the LLVM commit, I'll cleanup the workaround behavior in Clang.

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

9 years agoUse a CHECK-LABEL. NFC
Rafael Espindola [Wed, 21 Jan 2015 22:38:24 +0000 (22:38 +0000)]
Use a CHECK-LABEL. NFC

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

9 years agoAdd the "thunk" attribute to MS ABI virtual member pointers
Reid Kleckner [Wed, 21 Jan 2015 22:18:17 +0000 (22:18 +0000)]
Add the "thunk" attribute to MS ABI virtual member pointers

This attribute implies indicates that the function musttail calls
another function and returns whatever it returns. The return type of the
thunk is meaningless, as the thunk can dynamically call different
functions with different return types. So long as the callers bitcast
the thunk with the correct type, behavior is well defined.

This attribute was necessary to fix PR20944, where the indirect call
combiner noticed that the thunk returned void and replaced the results
of the indirect call instruction with undef.

Over-the-shoulder reviewed by David Majnemer.

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

9 years agoAdd back a FIXME note to lit.cfg.
Francisco Lopes da Silva [Wed, 21 Jan 2015 21:38:05 +0000 (21:38 +0000)]
Add back a FIXME note to lit.cfg.

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

9 years agoclang-format: Fix crasher when splitting incomplete escape sequences.
Daniel Jasper [Wed, 21 Jan 2015 19:50:35 +0000 (19:50 +0000)]
clang-format: Fix crasher when splitting incomplete escape sequences.

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

9 years agoFix isTriviallyCopyableType for arrays
Saleem Abdulrasool [Wed, 21 Jan 2015 19:39:10 +0000 (19:39 +0000)]
Fix isTriviallyCopyableType for arrays

Fix isTriviallyCopyableType for arrays. An array of type T is trivially copyable
if T is trivially copyable.

Patch by Agustín Bergé!

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

9 years agoclang-format: Fix crasher caused by incorrect resetting of token info.
Daniel Jasper [Wed, 21 Jan 2015 18:35:47 +0000 (18:35 +0000)]
clang-format: Fix crasher caused by incorrect resetting of token info.

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

9 years agoclang-format: Fix bad memory access.
Daniel Jasper [Wed, 21 Jan 2015 18:04:02 +0000 (18:04 +0000)]
clang-format: Fix bad memory access.

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

9 years agoclang-format: Fix use-heap-after-free bug.
Daniel Jasper [Wed, 21 Jan 2015 17:35:29 +0000 (17:35 +0000)]
clang-format: Fix use-heap-after-free bug.

Discovered by the awesome test case and ASAN.

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

9 years agoUsed CHECK-DAG since the order is not important.
Rafael Espindola [Wed, 21 Jan 2015 17:12:04 +0000 (17:12 +0000)]
Used CHECK-DAG since the order is not important.

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

9 years agoUsed CHECK-DAG since the order is not important.
Rafael Espindola [Wed, 21 Jan 2015 16:56:43 +0000 (16:56 +0000)]
Used CHECK-DAG since the order is not important.

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

9 years agoInitial support for C++ parameter completion
Francisco Lopes da Silva [Wed, 21 Jan 2015 16:24:11 +0000 (16:24 +0000)]
Initial support for C++ parameter completion

The improved completion in call context now works with:

 - Functions.
 - Member functions.
 - Constructors.
 - New expressions.
 - Function call expressions.
 - Template variants of the previous.

There are still rough edges to be fixed:

 - Provide support for optional parameters.         (fix known)
 - Provide support for member initializers.         (fix known)
 - Provide support for variadic template functions. (fix unknown)
 - Others?

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

9 years agoDon't assume variable name.
Rafael Espindola [Wed, 21 Jan 2015 16:18:42 +0000 (16:18 +0000)]
Don't assume variable name.

Should fix the test in -Asserts builds.

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

9 years agoMake the test a bit stricter. NFC.
Rafael Espindola [Wed, 21 Jan 2015 16:13:57 +0000 (16:13 +0000)]
Make the test a bit stricter. NFC.

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

9 years agoMake the test a bit stricter. NFC.
Rafael Espindola [Wed, 21 Jan 2015 16:03:26 +0000 (16:03 +0000)]
Make the test a bit stricter. NFC.

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

9 years agoclang-format function. NFC.
Rafael Espindola [Wed, 21 Jan 2015 14:55:00 +0000 (14:55 +0000)]
clang-format function. NFC.

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

9 years agoAST: Don't ignore alignas on EnumDecls when calculating alignment
David Majnemer [Wed, 21 Jan 2015 10:54:38 +0000 (10:54 +0000)]
AST: Don't ignore alignas on EnumDecls when calculating alignment

We didn't consider any alignment attributes on an EnumDecl when
calculating alignment.

While we are here, ignore alignment specifications on typedef types if
one is used as the underlying type.  Otherwise, weird things happen:

enum Y : int;
Y y;

typedef int __attribute__((aligned(64))) u;
enum Y : u {};

What is the alignment of 'Y'?  It would be more consistent with the
overall design of enums with fixed underlying types to consider the
underlying type's UnqualifiedDesugaredType.

This fixes PR22279.

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

9 years agoRevert "Sema: err_after_alias is unreachable, remove it"
David Majnemer [Wed, 21 Jan 2015 01:30:40 +0000 (01:30 +0000)]
Revert "Sema: err_after_alias is unreachable, remove it"

This reverts commit r226626.  err_after_alias is, in fact, reachable.

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

9 years agoMS ABI: Virtual member pointer thunks should be in COMDAT groups
David Majnemer [Wed, 21 Jan 2015 01:21:31 +0000 (01:21 +0000)]
MS ABI: Virtual member pointer thunks should be in COMDAT groups

They can be emitted by multiple translation units and thus belong in a
COMDAT group.

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

9 years agoMS ABI: Let guard variables be present in COMDATs
David Majnemer [Wed, 21 Jan 2015 01:04:30 +0000 (01:04 +0000)]
MS ABI: Let guard variables be present in COMDATs

A guard variable in a COMDAT'd function should also be in a COMDAT.

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

9 years agoCodeGen: Compiler generated __declspec(uuid) objects should be COMDAT'd
David Majnemer [Wed, 21 Jan 2015 01:04:28 +0000 (01:04 +0000)]
CodeGen: Compiler generated __declspec(uuid) objects should be COMDAT'd

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

9 years agoSema: err_after_alias is unreachable, remove it
David Majnemer [Wed, 21 Jan 2015 00:52:17 +0000 (00:52 +0000)]
Sema: err_after_alias is unreachable, remove it

Examples this would have catched are now handled by the attribute
verification code.

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

9 years agoCorrect all typos in the initialization arguments, even if one could not
Kaelyn Takata [Wed, 21 Jan 2015 00:04:19 +0000 (00:04 +0000)]
Correct all typos in the initialization arguments, even if one could not
be corrected.

This fixes PR22250, which exposed the bug where if there's more than one
TypoExpr in the arguments, once one failed to be corrected none of the
TypoExprs after it would be handled at all thanks to an early return.

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

9 years agoLink libclang with dl if available.
Rafael Espindola [Tue, 20 Jan 2015 21:10:35 +0000 (21:10 +0000)]
Link libclang with dl if available.

This is in preparation for changing the link to use -Wl,-z,defs.

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

9 years agoFix crashes on missing @interface for category
Ben Langmuir [Tue, 20 Jan 2015 20:41:36 +0000 (20:41 +0000)]
Fix crashes on missing @interface for category

In a few places we didn't check that Category->getClassInterface() was
not null before using it.

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

9 years agoAdd the test that was supposed to be included with r223162.
Kaelyn Takata [Tue, 20 Jan 2015 20:15:29 +0000 (20:15 +0000)]
Add the test that was supposed to be included with r223162.

The test case is based on the reduction from PR21679 and has to be
freestanding to work correctly, since some of the expected errors (and
some of the problems that were fixed) only occur when the end of the
file is reached.

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

9 years agoImplement command line options for stack probe space
Hans Wennborg [Tue, 20 Jan 2015 19:45:50 +0000 (19:45 +0000)]
Implement command line options for stack probe space

This code adds the -mstack-probe-size command line option and implements the /Gs
compiler switch for clang-cl.

This should fix http://llvm.org/bugs/show_bug.cgi?id=21896

Patch by Andrew H!

Differential Revision: http://reviews.llvm.org/D6685

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

9 years agoPatch fixes PR21932 crash on invalid code. Using
Fariborz Jahanian [Tue, 20 Jan 2015 16:53:34 +0000 (16:53 +0000)]
Patch fixes PR21932 crash on invalid code. Using
property-dot syntax on 'super' with no super
class. Patch by Jason Haslam.

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

9 years agoclang-format: Fix AlwaysBreakBeforeMultilineStrings with ColumnLimit=0
Daniel Jasper [Tue, 20 Jan 2015 12:59:20 +0000 (12:59 +0000)]
clang-format: Fix AlwaysBreakBeforeMultilineStrings with ColumnLimit=0

Before:
  const char *x =
      "hello llvm";

After:
  const char *x = "hello llvm";

This fixes llvm.org/PR22245.
Patch by Bill Meltsner, thank you!

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

9 years agoRe-apply "r226548 - Introduce SPIR calling conventions" reverted in r226558.
Alexander Kornienko [Tue, 20 Jan 2015 11:20:41 +0000 (11:20 +0000)]
Re-apply "r226548 - Introduce SPIR calling conventions" reverted in r226558.

The test was fixed after a discussion with the revision author: the check
pattern was made more flexible as the "%call" part is not what we actually want
to check strictly there.

The original patch description:
===
Introduce SPIR calling conventions.

This implements Section 3.7 from the SPIR 1.2 spec:

    SPIR kernels should use "spir_kernel" calling convention.
    Non-kernel functions use "spir_func" calling convention. All
    other calling conventions are disallowed.

The patch works only for OpenCL source. Any other uses will need
to ensure that kernels are assigned the spir_kernel calling
convention correctly.
===

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

9 years agoReverting r226548 as one of the tests fails in some configurations.
Alexander Kornienko [Tue, 20 Jan 2015 10:55:33 +0000 (10:55 +0000)]
Reverting r226548 as one of the tests fails in some configurations.

Here's the fail log from our internal setup:
===
  .../tools/clang/clang -cc1 -internal-isystem .../tools/clang/staging/include -nostdsysteminc .../tools/clang/test/CodeGenOpenCL/spir-calling-conv.cl -triple spir-unknown-unknown -emit-llvm -o -
  FileCheck .../tools/clang/test/CodeGenOpenCL/spir-calling-conv.cl
.../tools/clang/test/CodeGenOpenCL/spir-calling-conv.cl:11:12: error: expected string not found in input
 // CHECK: %call = tail call spir_func i32 @get_dummy_id(i32 0)
           ^
<stdin>:6:52: note: scanning from here
define spir_kernel void @foo(i32 addrspace(1)* %A) #0 {
                                                   ^
<stdin>:7:2: note: possible intended match here
 %1 = tail call spir_func i32 @get_dummy_id(i32 0) #2
 ^
===

Here's a failure on a public CI server:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/1183/

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

9 years agoTest commit, no changes.
Pavel Labath [Tue, 20 Jan 2015 09:47:57 +0000 (09:47 +0000)]
Test commit, no changes.

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

9 years ago[OPENMP] Fixed DSA processing for predetermined shared variables.
Alexey Bataev [Tue, 20 Jan 2015 07:03:46 +0000 (07:03 +0000)]
[OPENMP] Fixed DSA processing for predetermined shared variables.
This patch allows to use predetermined shared variables in private clauses in
parallel or tasks regions.

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

9 years agoIntroduce SPIR calling conventions.
Sameer Sahasrabuddhe [Tue, 20 Jan 2015 06:44:32 +0000 (06:44 +0000)]
Introduce SPIR calling conventions.

This implements Section 3.7 from the SPIR 1.2 spec:

    SPIR kernels should use "spir_kernel" calling convention.
    Non-kernel functions use "spir_func" calling convention. All
    other calling conventions are disallowed.

The patch works only for OpenCL source. Any other uses will need
to ensure that kernels are assigned the spir_kernel calling
convention correctly.

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

9 years agoCodeGen: Update LoopAttributes for LLVM API change
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 21:30:48 +0000 (21:30 +0000)]
CodeGen: Update LoopAttributes for LLVM API change

`MDNode::getTemporary()` returns a `unique_ptr<>` as of r226504.

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

9 years ago[AVX512] Add sub-vector FP extracts
Adam Nemet [Mon, 19 Jan 2015 20:12:05 +0000 (20:12 +0000)]
[AVX512] Add sub-vector FP extracts

Analogous to AVX2, these need to be implemented as macros to properly
propagate the immediate index operand.

Part of <rdar://problem/17688758>

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

9 years agoMigrate all uses of DIVariable's FlagIndirectVariable to use a DIExpression
Adrian Prantl [Mon, 19 Jan 2015 17:51:58 +0000 (17:51 +0000)]
Migrate all uses of DIVariable's FlagIndirectVariable to use a DIExpression
with a DW_OP_deref instead.

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

9 years agoAdd comdat to thunks.
Rafael Espindola [Mon, 19 Jan 2015 14:02:14 +0000 (14:02 +0000)]
Add comdat to thunks.

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

9 years agoMake this test a bit stricter. NFC.
Rafael Espindola [Mon, 19 Jan 2015 13:59:31 +0000 (13:59 +0000)]
Make this test a bit stricter. NFC.

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

9 years agoclang-format: Fix crasher on weird comments.
Daniel Jasper [Mon, 19 Jan 2015 11:49:32 +0000 (11:49 +0000)]
clang-format: Fix crasher on weird comments.

Crashing input:
  /\
  / comment

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

9 years agoclang-format: Fix crasher on incomplete condition compilation.
Daniel Jasper [Mon, 19 Jan 2015 10:52:16 +0000 (10:52 +0000)]
clang-format: Fix crasher on incomplete condition compilation.

Previously crashing input:
  void f(
  #if A
      );
  #else
  #endif

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

9 years agoclang-format: Fix crash on invalid code.
Daniel Jasper [Mon, 19 Jan 2015 10:51:42 +0000 (10:51 +0000)]
clang-format: Fix crash on invalid code.

Input "a<," made clang-format crash.

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

9 years agoclang-format: Fix clang-format crash on invalid code.
Daniel Jasper [Mon, 19 Jan 2015 10:51:23 +0000 (10:51 +0000)]
clang-format: Fix clang-format crash on invalid code.

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

9 years agoclang-format: Fix assertion when trying to build a nullptr StringRef.
Daniel Jasper [Mon, 19 Jan 2015 10:51:05 +0000 (10:51 +0000)]
clang-format: Fix assertion when trying to build a nullptr StringRef.

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

9 years agoclang-format: Fix endless loop on incomplete try-catch-block.
Daniel Jasper [Mon, 19 Jan 2015 10:50:51 +0000 (10:50 +0000)]
clang-format: Fix endless loop on incomplete try-catch-block.

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

9 years agoclang-format: Remove assert that isn't helpful.
Daniel Jasper [Mon, 19 Jan 2015 10:50:08 +0000 (10:50 +0000)]
clang-format: Remove assert that isn't helpful.

This assert would trigger on:
  #d , = }

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

9 years agoMake clang-format work in emacs buffers with unicode characters.
Manuel Klimek [Mon, 19 Jan 2015 10:48:04 +0000 (10:48 +0000)]
Make clang-format work in emacs buffers with unicode characters.

Emacs functions by default use character positions; convert characters
to offsets when handing parameters to clang-format and convert byte
offsets we get from clang-format back to character positions.
Reworked the code a bit so the 0-based to 1-based offset calculations
are done in the same place where we do the multi-byte to offset mapping.

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

9 years agoAdd back a check removed in r226436
David Majnemer [Mon, 19 Jan 2015 10:21:22 +0000 (10:21 +0000)]
Add back a check removed in r226436

It shouldn't have been removed, the code which replaced it didn't cover
this case.

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

9 years agoSemaDeclCXX.cpp: Suppress a warning. [-Wunused-variable]
NAKAMURA Takumi [Mon, 19 Jan 2015 09:49:59 +0000 (09:49 +0000)]
SemaDeclCXX.cpp: Suppress a warning. [-Wunused-variable]

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

9 years agoSema: Variable definitions cannot be __attribute__((alias))
David Majnemer [Mon, 19 Jan 2015 09:00:28 +0000 (09:00 +0000)]
Sema: Variable definitions cannot be __attribute__((alias))

Things that are OK:
  extern int var1 __attribute((alias("v1")));
  static int var2 __attribute((alias("v2")));

Things that are not OK:
  int var3 __attribute((alias("v3")));
  extern int var4 __attribute((alias("v4"))) = 4;

We choose to accpet:
  struct S { static int var5 __attribute((alias("v5"))); };

  This code causes assertion failues in GCC 4.8 and ICC 13.0.1, we have
  no reason to reject it.

This partially fixes PR22217.

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

9 years ago[X86] Change AVX512 intrinsics to take a 8-bit immediate for the comparision kind...
Craig Topper [Mon, 19 Jan 2015 06:08:02 +0000 (06:08 +0000)]
[X86] Change AVX512 intrinsics to take a 8-bit immediate for the comparision kind instead of a 32-bit immediate. This matches an equivalent change in llvm.

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

9 years ago[OPENMP] Disable copyprivate an nowait clauses in 'single' directive.
Alexey Bataev [Mon, 19 Jan 2015 05:20:46 +0000 (05:20 +0000)]
[OPENMP] Disable copyprivate an nowait clauses in 'single' directive.
The copyprivate clause must not be used with the nowait clause in single
directive.

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

9 years agoPR6037
Nathan Sidwell [Mon, 19 Jan 2015 01:44:02 +0000 (01:44 +0000)]
PR6037
Warn on inaccessible direct base

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

9 years ago[x86] Teach Sema to check size of comparison immediate on avx512 cmpps/cmppd buitins.
Craig Topper [Mon, 19 Jan 2015 01:18:22 +0000 (01:18 +0000)]
[x86] Teach Sema to check size of comparison immediate on avx512 cmpps/cmppd buitins.

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

9 years ago[x86] Mark that the AVX-512 cmpps/cmppd builtins need an ICE for the comparison immed...
Craig Topper [Mon, 19 Jan 2015 01:18:19 +0000 (01:18 +0000)]
[x86] Mark that the AVX-512 cmpps/cmppd builtins need an ICE for the comparison immediate. This requires converting to a macro in the header file.

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

9 years agoHandle unscoped enumeration in nested name specifier.
Serge Pavlov [Sun, 18 Jan 2015 20:04:35 +0000 (20:04 +0000)]
Handle unscoped enumeration in nested name specifier.

If an unscoped enum is used as a nested name specifier and the language dialect
is not C++ 11, issue an extension warning.
This fixes PR16951.

Differential Revision: http://reviews.llvm.org/D6389

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

9 years agoUpdate error message text.
Serge Pavlov [Sun, 18 Jan 2015 19:05:48 +0000 (19:05 +0000)]
Update error message text.

Previously if an enumeration was used in a nested name specifier in pre-C++11
language dialect, error message was 'XXX is not a class, namespace, or scoped
enumeration'. This patch removes the word 'scoped' as in C++11 any enumeration
may be used in this context.

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

9 years agoAdd comment after API changes in r225090
David Blaikie [Sun, 18 Jan 2015 02:48:07 +0000 (02:48 +0000)]
Add comment after API changes in r225090

Code review suggestion by Eric Christopher.

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

9 years agoDebugInfo: Attribute complex expressions to the source location of the expression
David Blaikie [Sun, 18 Jan 2015 01:57:54 +0000 (01:57 +0000)]
DebugInfo: Attribute complex expressions to the source location of the expression

Just as r225956 did for scalar expressions (CGExprScalar::Visit), do the
same for complex expressions.

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

9 years agoAddress review feedback from r215780: Use a flag insteda of the heap. No behavior...
Nico Weber [Sun, 18 Jan 2015 01:50:35 +0000 (01:50 +0000)]
Address review feedback from r215780: Use a flag insteda of the heap. No behavior change.

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

9 years agoDebugInfo: Attribute aggregate expressions to the source location of the expression
David Blaikie [Sun, 18 Jan 2015 01:48:19 +0000 (01:48 +0000)]
DebugInfo: Attribute aggregate expressions to the source location of the expression

Just as r225956 did for scalar expressions (CGExprScalar::Visit), do the
same for aggregate expressions.

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

9 years agoRefactor test so it's not lazily emitted on a global, simplifying ordering when more...
David Blaikie [Sun, 18 Jan 2015 00:37:04 +0000 (00:37 +0000)]
Refactor test so it's not lazily emitted on a global, simplifying ordering when more test cases are added

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

9 years agoRecommit r225083 (reverted in r225361) now that calls to aggregate initializers from...
David Blaikie [Sun, 18 Jan 2015 00:14:21 +0000 (00:14 +0000)]
Recommit r225083 (reverted in r225361) now that calls to aggregate initializers from in class non-static data members are explicitly attributed to the desired line.

The code setting the debug location being removed here was accidentally
leaking a location into the call to the non-static data member's ctor
call. Without it the call had no location and could cause assertion
failures if it was inlined. Now that it has a location (and a correct
one at that) this code should hopefully be no longer needed.

It's possible of course that other parts of the debug info are also
relying on the debug locations being set here to leak to where they're
needed - so we might see the same assertions again & will have to
investigate what the dependence was/is. But the chances are good that
any of those are debug info line table quality bugs we've just not found
yet anyway - so it'll be good to flush them out.

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

9 years agoDebugInfo: Correct the debug location of non-static data member initializers
David Blaikie [Sun, 18 Jan 2015 00:12:58 +0000 (00:12 +0000)]
DebugInfo: Correct the debug location of non-static data member initializers

This was causing some trouble for otherwise dead code removed in r225085
(reverted in r225361). The location being set for function arguments was
leaking out to the call which wasn't setting its own location (so a
quality bug turned into a crasher with r225085). Fix this so r225085 can
be recommitted.

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

9 years ago[msan] Fix a uninitialized-use bug in the template argument diffing
Chandler Carruth [Sat, 17 Jan 2015 14:20:14 +0000 (14:20 +0000)]
[msan] Fix a uninitialized-use bug in the template argument diffing
logic.

In one place we would try to check for the difference between integers
even if we were missing one of the integers. This would eventually end
up reading uninitialized data out of the APSInt objects. The fix is to
short circuit the sameness test when we don't have integers on both
sides.

This fixes a test failure I was seeing with MSan. Not sure whether other
bots were seeing it or not, but yay MSan. In particular the feature to
very carefully track origins back through stores throughout the program
was invaluable.

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

9 years agoAdd tests for two more asserts that r226365 fixed according to SLi's bot.
Nico Weber [Sat, 17 Jan 2015 04:27:09 +0000 (04:27 +0000)]
Add tests for two more asserts that r226365 fixed according to SLi's bot.

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

9 years agoAdd a test for something that used to crash before r226365.
Nico Weber [Sat, 17 Jan 2015 04:14:31 +0000 (04:14 +0000)]
Add a test for something that used to crash before r226365.

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

9 years agoIf a function decl cannot be merged, mark it as invalid.
Nico Weber [Sat, 17 Jan 2015 02:33:17 +0000 (02:33 +0000)]
If a function decl cannot be merged, mark it as invalid.

Clang currently crashes on

    class C {
      C() = default;
      C() = delete;
    };

My cunning plan for fixing this was to change the `if (!FnD)` in
Parser::ParseCXXInlineMethodDef() to `if (!FnD || FnD->isInvalidDecl)` – but
alas, the second constructor decl wasn't marked as invalid.  This lets
Sema::MergeFunctionDecl() return true on function redeclarations, which leads
to them being marked invalid.

This also improves error messages when functions are redeclared.

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