Douglas Gregor [Wed, 16 Jun 2010 00:35:25 +0000 (00:35 +0000)]
Give Type::isIntegralType() an ASTContext parameter, so that it
provides C "integer type" semantics in C and C++ "integral type"
semantics in C++.
Note that I still need to update isIntegerType (and possibly other
predicates) using the same approach I've taken for
isIntegralType(). The two should have the same meaning, but currently
don't (!).
Douglas Gregor [Wed, 16 Jun 2010 00:17:44 +0000 (00:17 +0000)]
Introduce Type::isIntegralOrEnumerationType(), to cover those places
in C++ that involve both integral and enumeration types. Convert all
of the callers to Type::isIntegralType() that are meant to work with
both integral and enumeration types over to
Type::isIntegralOrEnumerationType(), to prepare to eliminate
enumeration types as integral types.
Jeffrey Yasskin [Tue, 15 Jun 2010 23:50:08 +0000 (23:50 +0000)]
Describe a gcc compatibility problem that occurs when a template calls a
function defined between its declaration and an instantiation, and that
function isn't findable through ADL.
Patch adds support for copying of those
objective-c++ class objects which have GC'able objc object
pointers and need to use ObjC's objc_memmove_collectable
API (radar 8070772).
Douglas Gregor [Tue, 15 Jun 2010 21:38:40 +0000 (21:38 +0000)]
Update equality and relationship comparisons of pointers to reflect
C++ semantics, eliminating an extension diagnostic that doesn't match
C++ semantics (ordered comparison with NULL) and tightening some
extwarns to errors in C++ to match GCC and maintain conformance in
SFINAE contexts. Fixes <rdar://problem/7941392>.
Chris Lattner [Tue, 15 Jun 2010 18:06:43 +0000 (18:06 +0000)]
Remove a dead argument to ProcessUCNEscape.
Fix string concatenation to treat escapes in concatenated strings that
are wide because of other string chunks to process the escapes as wide
themselves. Before we would warn about and miscompile the attached testcase.
This fixes rdar://8040728 - miscompile + warning: hex escape sequence out of range
Daniel Dunbar [Tue, 15 Jun 2010 17:48:49 +0000 (17:48 +0000)]
Break Frontend's dependency on Rewrite, Checker and CodeGen in shared library configuration
Currently, all AST consumers are located in the Frontend library,
meaning that in a shared library configuration, Frontend has a
dependency on Rewrite, Checker and CodeGen. This is suboptimal for
clients which only wish to make use of the frontend. CodeGen in
particular introduces a large number of unwanted dependencies.
This patch breaks the dependency by moving all AST consumers with
dependencies on Rewrite, Checker and/or CodeGen to their respective
libraries. The patch therefore introduces dependencies in the other
direction (i.e. from Rewrite, Checker and CodeGen to Frontend).
After applying this patch, Clang builds correctly using CMake and
shared libraries ("cmake -DBUILD_SHARED_LIBS=ON").
N.B. This patch includes file renames which are indicated in the
patch body.
Changes in this revision of the patch:
- Fixed some copy-paste mistakes in the header files
- Modified certain aspects of the coding to comply with the LLVM
Coding Standards
Sean Hunt [Tue, 15 Jun 2010 02:36:48 +0000 (02:36 +0000)]
MinGW requires that wint_t be defined in stddef.h. In order to accomodate, we
won't define it unless specifically requested via the use of __need_wint_t.
Douglas Gregor [Mon, 14 Jun 2010 23:15:08 +0000 (23:15 +0000)]
Add name mangling for address spaces. We use the vendor-extension
mangling for types, where the <source-name> is ASxxx (xxx is the
address-space number).
Douglas Gregor [Mon, 14 Jun 2010 22:07:54 +0000 (22:07 +0000)]
Warn when a 'typename' or a 'template' keyword refers to a
non-dependent type or template name, respectively, in C++98/03. Fixes
PR7111 and <rdar://problem/8002682>.
Douglas Gregor [Mon, 14 Jun 2010 21:15:09 +0000 (21:15 +0000)]
Put warnings about designated initializations overridding prior
initializations into their own warning group, initializer-overrides,
which is part of -Wextra. Patch by william@25thandClement.com, fixes
PR6934!
Chris Lattner [Mon, 14 Jun 2010 18:31:46 +0000 (18:31 +0000)]
Fix:
Decl.cpp:716:28: warning: initialization of pointer of type 'clang::VarDecl *' from literal 'false' [-Wbool-conversions]
VarDecl *LastTentative = false;
^
RewriteRope.cpp:535:12: warning: initialization of pointer of type '<anonymous>::RopePieceBTreeNode *' from literal 'false'
[-Wbool-conversions]
return false;
^
Charles Davis [Mon, 14 Jun 2010 05:29:01 +0000 (05:29 +0000)]
Microsoft C++ Mangler:
- Mangle qualifiers.
- Start mangling variables' types into the name. A variable declared with a
builtin type should now mangle properly.
Daniel Dunbar [Fri, 11 Jun 2010 22:00:26 +0000 (22:00 +0000)]
Driver: Add an explicit argument translation phase to the driver itself. We are going to need this to handle things like -Xassembler, -Xpreprocessor, and -Xlinker which we might have to introspect.
John McCall [Fri, 11 Jun 2010 17:54:15 +0000 (17:54 +0000)]
Fix the constant evaluator for AltiVec-style vector literals so that the
vector is filled with the given constant; we were just initializing the
first element.
John McCall [Fri, 11 Jun 2010 10:04:22 +0000 (10:04 +0000)]
Conversions from Objective C object pointers to bool are "pointer conversions
to bool" in the sense of C++ [over.ics.rank]p4 bullet 1. I have decreed it.
Jeffrey Yasskin [Fri, 11 Jun 2010 06:58:43 +0000 (06:58 +0000)]
Fix the 64-bit build. operator<<(DiagnosticBuilder, long) doesn't exist, so
ptrdiff_t (long on 64-bit, apparently) is ambiguous between the int and
unsigned int overloads.
Jeffrey Yasskin [Fri, 11 Jun 2010 05:57:47 +0000 (05:57 +0000)]
Add an option -fshow-overloads=best|all to limit the number of overload
candidates printed. We default to 'all'. At the moment, 'best' prints only
the first 4 overloads, but we'll improve that over time.
Tom Care [Fri, 11 Jun 2010 04:22:02 +0000 (04:22 +0000)]
Small fixes regarding printf fix suggestions.
- Added some handling of flags that become invalid when changing the conversion specifier.
- Changed fixit behavior to remove unnecessary length modifiers.
- Separated some tests out and added some comments.
Charles Davis [Fri, 11 Jun 2010 03:07:32 +0000 (03:07 +0000)]
Start implementing the Microsoft-style name mangler. Mangle simple names
(but not their types; that's later).
NOTE: Right now, variables in the global namespace don't get mangled, even
though they're supposed to be. This is because the default mangler
implements the shouldMangleDeclName() method that tells clang not to mangle
them. This will be fixed in a later patch.
John McCall [Fri, 11 Jun 2010 00:33:02 +0000 (00:33 +0000)]
Split DependentNameType into two types. DependentNameType represents the
case of an elaborated-type-specifier like 'typename A<T>::foo', and
DependentTemplateSpecializationType represents the case of an
elaborated-type-specifier like 'typename A<T>::template B<T>'. The TypeLoc
representation of a DependentTST conveniently exactly matches that of an
ElaboratedType wrapping a TST.
Kill off the explicit rebuild methods for RebuildInCurrentInstantiation;
the standard implementations work fine because the nested name specifier
is computable in the newly-entered context.
Chandler Carruth [Thu, 10 Jun 2010 10:31:57 +0000 (10:31 +0000)]
Another chunk of the new RecursiveASTVisitor implementation: switch the return
value semantics such that we recurse while the visitors return true, and halt
as soon as one returns false. Patch by csilvers.