We would produce a alias, creating a comdat with D0 and D1, since the symbols
have to be weak. Another TU is not required to have a explicit template
instantiation definition or an explict template instantiation declaration and
for
ObjectiveC. availability of Array/Dictionary subscripting
is further restricted in legacy runtime to deployment target
of 10.7 and later. // rdar://15363492
Daniel Sanders [Tue, 12 Nov 2013 12:56:01 +0000 (12:56 +0000)]
[mips][msa] Enable inlinse assembly for MSA.
Like GCC, this re-uses the 'f' constraint and a new 'w' print-modifier:
asm ("ldi.w %w0, 1", "=f"(result));
Unlike GCC, the 'w' print-modifer is not _required_ to produce the intended
output. This is a consequence of differences in the internal handling of
the registers in each compiler. To be source-compatible between the
compilers, users must use the 'w' print-modifier.
MSA registers (including control registers) are supported in clobber lists.
Rafael Espindola [Tue, 12 Nov 2013 04:53:19 +0000 (04:53 +0000)]
Keep the old function order in CodeGenModule::applyReplacements.
The original decls are created when used. The replacements are created at the
end of the TU in reverse order.
This makes the original order far better for testing. This is particularly
important since the replacement logic could be used even when
-mconstructor-aliases is not used, but that would make many tests hard to read.
This is a fixed version of r194357 which handles replacing a destructor with
another which is an alias to a third one.
Faisal Vali [Tue, 12 Nov 2013 03:48:27 +0000 (03:48 +0000)]
A quick fix to PR17877 that was introduced by r194188 (generic-lambda-capturing) that broke libc++.
See http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-November/033369.html for discussion on cfe-dev.
This fix explicitly checks whether we are within the declcontext of a lambda's call operator - which is what I had intended to be true (and assumed would be true if getCurLambda returns a valid pointer) before checking whether a lambda can capture the potential-captures of the innermost lambda.
A deeper fix (that addresses why getCurLambda() returns a valid pointer when perhaps it shouldn't?) - as proposed by Richard Smith in http://llvm.org/bugs/show_bug.cgi?id=17877 - has been suggested as a FIXME.
Richard Smith [Tue, 12 Nov 2013 02:41:45 +0000 (02:41 +0000)]
Rather than duplicating extension diagnostics to allow them to cause a
substitution failure, allow a flag to be set on the Diagnostic object,
to mark it as 'causes substitution failure'.
Refactor Diagnostic.td and the tablegen to use an enum for SFINAE behavior
rather than a bunch of flags.
Faisal Vali [Tue, 12 Nov 2013 01:40:44 +0000 (01:40 +0000)]
REFACTOR: Have PushLambdaScope return the LambdaScopeInfo that it creates.
No Functionality change.
This refactoring avoids having to call getCurLambda right after PushLambdaScope, to obtain the LambdaScopeInfo that was created during the call to PushLambdaScope.
Rafael Espindola [Mon, 11 Nov 2013 19:35:06 +0000 (19:35 +0000)]
Fix pr17875.
The assert this patch deletes was valid only when aliasing D2 to D1, not when
looking at a base class. Since the assert was in the path where we had already
decided to not produce an alias, just drop it.
Rafael Espindola [Sun, 10 Nov 2013 19:04:30 +0000 (19:04 +0000)]
Keep the old function order in CodeGenModule::applyReplacements.
The original decls are created when used. The replacements are created at the
end of the TU in reverse order.
This makes the original order far better for testing. This is particularly
important since the replacement logic could be used even when
-mconstructor-aliases is not used, but that would make many tests hard to read.
clang-cl adds these, so this makes the tests a bit more realistic. These are the
tests where it would make a difference if the windows specific handling were
removed.
Richard Smith [Sat, 9 Nov 2013 04:52:51 +0000 (04:52 +0000)]
Try to recover a bit better if a close brace is missing from the end of a class
definition. If we see something that looks like a namespace definition inside a
class, that strongly indicates that a close brace was missing somewhere.
Don't emit an internal destructor that is identical to an external one.
It is not safe to emit alias to undefined (not supported by ELF or COFF), but
it is safe to rauw when the alias would have been internal or linkonce_odr.
Hans Wennborg [Fri, 8 Nov 2013 23:52:29 +0000 (23:52 +0000)]
Update macro expansion diagnostic examples to say 'expanded from:'
instead of 'instantiated from:'. The actual wording of the note was
changed in r135135.
Nick Lewycky [Fri, 8 Nov 2013 23:00:12 +0000 (23:00 +0000)]
Remove an incorrect optimization inside Clang's IRGen. Its check to determine
whether we can safely lower a conditional operator to select was insufficient.
I've left a large comment in place to explaining the sort of problems that this
transform can encounter in clang in the hopes of discouraging others from
reimplementing it wrongly again in the future. (The test should also help with
that, but it's easy to work around any single test I might add and think that
your particular implementation doesn't miscompile any code.)
Reid Kleckner [Fri, 8 Nov 2013 21:28:00 +0000 (21:28 +0000)]
Make -fdump-vtable-layouts print to stdout, not stderr
This makes it consistent with -fdump-record-layouts, which was moved to
outs() in r186219. My reasoning for going with stdout is that when one
of these options is present, the layouts are really a program output,
and shouldn't be interleaved with diagnostics, which are on stderr.
Daniel Jasper [Fri, 8 Nov 2013 19:56:28 +0000 (19:56 +0000)]
clang-format: Improve formatting of operators forced to new lines.
Before:
unsigned ContentSize =
sizeof(int16_t) // DWARF ARange version number
+
sizeof(int32_t) // Offset of CU in the .debug_info section
+
sizeof(int8_t) // Pointer Size (in bytes)
+
sizeof(int8_t); // Segment Size (in bytes)
After:
unsigned ContentSize =
sizeof(int16_t) // DWARF ARange version number
+ sizeof(int32_t) // Offset of CU in the .debug_info section
+ sizeof(int8_t) // Pointer Size (in bytes)
+ sizeof(int8_t); // Segment Size (in bytes)
Alp Toker [Fri, 8 Nov 2013 08:07:19 +0000 (08:07 +0000)]
clang-format: Write files atomically
Switch clang-format over to Rewriter::overwriteChangedFiles().
The previous implementation was attempting to stream back directly to the
original file and failing if it was already memory mapped by MemoryBuffer,
an operation unsupported by Windows.
MemoryBuffer generally mmaps files larger than the physical page size so
this will have been difficult to reproduce consistently.
This change also reduces flicker in code editors and IDEs on all platforms
when reformatting in-place.
Note that other incorrect uses of MemoryBuffer exist in LLVM/clang and
will need a similar fix.
A test should be added for Windows when libFormat performance issues are
fixed (it takes longer than a day to format a 1MB file at present!)
Daniel Jasper [Fri, 8 Nov 2013 06:45:35 +0000 (06:45 +0000)]
Add .clang-format without column limit to subdirectory tests/.
A column limit in the test folder can lead to trouble as the RUN, CHECK,
etc. comments can potentially be broken over multiple lines changing
their meaning. Without column limit, clang-format will simply keep the
test author's line breaks.
NAKAMURA Takumi [Fri, 8 Nov 2013 05:16:50 +0000 (05:16 +0000)]
clang/test/CXX/drs/dr1xx.cpp: Add explicit triple x86_64-unknown-unknown to satisfy check7a and check8a since r194240.
For i686 targets and LLP64 targets, we can see;
error: 'error' diagnostics seen but not expected:
File clang/test/CXX/drs/dr1xx.cpp Line 761: 'check7a' declared as an array with a negative size
File clang/test/CXX/drs/dr1xx.cpp Line 765: 'check8a' declared as an array with a negative size
2 errors generated.
NAKAMURA Takumi [Fri, 8 Nov 2013 04:00:53 +0000 (04:00 +0000)]
StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp: Tweak ContainerNonEmptyMap with "int" instead of "bool", to appease building since r194235.
In ADT/ImmutableSet, ImutProfileInfo<bool> cannot be matched to ImutProfileInteger.
I didn't have idea it'd the right way if PROFILE_INTEGER_INFO(bool) could be added there.
Douglas Gregor [Fri, 8 Nov 2013 02:04:24 +0000 (02:04 +0000)]
Objective-C++ ARC: Improve the conversion to a const __unsafe_unretained reference.
Under ARC++, a reference to a const Objective-C pointer is implicitly
treated as __unsafe_unretained, and can be initialized with (e.g.) a
__strong lvalue. Make sure this behavior does not break template
argument deduction and (related) that partial ordering still prefers a
'T* const&' template over a 'T const&' template when this case kicks
in. Fixes <rdar://problem/14467941>.