John McCall [Fri, 8 Oct 2010 02:01:28 +0000 (02:01 +0000)]
Track the location of the context requiring an implicit conversion and use it
to white-list conversions required by system headers. rdar://problem/8232669
Fix an infinite loop, caused by unintended syntax bug (the 'break;' after 'default:' was intended to break out of the while loop).
Fixes rdar://8518859&8520617.
Start and end location of a property-dot syntax expression
must match start and end location of the expression
as expected by the rewriter client. Fixes // rdar: // 8520727
Daniel Dunbar [Thu, 7 Oct 2010 15:00:30 +0000 (15:00 +0000)]
Driver: When clang is built with a VENDOR set, include the base LLVM version in
the version information, to help prevent user confusion about vendor version
numbers vs. LLVM version numbers.
Tom Care [Wed, 6 Oct 2010 23:02:25 +0000 (23:02 +0000)]
UnreachableCodeChecker cleanup and improvements
- Fixed some iterator style issues
- Don't process blocks that have been visited already
- Fixed a case where a unreachable block cycle was not reported
- Minor test case changes
- Added one test case from flow-sensitive version of the check. More coming.
Douglas Gregor [Wed, 6 Oct 2010 16:00:31 +0000 (16:00 +0000)]
Reject the allocation of variably-modified types in C++ 'new'
expressions. Fixes PR8209 in the narrowest way possible. I'm still
considering whether I want to implement the extension that permits the
use of VLA types in a 'new' expression.
Remove hard CRLF end-of-line markers from two files. These should be added
automatically when syncing due to the auto-props selecting svn:eol-style of
'native'.
John McCall [Wed, 6 Oct 2010 01:40:51 +0000 (01:40 +0000)]
Teach the driver to pass -fexceptions in Objective-C inputs on ARM.
I don't know when this stopped happening, but this seems to be the
right place to do it.
John McCall [Tue, 5 Oct 2010 22:36:42 +0000 (22:36 +0000)]
When instantiating a new-expression, force a rebuild if there were default
arguments in either the placement or constructor arguments. This is
important if the default arguments refer to a declaration or create a
temporary.
Method declaration and its implementation must match in all their types.
Previously, compiler warned only if it was unsafe if types
did not match. Fixes // rdar: //7933061
John McCall [Tue, 5 Oct 2010 20:48:15 +0000 (20:48 +0000)]
Teach PopCleanupBlock to correctly handle the possibility of branching through
a EH-only cleanup as part of a fallthrough branch-through. That this happens
for this test case is actually a separate bug.
Douglas Gregor [Tue, 5 Oct 2010 18:37:06 +0000 (18:37 +0000)]
Fix a marvelous chained AST writing bug, where we end up with the
following amusing sequence:
- AST writing schedules writing a type X* that it had never seen
before
- AST writing starts writing another declaration, ends up
deserializing X* from a prior AST file. Now we have two type IDs for
the same type!
- AST writer tries to write X*. It only has the lower-numbered ID
from the the prior AST file, so references to the higher-numbered ID
that was scheduled for writing go off into lalaland.
To fix this, keep the higher-numbered ID so we end up writing the type
twice. Since this issue occurs so rarely, and type records are
generally rather small, I deemed this better than the alternative: to
keep a separate mapping from the higher-numbered IDs to the
lower-numbered IDs, which we would end up having to check whenever we
want to deserialize any type.
Fix a block rewriter bug where copy/dispose entries in
block descriptor for outer block was missing even though
the block was importing objects into its inner blocks.
//rdar://84995992
Douglas Gregor [Tue, 5 Oct 2010 15:41:24 +0000 (15:41 +0000)]
Register the __builtin_va_list_type node when we parse it, rather than
waiting until we think we need it: we didn't catch all of the places
where we actually needed it, and we probably wouldn't ever. Fixes a
C++ PCH crasher.
Douglas Gregor [Tue, 5 Oct 2010 14:55:45 +0000 (14:55 +0000)]
Register the __builtin_va_list_type node when we parse it, rather than
waiting until we think we need it: we didn't catch all of the places
where we actually needed it, and we probably wouldn't ever. Fixes a
C++ PCH crasher.
In Sema's TryRefInitWithConversionFunction, suppress user conversions for the overload candidates.
Fixes an infinite recursion in overload resolution for rdar://8499524.
Many thanks to Doug!
John McCall [Tue, 5 Oct 2010 02:33:56 +0000 (02:33 +0000)]
If we're resolving all outstanding fixups, and there are multiple fixups
for the same destination, then we must potentially rewrite the initial branch
of every fixup. Without this patch, a short-circuit check meant to prevent
a switch case from being redundantly added was preventing later fixups from
being processed. Fixes PR8175 (again).
John McCall [Mon, 4 Oct 2010 23:42:51 +0000 (23:42 +0000)]
In the fragile ObjC ABI, save the caught exception to the side if there are
both @catches and a @finally, because the second call to @objc_exception_try_enter
will clobber the exception slot. Fixes rdar://problem/8440970.
Douglas Gregor [Sat, 2 Oct 2010 23:49:58 +0000 (23:49 +0000)]
When providing a block literal as a code completion for a
function/method argument, include the parameter name and always
include parentheses (even for zero-parameter blocks). Otherwise, the
block literal placeholder '^' can look very weird.
Douglas Gregor [Sat, 2 Oct 2010 22:49:11 +0000 (22:49 +0000)]
Introduce a new libclang function, clang_getCursorDisplayName(), which
produces a simple "display" name that captures the
arguments/parameters for a function, function template, class
template, or class template specialization.
Chris Lattner [Sat, 2 Oct 2010 21:32:59 +0000 (21:32 +0000)]
the mmx intrinsic for pshufw should map to the IR intrinsic, not
to a shufflevector. Otherwise it doesn't turn into a pshufw.
This bug was introduced in the mmx rewrite.
Douglas Gregor [Sat, 2 Oct 2010 21:06:43 +0000 (21:06 +0000)]
When we insert a category (or class extension) into an interface, mark
the interface as having changed since it was originally
serialized. This ensures that we see class extensions/categories in
chained PCH files.
Douglas Gregor [Sat, 2 Oct 2010 19:51:13 +0000 (19:51 +0000)]
Provide proper source location and range information for C++ base
specifier cursors in libclang. FIXME -=2, fixes the rest of
<rdar://problem/8274883>.
Chris Lattner [Sat, 2 Oct 2010 00:09:12 +0000 (00:09 +0000)]
when expanding a builtin, if the argument is required to be a constant,
force it to be a constant instead of emitting with EmitScalarExpr. In
-ftrapv mode, they are not the same.
Douglas Gregor [Fri, 1 Oct 2010 23:55:07 +0000 (23:55 +0000)]
Don't add an imported function into its lexical context until *after*
we've set all of its parameters. Fixes <rdar://problem/8499598>;
thanks to Sean for the diagnosis.
we used to get:
fatal error: error in backend: Cannot yet select: intrinsic %llvm.x86.sse2.psll.dq
now we get:
/Users/sabre/t.c:4:11: error: argument to '__builtin_ia32_pslldqi128' must be a
constant integer
white2 = _mm_slli_si128(white2, N);
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/sabre/t.c:1:
/Volumes/Projects/cvs/llvm/Debug+Asserts/lib/clang/2.9/include/emmintrin.h:781:13: note: instantiated from:
((__m128i)__builtin_ia32_pslldqi128((__m128i)(VEC), (IMM)*8))
^ ~~~~~~~
1 error generated.
Gabor Greif [Fri, 1 Oct 2010 22:05:14 +0000 (22:05 +0000)]
Factor out enumerator APSInt adjustment into
a helper function (AdjustAPSInt) and use that
for adjusting the high bounds of case ranges
before APSInt comparisons. Fixes
http://llvm.org/bugs/show_bug.cgi?id=8135
Douglas Gregor [Fri, 1 Oct 2010 20:25:15 +0000 (20:25 +0000)]
Extend libclang with an API that determines, given a C++ virtual
member function or an Objective-C method, which other member
functions/methods it overrides.