Benjamin Kramer [Sun, 11 Oct 2009 12:22:00 +0000 (12:22 +0000)]
CMake mingw build fixes.
- llvm's libs must be linked after clang's
- libLLVMSystem depends on psapi on win32 (get_system_libs has it)
- CIndex builds successfully on mingw now
Zhongxing Xu [Sun, 11 Oct 2009 08:08:02 +0000 (08:08 +0000)]
Introduces a new BindingVal which combines direct and
default binding for regions. This allows us to simply a lot of code. A
further simplification could be done is that many methods of
regionstore can only work on Store instead of GRState.
Sebastian Redl [Sat, 10 Oct 2009 12:04:10 +0000 (12:04 +0000)]
Implement the core checking for compatible exception specifications in assignment and initialization.
The exception specification of the assignee must be the same or a subset of the target. In addition, exception specifications on arguments and return types must be equivalent, but this is not implemented yet.
This currently produces two diagnostics for every invalid assignment/initialization, due to the diagnostic produced outside PerformImplicitConversion, e.g. in CheckSingleInitializer. I don't know how to suppress this; in any case I think it is the wrong place for a diagnostic, since there are other diagnostics produced inside the function. So I'm leaving it as it is for the moment.
John McCall [Sat, 10 Oct 2009 05:48:19 +0000 (05:48 +0000)]
Qualified lookup through using declarations. Diagnose a new type of ambiguity.
Split the various ambiguous result enumerators into their own enum. Tests
for most of C++ [namespace.qual].
Anders Carlsson [Fri, 9 Oct 2009 23:51:55 +0000 (23:51 +0000)]
Add CheckCallReturnType and start using it for regular call expressions. This will improve error messages. For
struct B;
B f();
void g() {
f();
}
We now get
t.cpp:6:3: error: calling 'f' with incomplete return type 'struct B'
f();
^~~
t.cpp:3:3: note: 'f' declared here
B f();
^
t.cpp:1:8: note: forward declaration of 'struct B'
struct B;
^
Douglas Gregor [Fri, 9 Oct 2009 22:16:47 +0000 (22:16 +0000)]
Minor tweaks for code-completion:
- Filter out unnamed declarations
- Filter out declarations whose names are reserved for the
implementation (e.g., __bar, _Foo)
- Place OVERLOAD: or COMPLETION: at the beginning of each
code-completion result, so we can easily separate them from other
compilation results.
John McCall [Fri, 9 Oct 2009 21:13:30 +0000 (21:13 +0000)]
Refactor the LookupResult API to simplify most common operations. Require users to
pass a LookupResult reference to lookup routines. Call out uses which assume a single
result.
Douglas Gregor [Fri, 9 Oct 2009 21:11:42 +0000 (21:11 +0000)]
When declaring a friend class template, we may end up finding an
injected-class-name (e.g., when we're referring to other
specializations of the current class template). Make sure that we see
the template rather than the injected-class-name. Fixes PR4768.
Produce good looking diagnostics on ambiguous built-in operators.
Now we produce things like:
bug1.cpp:21:11: error: use of overloaded operator '->*' is ambiguous
int i = c->*pmf; // expected-error {{use of overloaded operator '->*' is ambiguous}} \
~^ ~~~
bug1.cpp:21:11: note: built-in candidate operator ->* ('struct A volatile *', 'int const struct A::*')
bug1.cpp:21:11: note: built-in candidate operator ->* ('struct A volatile *', 'int restrict struct A::*')
...
Still need to look at an issue (indicated as FIXME in the test case).
Steve Naroff [Thu, 8 Oct 2009 23:45:10 +0000 (23:45 +0000)]
- Fixup SortCodeCompleteResult() to properly sort keywords on Mac OS (compare was system dependent). Worked on Linux, failed on Mac OS (which caused the recently added testcase to fail on Linux).
- Sort results in testcase.
Mike Stump [Thu, 8 Oct 2009 23:00:00 +0000 (23:00 +0000)]
"Someone pointed out that in my previous Targets.cpp patch I didn't
handle the long size difference for one of the Windows targets." Patch
by John Thompson.
Mike Stump [Thu, 8 Oct 2009 22:55:36 +0000 (22:55 +0000)]
This fixes support for complex literals, reworked to avoid a goto, and
to add a flag noting the presence of a Microsoft extension suffix (i8,
i16, i32, i64). Patch by John Thompson.
Mike Stump [Thu, 8 Oct 2009 21:57:41 +0000 (21:57 +0000)]
In VC++, the *printf functions put an extra "0" in the exponent part
of a floating point number. This add regular expressions to account
for this. Patch by John Thompson.
Douglas Gregor [Thu, 8 Oct 2009 15:54:21 +0000 (15:54 +0000)]
Don't complain about out-of-line explicit specializations of member
function and member function templates that are not definitions. Add
more tests to ensure that explicit specializations of member function
templates prevent instantiation.
Douglas Gregor [Thu, 8 Oct 2009 15:14:33 +0000 (15:14 +0000)]
Improve checking for specializations of member classes of class
templates, and keep track of how those member classes were
instantiated or specialized.
Make sure that we don't try to instantiate an explicitly-specialized
member class of a class template, when that explicit specialization
was a declaration rather than a definition.
Douglas Gregor [Thu, 8 Oct 2009 07:24:58 +0000 (07:24 +0000)]
For instantiations of static data members of class templates, keep
track of the kind of specialization or instantiation. Also, check the
scope of the specialization and ensure that a specialization
declaration without an initializer is not a definition.
Douglas Gregor [Thu, 8 Oct 2009 00:14:38 +0000 (00:14 +0000)]
Only perform an implicit instantiation of a function if its template
specialization kind is TSK_ImplicitInstantiation. Previously, we would
end up implicitly instantiating functions that had explicit
specialization declarations or explicit instantiation declarations
(with no corresponding definitions).
Douglas Gregor [Wed, 7 Oct 2009 23:56:10 +0000 (23:56 +0000)]
Keep track of whether a member function instantiated from a member
function of a class template was implicitly instantiated, explicitly
instantiated (declaration or definition), or explicitly
specialized. The same MemberSpecializationInfo structure will be used
for static data members and member classes as well.
John McCall [Wed, 7 Oct 2009 23:34:25 +0000 (23:34 +0000)]
Refactoring around friend class templates. Better error message for friend enums.
Don't create a new declaration for friend classes if a declaration already exists.
Douglas Gregor [Wed, 7 Oct 2009 22:35:40 +0000 (22:35 +0000)]
Type checking for specializations of member functions of class
templates. Previously, these weren't handled as specializations at
all. The AST for representing these as specializations is still a work
in progress.
Fixes problem in finding visible convertion functions of a class
where matching conversion types in base classes were still visible.
Plus refactoring and cleanup.
Added a test case.
Anders Carlsson [Wed, 7 Oct 2009 01:06:45 +0000 (01:06 +0000)]
Add a MangleContext and pass it to all mangle functions. It will be used for keeping state, such as identifiers assigned to anonymous structs as well as scope encoding.
Ted Kremenek [Wed, 7 Oct 2009 00:42:52 +0000 (00:42 +0000)]
Change ExplodedNode to have its NodeGroups all BumpPtrAllocated, avoiding malloc() traffic when adding successors/predecessors to a node. This was done by introducing BumpVector, which is essentially SmallVector with all memory being BumpPtrAllocated (this can certainly be cleaned up or moved into llvm/ADT).
This change yields a 1.8% speed increase when running the analyzer (with -analyzer-store=region) on a small benchmark file.
Douglas Gregor [Wed, 7 Oct 2009 00:13:32 +0000 (00:13 +0000)]
Refactor checking of the scope of explicit template specialization
declarations and explicit template instantiations, improving
diagnostics and making the code usable for function template
specializations (as well as class template specializations and partial
specializations).
Patch to implement C++ [over.built]p11 of overload resolution.
Doug, please review. There is a FIXME in the test case with a question
which is unrelated to this patch (that is, error is issued
before set of builtins are added to the candidate list).
Douglas Gregor [Tue, 6 Oct 2009 21:27:51 +0000 (21:27 +0000)]
Test explicit specialization for all of the various cases where
explicit specializations can occur. Also, fix a minor recovery bug
where we should allow declarations coming from the parser to be NULL.