Ted Kremenek [Fri, 18 Mar 2011 23:05:39 +0000 (23:05 +0000)]
Add libclang hook 'clang_toggleCrashRecovery()', which provides a mechanism for a client to enable/disable CrashRecovery within libclang function calls.
Add support for language-specific address spaces. On top of that,
add support for the OpenCL __private, __local, __constant and
__global address spaces, as well as the __read_only, _read_write and
__write_only image access specifiers. Patch originally by ARM;
language-specific address space support by myself.
Ted Kremenek [Fri, 18 Mar 2011 22:11:40 +0000 (22:11 +0000)]
Remove '-Xclang' and '-mllvm' entries from Clang man page. The later is only available in debug builds and the former is not supposed to be used by end-users.
Daniel Dunbar [Fri, 18 Mar 2011 21:23:40 +0000 (21:23 +0000)]
Driver: Forward -traditional and -traditional-cpp in preprocessing modes.
- We don't really support the majority of the horrible -traditional-cpp
behavior, but it is unlikely that we ever will either. This allows us to
start trying to use clang as a /usr/bin/cpp replacement and see what pieces
of -traditional-cpp mode people actually care about.
NAKAMURA Takumi [Fri, 18 Mar 2011 03:21:33 +0000 (03:21 +0000)]
test/Driver/sysroot-flags.c: Tweak for Mingw MSYS bash.
MSYS substitutes path (that begins with "/") to de-mounted Windows path, even if it were nonexistent.
"/foo/bar" might be substituted to "C:/msysgit/foo/bar".
John McCall [Fri, 18 Mar 2011 02:56:14 +0000 (02:56 +0000)]
The Darwin kernel does not provide useful guard variable support.
Issue this as an IR-gen error; it's not really worthwhile doing this
"right", i.e. in Sema, because IR gen knows a lot of tricks beyond
what the constant evaluator knows.
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.