Richard Smith [Wed, 12 Oct 2011 00:37:51 +0000 (00:37 +0000)]
Handle Perforce-style conflict markers like normal conflict markers. Perforce
swaps over the <<<< and >>>> markers, and uses shorter markers than traditional
tools.
John McCall [Tue, 11 Oct 2011 23:14:30 +0000 (23:14 +0000)]
Catch placeholder types in DefaultLvalueConversion
and DefaultFunctionArrayLvalueConversion. To prevent
significant regression for should-this-be-a-call fixits,
and to repair some such regression from the introduction of
bound member placeholders, make those placeholder checks
try to build calls appropriately. Harden the build-a-call
logic while we're at it.
Eric Christopher [Tue, 11 Oct 2011 23:00:55 +0000 (23:00 +0000)]
Start handling debug line and scope information better:
Migrate most of the location setting within the larger API in CGDebugInfo and
update a lot of callers.
Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
and replace it with DILexicalBlockFile usage.
Richard Smith [Tue, 11 Oct 2011 19:57:52 +0000 (19:57 +0000)]
Add a -Wc++0x-compat warning for C++11 keywords used as identifiers when in
C++98 mode. Only the first occurrence of each keyword will produce a warning.
Daniel Dunbar [Tue, 11 Oct 2011 18:20:16 +0000 (18:20 +0000)]
Driver: Add support for a new -nostdlibinc option.
- This disables the system include directories, but not the compiler builtin
directories. Useful for projects that want to use things like the intrinsic
headers, but are otherwise freestanding.
- I'm willing to reconsider the option naming, I also considered providing an
explicit -builtinc (which would match -nobuiltininc), but this is more
consistent with existing options.
Kaelyn Uhrain [Tue, 11 Oct 2011 01:02:41 +0000 (01:02 +0000)]
Add typo correction for type names.
The main motivation was to do typo correction in C++ "new" statements,
though picking it up in other places where type names are expected was
pretty much a freebie.
Douglas Gregor [Mon, 10 Oct 2011 23:37:54 +0000 (23:37 +0000)]
Make sure we initialize the "extra" data within the libclang code
completion context, in case we end up having no code-completion
callback. Individual instances of this problem are always bugs that
need to be fixed, but it's better to make sure we have initialized
data here.
Ted Kremenek [Mon, 10 Oct 2011 22:36:28 +0000 (22:36 +0000)]
Rework construction of CXXForRangeStmt not to recycle the same DeclRefExpr in multiple subexpressions. This breaks the tree structure
of the AST and completely breaks the CFG invariants.
Patch by Jim Goodnow II and reviewed by Richard Smith!
[libclang] Implement ConcurrencyCheck using a recursive mutex to allow re-entrancy in the same thread.
The checks are performed only in DEBUG, it becomes no-op in release mode.
Douglas Gregor [Mon, 10 Oct 2011 18:59:29 +0000 (18:59 +0000)]
When substituting into a sizeof parameter pack expression in a context
where we can't expand (i.e., multi-level substitution), be sure to
substitute the pack with its level-reduced pack. Fixes PR10230.
Chad Rosier [Mon, 10 Oct 2011 18:44:24 +0000 (18:44 +0000)]
When an included non-system directory duplicates a system directory the clang
frontend removes the non-system directory to maintain gcc compatibility. When
this happens NumAngled needs to be updated.
PR11097
Richard Smith [Mon, 10 Oct 2011 18:28:20 +0000 (18:28 +0000)]
Constant expression evaluation refactoring:
- Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions,
and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert
behaviour.
- Factor out evaluation of bitfield bit widths.
- Fix a few places which would evaluate an expression twice: once to determine
whether it is a constant expression, then again to get the value.
Douglas Gregor [Mon, 10 Oct 2011 18:15:57 +0000 (18:15 +0000)]
Don't suggest 'noreturn' for function template instantiations, because
it might be wrong for other instantiations of the same function
template. Fixes PR10801.
Sebastian Redl [Mon, 10 Oct 2011 18:10:00 +0000 (18:10 +0000)]
Now that we support move generation, mention this in the language extension and C++ status pages. Also update the C++ status for default functions, which are complete now that we can generate move functions, and destructor exception specifications, which I did a while ago.
Richard Smith [Mon, 10 Oct 2011 16:38:04 +0000 (16:38 +0000)]
constexpr: Disable checking of constructor member initializer lists for
constexpr constructor templates. Such checking is optional, and currently hard
to get right since clang doesn't generate implicit member initializers until
instantiation (even for non-dependent members).
This is needed for clang to accept libstdc++ from g++4.6 in c++0x mode.
Douglas Gregor [Mon, 10 Oct 2011 16:05:18 +0000 (16:05 +0000)]
When adding a direct initializer to a declaration, allow the
initializer to update the type of the declaration. For example, this
allows us to determine the size of an incomplete array from its
initializer. Fixes PR10288.
Sean Hunt [Mon, 10 Oct 2011 06:18:57 +0000 (06:18 +0000)]
Begin work consolidating ShouldDelete* functions.
Begin with just default constructors. One note is that as a side effect
of this, a conformance test was removed on the basis that this is almost
certainly a defect as with most of union initialization. As it is, clang
does not implement union initialization close to the standard as it's
quite broken as written. I hope to write a paper addressing the issues
eventually.
Douglas Gregor [Sun, 9 Oct 2011 22:57:49 +0000 (22:57 +0000)]
Push "out-of-line" declarations into scope when their lexical/semantic
redeclaration contexts are the same, as occurs within linkage
specifications. Fixes PR9162.
Douglas Gregor [Sun, 9 Oct 2011 22:06:46 +0000 (22:06 +0000)]
Per the note in C++0x [temp.deduct.call]p4, don't attempt template
argument deduction against a function parameter that has no deducible
template parameters in it. Fixes PR8598.
Douglas Gregor [Sun, 9 Oct 2011 19:10:41 +0000 (19:10 +0000)]
Only allow taking the address of an expression of type 'overloaded
function type' when that expression is actually an overloaded function
reference (and not the address of an overloaded function
reference). Fixes PR11066.
Douglas Gregor [Sun, 9 Oct 2011 18:45:17 +0000 (18:45 +0000)]
When building source location information for an _Atomic type, be sure
to fill in the source locations for the underlying value type. Fixes
an intermittent crasher (due to uninitialized data) in the PCH test
for _Atomic types.
objc: Do not warn about mismatch on Super's readonly property attribute,
related to a readwrite property, and
Sub's readwrite property. // rdar://9396329
David Chisnall [Sat, 8 Oct 2011 08:54:36 +0000 (08:54 +0000)]
Apparently getPtrToInt() takes an explicit type parameter to allow you to generate invalid bitcode, not so that it can actually produce a value of this type. This should fix PR11085.
Ted Kremenek [Sat, 8 Oct 2011 05:28:26 +0000 (05:28 +0000)]
Free 'TheTargetCodeGenInfo' in the class CodeGenModule. This looks like an obvious memory leak that was reported from LLDB devs. The comment indicates the leak is deliberate, but I have no idea why this needs to be so. Please comment/revert if you know otherwise.
Make clang-tblgen's Makefile independent of Clang's top-level Makefile,
to avoid having to make it available for the cross build when it
builds only clang-tblgen.