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.
Ted Kremenek [Fri, 7 Oct 2011 22:21:02 +0000 (22:21 +0000)]
Remove AnalysisContext::getLiveVariables(), and introduce a templatized mechanism to lazily create analyses that are attached to AnalysisContext objects.
In DeclContext::LoadLexicalDeclsFromExternalStorage don't clear out
the fields if they are already loaded, just ignore them when we are building
the chain in BuildDeclChain.
This fixes an lldb issue where fields were removed and not getting re-added
because lldb is based on ASTImporter adding decls to DeclContext and fields
were already added before by the ASTImporter.
We should really simplify the interaction between DeclContext <-> lldb
going forward..
Anna Zaks [Fri, 7 Oct 2011 21:52:33 +0000 (21:52 +0000)]
[analyzer] Previously, we were passing to CheckerContext enough info to construct ProgramPoint and it would pass it to NodeBuilder, which in turn would construct the ProgramPoint. Simplify it by just passing the ProgramPoint to CheckerContext. The ProgramPoint can only change if a checker tags it, in which case, we create a copy with the given tag.
(A step closer to making CheckerContext work with all node builders, not only StmtNodeBuilder.)
Bob Wilson [Fri, 7 Oct 2011 17:54:41 +0000 (17:54 +0000)]
Clang driver changes for iOS 5.0 and OS X Lion support.
Check whether the libc++ library is available when using -stdlib=libc++,
and also adjust the check for whether to link with -lgcc_s.1.
Patch by Ted Kremenek and Daniel Dunbar.
John McCall [Fri, 7 Oct 2011 02:39:22 +0000 (02:39 +0000)]
Record layout requires not just a definition, but a complete
definition. Assert this. Change IR generation to not try to
aggressively emit the IR translation of a record during its
own definition. Fixes PR10912.
Anna Zaks [Thu, 6 Oct 2011 23:26:27 +0000 (23:26 +0000)]
[analyzer] Static Analyzer Qualification Infrastructure: Scripts to support basic testing of the analyzer on external projects. This can be used as a basis for setting up a buildbot.
Implicitly assume that a ObjC category to an unavailable interface is also unavailable;
only give an 'unavailable' error on the @implementation of the category. rdar://10234078
Eli Friedman [Thu, 6 Oct 2011 23:00:33 +0000 (23:00 +0000)]
Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic.
Thanks to Jeffrey Yasskin for the thorough review!
objc++: For atomic properties of c++ class objec typet, appropriate
operator= is called. Issue a warning for non-trivial case until
runtime support is provided. // rdar://6137845