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
Richard Smith [Thu, 6 Oct 2011 09:21:12 +0000 (09:21 +0000)]
PR11067: A definition of a constexpr static variable doesn't need an initializer if the in-class declaration had one. Such a declaration must be initialized by a constant expression.
[libclang] Introduce clang_findReferencesInFile which accepts a cursor, a file,
and a callback and finds all identifier references of the cursor in the file.
[libclang] Move the bulk of clang_getOverriddenCursors into
a cxcursor::getOverriddenCursors C++ function, because SmallVectors
are groovier that malloc'ing buffers.
When constructing debug information for synthesized variables for the
non-fragile ABI we may not be able to lay out the type and the debugger
would ignore us even if we did put in the offset. Go ahead and just
put any value there and don't look up the offset since it may not exist.
Anna Zaks [Wed, 5 Oct 2011 23:37:30 +0000 (23:37 +0000)]
[analyzer] OSAtomicChecker implements evalCall in a very invasive way - it essentially simulates inlining of compareAndSwap() by means of setting the NodeBuilder flags and calling ExprEngine directly.
This commit introduces a new callback just for this checker to unblock checker API cleanup.
Chad Rosier [Wed, 5 Oct 2011 19:51:41 +0000 (19:51 +0000)]
[driver] The -v option doesn't quoted the command line arguments for historical
reasons. However, it does seems practical to quote strings that need it.
rdar://10221951
Douglas Gregor [Wed, 5 Oct 2011 14:53:30 +0000 (14:53 +0000)]
Introduce a simple file-based locking protocol for on-demand module
creation, so that only a single Clang instance will rebuild a given
module at once (and the others will wait).
We still don't clean up the lock files when we crash, which is a
rather unfortunate problem. I'll handle that next, and there is
certainly a *lot* of room for further improvements.
John McCall [Wed, 5 Oct 2011 07:41:44 +0000 (07:41 +0000)]
Refactor the analysis of C++ cast expressions so that even
C-style and functional casts are built in SemaCXXCast.cpp.
Introduce a helper class to encapsulate most of the random
state being passed around, at least one level down.
Teach Clang to cope with GCC installations that have unusual patch
"versions". Currently, these are just dropped on the floor, A concrete
version number will always win out.
Implement the feature I was originally driving toward when I started
this saga. Teach the driver to detect a GCC installed along side Clang
using the existing InstalledDir support in the Clang driver. This makes
a lot of Clang's behavior more automatic when it is installed along side
GCC.
Also include the first test cases (more to come, honest) which test both
the install directory behavior, and the version sorting behavior to show
that we're actually searching for the best candidate GCC installation
now.
c: assignment/init of a function pointer whose function(s)
return to one which does not return (has noreturn attribute)
should warn as it is an unsafe assignment. // rdar://10095762
c++ already handles this. This is the c version.
Douglas Gregor [Tue, 4 Oct 2011 23:59:32 +0000 (23:59 +0000)]
Don't allow an rvalue reference to bind to the result of a calling a
conversion function whose result type is an lvalue reference. The
initialization code already handled this properly, but overload
resolution was allowing the binding. Fixes PR11003 /
<rdar://problem/10233078>.