Richard Smith [Thu, 17 Mar 2011 16:11:59 +0000 (16:11 +0000)]
Fix PR9488: 'auto' type substitution can fail (for instance, if it creates a reference-to-void type). Don't crash if it does.
Also fix an issue where type source information for the resulting type was being lost.
Ted Kremenek [Thu, 17 Mar 2011 05:29:57 +0000 (05:29 +0000)]
Don't construct two CFGs just to run -Wuninitialized. While this causes new warnings to be flagged under -Wconditional-uninitialized, this is something we
can improve over time.
Ted Kremenek [Thu, 17 Mar 2011 03:51:51 +0000 (03:51 +0000)]
Tweak RegionStore's handling of lazy compound values to use the 'Default' versus 'Direct' binding key, thus allowing specific elements of an array/struct to be overwritten without
invalidating the entire binding. Fixes PR 9455.
Daniel Dunbar [Thu, 17 Mar 2011 00:07:34 +0000 (00:07 +0000)]
Driver/ARM: Match GCC behavior in that -msoft-float disables NEON, despite this
not being consistent at all with other parts of the GCC implementation.
Douglas Gregor [Wed, 16 Mar 2011 23:23:30 +0000 (23:23 +0000)]
When libclang visits a translation unit via clang_visitChildren(),
walk the preprocessing record *before* walking the declarations, so
they we pretend that we actually respect the phases of translation.
We still walk the preprocessing record after the declarations when
performing token annotation or finding the cursor at a location, since
those routines depend on those semantics.
Refactor program name logic. Extend it to infer the target triple from
the program name, if it includes it as proper prefix. This makes calling
clang with -ccc-host-triple x86_64-linux the same as calling it with the
name x86_64-linux-clang.
Having FileManager::getFile always open the file, brought much consternation and leaking of file descriptors.
Add 'openFile' bool to FileManager::getFile to specify whether we want to have the file opened or not, have it
false by default, and enable it only in HeaderSearch.cpp where the open+fstat optimization matters.
Douglas Gregor [Wed, 16 Mar 2011 19:16:25 +0000 (19:16 +0000)]
Clean up our handling of template-ids that resolve down to a single
overload, so that we actually do the resolution for full expressions
and emit more consistent, useful diagnostics. Also fixes an IRGen
crasher, where Sema wouldn't diagnose a resolvable bound member
function template-id used in a full-expression (<rdar://problem/9108698>).
Chandler Carruth [Wed, 16 Mar 2011 18:34:36 +0000 (18:34 +0000)]
Add a 'RawPath' parameter to the PPCallbacks interface. This allows
clients to observe the exact path through which an #included file was
located. This is very useful when trying to record and replay inclusion
operations without it beind influenced by the aggressive caching done
inside the FileManager to avoid redundant system calls and filesystem
operations.
The work to compute and return this is only done in the presence of
callbacks, so it should have no effect on normal compilation.
Douglas Gregor [Wed, 16 Mar 2011 18:21:05 +0000 (18:21 +0000)]
Don't indescriminately print overload candidates when we have invalid
operands to a binary expression; it doesn't make sense in all
contexts. The right answer would be to see if the user forgot at ().
Douglas Gregor [Wed, 16 Mar 2011 17:05:57 +0000 (17:05 +0000)]
Make sure that we always pop a function's scope *before* we call
ActOnFinishFunctionBody/ActOnBlockStmtExpr. This way, we ensure that
we diagnose undefined labels before the jump-scope checker gets run,
since the jump-scope checker requires (as its invariant) that all of
the GotoStmts be wired up correctly.
Douglas Gregor [Wed, 16 Mar 2011 16:39:03 +0000 (16:39 +0000)]
When we're inserting a synthesized label declaration for a
forward-looking "goto" statement, make sure to insert it *after* the
last declaration in the identifier resolver's declaration chain that
is either outside of the function/block/method's scope or that is
declared in that function/block/method's specific scope. Previously,
we could end up inserting the label ahead of declarations in inner
scopes, confusing C++ name lookup.
Fixes PR9491/<rdar://problem/9140426> and <rdar://problem/9135994>.
Note that the crash-on-invalid PR9495 is *not* fixed. That's a
separate issue.
John McCall [Tue, 15 Mar 2011 21:17:48 +0000 (21:17 +0000)]
Reorganize the emission of (unfoldable) constant casts a bit, and
make sure that upcasts of member pointer types are covered as constants.
Fixed rdar://problem/9130221
Sebastian Redl [Tue, 15 Mar 2011 21:17:12 +0000 (21:17 +0000)]
Create __has_feature(cxx_noexcept) and mark it as working.
Find out that our C++0x status has only one field for noexcept expression and specification together, and that it was accidentally already marked as fully implemented.
This completes noexcept specification work.
Don't poke into redefined 'id' type looking for a property
declaration as this results in a confusing error message,
instead of message related to missing property declaration.
// rdar://9106929
Ted Kremenek [Tue, 15 Mar 2011 05:22:33 +0000 (05:22 +0000)]
Take 2: merge -Wuninitialized-experimental into -Wuninitialized. Only *must-be-uninitialized* warnings are reported, with *maybe-uninitialized* under a separate flag. I await any fallout/comments/feedback, although hopefully this will produce no noise for users.
Ted Kremenek [Tue, 15 Mar 2011 04:57:32 +0000 (04:57 +0000)]
UninitializedValues: introduce ValueVector:reference class to forward to llvm::BitVector. No real functionality change, but this is a stepping stone to moving to tri-state logic.
Ted Kremenek [Tue, 15 Mar 2011 04:57:29 +0000 (04:57 +0000)]
UninitializedValues: wrap BitVector references in a new class ValueVector. No functionality change. This defines the minimum interface that ValueVector needs to support when we no longer base it strictly on a direct interpretation of BitVector.
Ken Dyck [Tue, 15 Mar 2011 01:09:02 +0000 (01:09 +0000)]
Introduce a CharUnits FieldOffsetInChars variable in AppendField() to
replace some uses of FieldOffsetInBytes. The remaining uses of
FieldOffsetInBytes will be replaced once NextFieldOffsetInBytes is converted
to CharUnits. No change in functionality intended.
After the open+fstat optimization, files were already opened for FileManager::getBufferForFile() and we closed them after reading them.
The problem was that when -working-directory was passed, the code path that actually reuses & closes the already opened file descriptor
was not followed.
Douglas Gregor [Mon, 14 Mar 2011 21:19:51 +0000 (21:19 +0000)]
When synthesizing a label declaration based on a goto statement that
cannot yet be resolved, be sure to push the new label declaration into
the right place within the identifier chain. Otherwise, name lookup in
C++ gets confused when searching for names that are lexically closer
than the label. Fixes PR9463.
Eric Christopher [Mon, 14 Mar 2011 20:30:34 +0000 (20:30 +0000)]
__clear_cache() is varargs and people will occasionally write it without
arguments. Process only the arguments that people write, but process
all of them.
Rafael Espindola [Mon, 14 Mar 2011 17:55:00 +0000 (17:55 +0000)]
Fix link of libxul with LTO and the linker in xcode4. It is not clear if this
is working around a bug in ld or if the new linker has a reasonable reason
for wanting the string constant to be linker visible.
Block return type of the initialized must be
be more speciaclized than that of the initializer,
when matching protocol qualifier list.
// rdar:// 9118343.
Sebastian Redl [Sun, 13 Mar 2011 17:09:40 +0000 (17:09 +0000)]
Instead of storing an ASTContext* in FunctionProtoTypes with computed noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall.
Oscar Fuentes [Sun, 13 Mar 2011 15:10:24 +0000 (15:10 +0000)]
Build libclang as a static library too. Now tested on Windows!
On Windows only the shared library is created. The reason for this is
that clang.lib the static library would clash with clang.lib the
export library of the dll.