Daniel Dunbar [Wed, 13 May 2009 21:34:08 +0000 (21:34 +0000)]
Add a test case to showcase a difference in #pragma pack handling
compared to gcc. This is worrisome, but I believe we are doing the
"correct" thing, and if I recall correctly I previously verified this
versus MSVC.
Ted Kremenek [Wed, 13 May 2009 21:07:32 +0000 (21:07 +0000)]
Add some basic type checking for attributes ns_returns_retained and
cf_returns_retained. Currently this attribute can now be applied to any
Objective-C method or C function that returns a pointer or Objective-C object
type.
Modify the tablegen definition of diagnostic 'warn_attribute_wrong_decl_type' to
expect that the diagnostics infrastructure will add quotes around the attribute
name when appropriate. Alonq with this change, I modified the places where this
warning is issued to passed the attribute's IdentifierInfo* instead of having a
hard-coded C constant string.
Douglas Gregor [Wed, 13 May 2009 20:28:22 +0000 (20:28 +0000)]
Explicit instantiations of templates now instantiate the definitions
of class members (recursively). Only member classes are actually
instantiated; the instantiation logic for member functions and
variables are just stubs.
Anders Carlsson [Wed, 13 May 2009 19:49:53 +0000 (19:49 +0000)]
Disable access control by default. It can be enabled with the -faccess-control option. When we have better support for it, we can enable it by default again.
Daniel Dunbar [Wed, 13 May 2009 18:54:26 +0000 (18:54 +0000)]
ABI handling: Fix invalid assertion, it is possible for a valid
coercion to be specified which truncates padding bits. It would be
nice to still have the assert, but we don't have any API call for the
unpadding size of a type yet.
Douglas Gregor [Wed, 13 May 2009 18:28:20 +0000 (18:28 +0000)]
Improve the semantic checking for explicit instantiations of
templates. In particular:
- An explicit instantiation can follow an implicit instantiation (we
were improperly diagnosing this as an error, previously).
- In C++0x, an explicit instantiation that follows an explicit
specialization of the same template specialization is ignored. In
C++98, we just emit an extension warning.
- In C++0x, an explicit instantiation must be in a namespace
enclosing the original template. C++98 has no such requirement.
Also, fixed a longstanding FIXME regarding the integral type that is
used for the size of a constant array type when it is being instantiated.
Ted Kremenek [Wed, 13 May 2009 18:16:01 +0000 (18:16 +0000)]
Fix crasher reported in PR 4209 caused by an invalid summary
generation when EvalObjCMessageExpr() did not resolve the
ObjCInterfaceDecl* for a receiver when the receiver's symbolic value
wasn't being explicitly tracked.
Chris Lattner [Wed, 13 May 2009 05:13:44 +0000 (05:13 +0000)]
Fix rdar://6880951 by rejecting vectors of vectors.
It seems dubious to me that isIntegerType() returns true for
vectors of integers, but not complex integers. This should
probably be rethought, I'll file a bugzilla.
Chris Lattner [Wed, 13 May 2009 04:00:12 +0000 (04:00 +0000)]
Fix rdar://6881069, a crash on a form of vector_size that we
don't support. While it would be nice to support this eventually,
this form is not common at all (just seen in gcc testsuite) and
it might be better to model vector_size as a type attribute anyway.
For now just emit a nice error on it.
Chris Lattner [Wed, 13 May 2009 02:50:56 +0000 (02:50 +0000)]
Fix rdar://6880259 - invalid function name in block call (__NSConcreteGlobalBlock2)
by using the appropriate CGM interface instead of directly creating a global.
Chris Lattner [Wed, 13 May 2009 00:55:26 +0000 (00:55 +0000)]
When we expect two arguments but have zero, make sure to add
two empty arguments. Also, add an assert so that this bug
manifests as an assertion failure, not a valgrind problem.
This fixes rdar://6880648 - [cpp] crash in ArgNeedsPreexpansion
Douglas Gregor [Wed, 13 May 2009 00:25:59 +0000 (00:25 +0000)]
Semantic analysis for explicit instantiation of class templates. We
still aren't instantiating the definitions of class template members,
and core issues 275 and 259 will both affect the checking that we do
for explicit instantiations (but are not yet implemented).
Chris Lattner [Tue, 12 May 2009 21:44:00 +0000 (21:44 +0000)]
improve the diagnostic for uses of the GCC "global variable in a register" extension.
This implements rdar://6880449 - improve diagnostic for usage of "global register variable" GCC extension
Douglas Gregor [Tue, 12 May 2009 21:31:51 +0000 (21:31 +0000)]
Refactor the parsing of declarations so that template declarations can
parse just a single declaration and provide a reasonable diagnostic
when the "only one declarator per template declaration" rule is
violated. This eliminates some ugly, ugly hackery where we used to
require thatn the layout of a DeclGroup of a single element be the
same as the layout of a single declaration.
Chris Lattner [Tue, 12 May 2009 21:21:08 +0000 (21:21 +0000)]
push GlobalDecl through enough of the CodeGenModule interfaces
to allow us to support generation of deferred ctors/dtors.
It looks like codegen isn't emitting a call to the dtor in
member-functions.cpp:test2, but when it does, its body should
get emitted.
Chris Lattner [Tue, 12 May 2009 21:02:27 +0000 (21:02 +0000)]
add an initial stab at emitting deferred c++ inline functions. This handles static
functions and methods declared inline, but not ctors/dtors or methods not declared
inline (apparently my previous patch wasn't good enough).
Chris Lattner [Tue, 12 May 2009 20:55:07 +0000 (20:55 +0000)]
Method who have definitions in structs/classes are semantically inline.
Per the FIXME, it might be interesting to track whether the inline keyword
was also used on the method, but for now we don't do this. Testcase pending.
Zhongxing Xu [Tue, 12 May 2009 10:10:00 +0000 (10:10 +0000)]
Add logic for invalidating array region to CFRefCount.cpp. When invalidating
array region, set its default value to conjured symbol. When retrieving its
element, create new region value symbol for the element.
Douglas Gregor [Tue, 12 May 2009 01:31:05 +0000 (01:31 +0000)]
Make precompiled headers work with -E. When we're only preprocessing
(with -E), we turn the PCH include into an implicit include of the
file from which the PCH file was generated.
Douglas Gregor [Mon, 11 May 2009 23:53:27 +0000 (23:53 +0000)]
Encapsulate template arguments lists in a new class,
TemplateArgumentList. This avoids the need to pass around
pointer/length pairs of template arguments lists, and will eventually
make it easier to introduce member templates and variadic templates.
Douglas Gregor [Mon, 11 May 2009 19:58:34 +0000 (19:58 +0000)]
Implement the notions of the "current instantiation" and "unknown
specialization" within a C++ template, and permit name lookup into the
current instantiation. For example, given:
template<typename T, typename U>
struct X {
typedef T type;
X* x1; // current instantiation
X<T, U> *x2; // current instantiation
X<U, T> *x3; // not current instantiation
::X<type, U> *x4; // current instantiation
X<typename X<type, U>::type, U>: *x5; // current instantiation
};
Patch to allow Nonfragile ABI to use 32-bit style legacy
message dispage API for all but a few messages. This is
a runtime performance improvement and there is not meant
to be a functional change.