John McCall [Tue, 12 Oct 2010 00:20:44 +0000 (00:20 +0000)]
Add some infrastructure for dealing with expressions of 'placeholder' type,
i.e. expressions with an internally-convenient type which should not be
appearing in generally valid, complete ASTs.
Douglas Gregor [Mon, 11 Oct 2010 23:17:59 +0000 (23:17 +0000)]
Eliminate CIndexer::getClangPath(), since libclang no longer depends
on the presence of a 'clang' executable. Simplify
CIndexer::getClangResourcesPath() a bit.
Patch up the CMake makefiles to install headers into two locations in
the build tree, for those silly cases where 'clang' will end up
looking into the wrong build directory for headers.
Douglas Gregor [Mon, 11 Oct 2010 22:02:06 +0000 (22:02 +0000)]
Eliminate -fdiagnostics-binary and all of the infrastructure for
emitting diagnostics in a binary form to be consumed by libclang,
since libclang no longer does any of its work out-of-process, making
this code dead. Besides, this stuff never worked at 100% anyway.
Douglas Gregor [Mon, 11 Oct 2010 21:37:58 +0000 (21:37 +0000)]
Switch c-index-test from clang_codeComplete() over to
clang_codeCompleteAt(). This uncovered a few issues with the latter:
- ASTUnit wasn't saving/restoring diagnostic state appropriately between
reparses and code completions.
- "Overload" completions weren't being passed through to the client
This patch does a few things in the area of objective-c
properties.
1. Generates the AST for lexical info. of accessing
getter/setter methods using dot-syntax notation.
This fixes //rdar: //8528170.
2. Modifes rewriter to handle the AST putout in 1.
3. Supportes in rewriter ObjCImplicitSetterGetter ASTs.
Douglas Gregor [Mon, 11 Oct 2010 16:52:23 +0000 (16:52 +0000)]
Eliminate clang_setUseExternalASTGeneration() from libclang. Between
improvements to the compiler and the introduction of crash recovery,
it no longer makes sense to allow this mode. Moreover, this eliminates
one use of the "clang" executable from within libclang; we'd like them
all to go away.
Axel Naumann [Mon, 11 Oct 2010 09:18:43 +0000 (09:18 +0000)]
Declare argv parameters as const char* const* instead of to char** to clarify that they are not modified, and to allow for string literals as arguments.
Chris Lattner [Mon, 11 Oct 2010 05:44:49 +0000 (05:44 +0000)]
Per discussion with Sanjiv, remove the PIC16 target from mainline. When/if
it comes back, it will be largely a rewrite, so keeping the old codebase
in tree isn't helping anyone.
NAKAMURA Takumi [Mon, 11 Oct 2010 02:27:37 +0000 (02:27 +0000)]
lib/Frontend/InitHeaderSearch.cpp: Fix compatibility to Cygming.
- lib/gcc/include should not be included. Clang oughta have alternatives. (PR7956)
- Cygwin: /usr/include/w32api should be included. gcc/cygwin does.
- gcc/cygwin uses gcc paths as /usr/lib not /lib. They are same on Cygwin environment, though, We have to take what gcc/cygwin does.
- Cygwin-1.7: Use 4.3.4.
- Cygwin-1.5: Use 4.3.2 for gcc-4.
Benjamin Kramer [Sat, 9 Oct 2010 15:49:00 +0000 (15:49 +0000)]
Don't rely on a StringRef being null-terminated (it's not) for deprecation messages.
Store pointer and length of the message in DelayedDiagnostic and hide the gory union details.
Method implemented in class's implementation may implement
one declared in class's extension and not one declared
in class's superclass. This supresses a bogus warning on
method type mismatch.
Fixes //rdar: // 8530080
When dealing with an assignment with LHS being a property reference
expression, the entire assignment tree is rewritten into a property
setter messaging. This includes rewriting the RHS.
Do not attempt to rewrite RHS again. Never rewrite a rewritten text!
Fixes //rdar: //8527018.
Douglas Gregor [Fri, 8 Oct 2010 20:56:19 +0000 (20:56 +0000)]
Revert the hack Chris Lattner added in r97981 to work around
brokenness in the designated-initializer ASTs. The ASTs were fixed by
Alp Toker's patch (r116098) for PR6955. Fixes PR6537.
Douglas Gregor [Fri, 8 Oct 2010 20:44:28 +0000 (20:44 +0000)]
This patch fixes multiple issues in clang's designated init builder and
completes support for C1X anonymous struct/union init features:
* Indexed anonymous member initializers should not be expanded. Doing so makes
little sense and would cause unresolvable semantic ambiguity in valid code
(regression introduced by r69153).
* Subobject initialization of (possibly nested) anonymous members are now
referred to with paths relative to the naming record context, eliminating the
synthesis of incorrect implicit InitListExprs that caused CodeGen to assert.
* Field lookup was missing a null check in IdentifierInfo comparison which
caused lookup for a known (already resolved) field to match the first unnamed
data member it encountered leading to silent miscompilation.
* Subobject paths are no longer built using the general purpose
Sema::BuildAnonymousStructUnionMemberPath(). If any corner cases crop up, we
will now assert earlier in Sema instead of passing invalid InitListExprs
through to CodeGen.
Daniel Dunbar [Fri, 8 Oct 2010 19:30:33 +0000 (19:30 +0000)]
libclang: Disable LLVM pretty stack trace functionality, which inadvertently
sets up signal handlers it shouldn't when we are being used a shared library.
John McCall [Fri, 8 Oct 2010 18:24:19 +0000 (18:24 +0000)]
__attribute__((aligned(n))) directly specifies the alignment of a declaration
unless it's a non-packed field, in which case it can only increase the
alignment. [[align]] effectively works the same way for well-formed code
(because it's ill-formed for [[align]] to decrease alignment ever).
Douglas Gregor [Fri, 8 Oct 2010 04:03:57 +0000 (04:03 +0000)]
Fix three related, wily issues with the recompilation of precompiled
preambles:
- When we rebuild a precompiled preamble, make sure to disable
skipping anything in the main file; we may have had leftover
preamble-skipping values in the lexer, which leads to very empty
preamble. This is a correctness issue.
- When we rebuild a precompiled preamble, clear out any prior state
in the Diagnostic object. Otherwise, we might think that there
were errors when we were building the preamble itself, and
therefore reject the resulting preamble. This is mainly a
performance issue.
- Don't remove old remappings when digging out the remapping for the
main file. Having the old mappings around does not hurt in the
common case (later remappings will just overwrite them), and is
important when we fail to find a preamble: we don't want to have
removed the remapping, because we'll need it later.
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.