Commit Graph

9968 Commits

Author SHA1 Message Date
Daniel Dunbar 88ad4c5d02 Mangler: Sketch mangling for TemplateArgument::Declaration kind.
- Several important FIXMEs related to whether arguments are expressions or external names, and the mangling of extern "C" names (c.f., PR5522).

llvm-svn: 89556
2009-11-21 09:17:15 +00:00
Daniel Dunbar e949e6cced Mangler: Lift shouldMangleDeclName predicate out of CXXNameMangler::mangle.
- Sometimes we have to mangle things we wouldn't normally (e.g., because they appear in a template expression).

 - This also tidies up the predicate to be more obvious what is getting mangled.

llvm-svn: 89555
2009-11-21 09:14:52 +00:00
Daniel Dunbar 161ade4455 Mangler: Strengthen invariants, MangleContext::mangleName should only be called on var or function decls.
llvm-svn: 89554
2009-11-21 09:14:44 +00:00
Daniel Dunbar 8483d211bd Mangler: Inline a bunch of functions into their sole caller, not that I don't love typing for typings sake, but...
llvm-svn: 89553
2009-11-21 09:12:13 +00:00
Daniel Dunbar 671f45e701 DeclPrinter: Indent access specifiers.
llvm-svn: 89552
2009-11-21 09:12:06 +00:00
Daniel Dunbar 1110dc06a8 Remove dead variable.
llvm-svn: 89551
2009-11-21 09:11:59 +00:00
Daniel Dunbar fdae6f7cd3 Mangler: Split isStdNamespace for when the caller already has a NamespaceDecl.
llvm-svn: 89550
2009-11-21 09:11:45 +00:00
Daniel Dunbar 4118ec5571 IRgen: Eliminate CXXNameMangler::mangleCXX{C,D}tor.
llvm-svn: 89549
2009-11-21 09:06:31 +00:00
Daniel Dunbar e128dd18ab IRgen: Switch the C++ mangler interfaces to take the SmallVector to write into,
instead of requiring clients to make a raw_svector_ostream, which is just an
implementation detail.

llvm-svn: 89548
2009-11-21 09:06:22 +00:00
Daniel Dunbar ef5d75afeb Sink free mangle* methods into MangleContext.
llvm-svn: 89547
2009-11-21 09:06:10 +00:00
Daniel Dunbar 4f1054ef2e Add 1+2 consts.
llvm-svn: 89546
2009-11-21 09:05:59 +00:00
Daniel Dunbar d614e326db Delete trailing space.
llvm-svn: 89545
2009-11-21 09:05:47 +00:00
John McCall d14a86427f "Incremental" progress on using expressions, by which I mean totally ripping
into pretty much everything about overload resolution in order to wean
BuildDeclarationNameExpr off LookupResult::getAsSingleDecl().  Replace  
UnresolvedFunctionNameExpr with UnresolvedLookupExpr, which generalizes the
idea of a non-member lookup that we haven't totally resolved yet, whether by
overloading, argument-dependent lookup, or (eventually) the presence of   
a function template in the lookup results.  

Incidentally fixes a problem with argument-dependent lookup where we were 
still performing ADL even when the lookup results contained something from
a block scope.  

Incidentally improves a diagnostic when using an ObjC ivar from a class method.
This just fell out from rewriting BuildDeclarationNameExpr's interaction with
lookup, and I'm too apathetic to break it out.

The only remaining uses of OverloadedFunctionDecl that I know of are in
TemplateName and MemberExpr.

llvm-svn: 89544
2009-11-21 08:51:07 +00:00
Alexis Hunt 96d5c76498 Added rudimentary C++0x attribute support.
The following attributes are currently supported in C++0x attribute
lists (and in GNU ones as well):
 - align() - semantics believed to be conformant to n3000, except for
   redeclarations and what entities it may apply to
 - final - semantics believed to be conformant to CWG issue 817's proposed
   wording, except for redeclarations
 - noreturn - semantics believed to be conformant to n3000, except for
   redeclarations
 - carries_dependency - currently ignored (this is an optimization hint)

llvm-svn: 89543
2009-11-21 08:43:09 +00:00
Daniel Dunbar f4b39e9c95 Fix refacto, gcc's cc1 needs to see --output-pch=, which is not just an alias
for -output-pch=.

llvm-svn: 89534
2009-11-21 02:31:29 +00:00
Douglas Gregor 26aedb7460 Implement C++ [temp.param]p2 correctly, looking ahead when we see a
"typename" parameter to distinguish between non-type and type template
parameters. Fixes the actual bug in PR5559.

llvm-svn: 89532
2009-11-21 02:07:55 +00:00
Ted Kremenek 9d6daf2cc4 Restructure DereferenceChecker slightly to handle caching out when we would report a null dereference more than once.
llvm-svn: 89526
2009-11-21 01:50:48 +00:00
Ted Kremenek caf2c51fad Pull BadCallChecker int UndefinedArgChecker, and have UndefinedArgChecker also handled undefined receivers in message expressions.
llvm-svn: 89524
2009-11-21 01:25:37 +00:00
Edward O'Callaghan 847f2a10ee Add SigAtomicType to TargetInfo, Needed for MSP and PIC Targets, Credit to Ken Dyck.
llvm-svn: 89520
2009-11-21 00:49:54 +00:00
Ted Kremenek f7adea43b4 More checker refactoring. Passing undefined values in a message expression is now handled by UndefinedArgChecker.
llvm-svn: 89519
2009-11-21 00:49:41 +00:00
John Thompson c1b70ab9b8 Revised Win32 include path to search highest version in registry, plus platform SDK path
llvm-svn: 89517
2009-11-21 00:15:52 +00:00
Mike Stump 58ef18b38c Checkpoint current work. WIP.
llvm-svn: 89513
2009-11-20 23:44:51 +00:00
Douglas Gregor ade9bcd72e Cope with extraneous "template" keyword when providing an out-of-line
definition of a member template (or a member thereof). Fixes PR5566.

llvm-svn: 89512
2009-11-20 23:39:24 +00:00
Daniel Dunbar a764eef0e9 Driver: Add clang -cc1 dependency output options parsing.
llvm-svn: 89508
2009-11-20 23:28:07 +00:00
Daniel Dunbar a604639635 Switch CompilerInvocation::CreateFromArgs to take const char** arguments until Driver itself switches to StringRef.
llvm-svn: 89503
2009-11-20 22:47:55 +00:00
Daniel Dunbar 2eaef18e76 Fix refactoro, clang-cc wasn't properly reporting errors when opening an output file failed.
llvm-svn: 89502
2009-11-20 22:32:38 +00:00
Daniel Dunbar 4274685b63 Pass '-mcpu' 'FOO' instead of '-mcpu=FOO'.
llvm-svn: 89498
2009-11-20 22:21:52 +00:00
Daniel Dunbar 8bed86c43e Standardize Driver translation to call clang-cc using '-foo' form instead of '--foo'.
llvm-svn: 89497
2009-11-20 22:21:36 +00:00
Douglas Gregor a25d65d1b6 Implement C++ [basic.lookup.classref]p3, which states how the type
name 'T' is looked up in the expression

  t.~T()

Previously, we weren't looking into the type of "t", and therefore
would fail when T actually referred to an injected-class-name. Fixes
PR5530.

llvm-svn: 89493
2009-11-20 22:03:38 +00:00
Douglas Gregor e4f764f013 When checking the base object of a member access expression (b.foo,
b->foo), don't look through pointers unless we have an -> operator.

llvm-svn: 89480
2009-11-20 19:58:21 +00:00
Douglas Gregor 51c538bee4 Teach FixOverloadedFunctionReference to build new expression ASTs rather
than tweaking existing ASTs, since we were (*gasp*) stomping on ASTs
within templates. I'm glad we found this little stick of TNT early...

llvm-svn: 89475
2009-11-20 19:42:02 +00:00
Anders Carlsson 0a66c26191 Fix lifetime of conditional temporaries. Patch by Victor Zverovich!
llvm-svn: 89467
2009-11-20 17:27:56 +00:00
Daniel Dunbar 69fd86dd44 Add clang -cc1 parsing of CodeGenOptions.
llvm-svn: 89464
2009-11-20 17:23:30 +00:00
Ken Dyck 33211d9658 Avoid unwanted expansion in macros that paste together INT<n>_C(v) and
UINT<n>_C(v) macros. 

llvm-svn: 89461
2009-11-20 16:49:10 +00:00
Ken Dyck 8dcc21420b Avoid unwanted expansion in macros that paste together INT<n>_MIN, INT<n>_MAX,
and UINT<n>_MAX defintions.

llvm-svn: 89460
2009-11-20 16:44:38 +00:00
Ken Dyck 764a5f3881 Avoid unwanted macro expansion in macros that paste together int<n>_t and
uint<n>_t definitions.

llvm-svn: 89459
2009-11-20 16:37:35 +00:00
David Chisnall bc8bdea183 Fixed crash when using undefined protocols (GNU runtime).
llvm-svn: 89457
2009-11-20 14:50:59 +00:00
Benjamin Kramer 7d875c7e7e Fix typo GCC 4.3 warned about.
llvm-svn: 89453
2009-11-20 10:03:00 +00:00
Eli Friedman 564048e692 Fix a couple minor memory leaks.
llvm-svn: 89450
2009-11-20 05:53:06 +00:00
Ted Kremenek a4f7c180ae Add simple static analyzer checker to check for sending 'release', 'retain', etc. directly to a class. Fixes <rdar://problem/7252064>.
llvm-svn: 89449
2009-11-20 05:27:05 +00:00
Ted Kremenek c1f161c012 Unused ivar checker: ivars referenced by lexically nested functions should not be flagged as unused. Fixes <rdar://problem/7254495>.
llvm-svn: 89448
2009-11-20 04:31:57 +00:00
Zhongxing Xu ab0ae2139a Revert r89437 and add a comment.
llvm-svn: 89446
2009-11-20 03:50:46 +00:00
Mike Stump d8d26d06a5 Implement throw d, where d is a class type that requires copy
construction.  WIP.

llvm-svn: 89442
2009-11-20 02:31:07 +00:00
Douglas Gregor 3153da7154 Don't build an explicit conversion to a reference type
llvm-svn: 89441
2009-11-20 02:31:03 +00:00
Mike Stump 4d7a07bdaf Handle throw d, where d is a class type but only has a trivial copy
constructor.  WIP.

llvm-svn: 89438
2009-11-20 01:57:39 +00:00
Zhongxing Xu 6d9a942174 It's unnecessary to check for unknown at this point.
llvm-svn: 89437
2009-11-20 01:56:48 +00:00
Daniel Dunbar f7535121a2 Driver: Add parsing for TargetOptions to CompilerInvocation::CreateFromArgs.
llvm-svn: 89435
2009-11-20 01:46:44 +00:00
Douglas Gregor ee9067c51f When we have a non-dependent expression such as
A::f

that occurs within a non-static member function with a type-dependent
"this", don't consider this to be a case for introduction of an
implicit "(*this)." to refer to a specific member function unless we
know (at template definition time) that A is a base class of *this.

There is some disagreement here between GCC, EDG, and Clang about the
handling of this case. I believe that Clang now has the correct,
literal interpretation of the standard, but have asked for
clarification (c++std-core-15483).

llvm-svn: 89425
2009-11-20 00:59:20 +00:00
Mike Stump d1782cc478 Add suport for throw;. WIP.
llvm-svn: 89424
2009-11-20 00:56:31 +00:00
Mike Stump 18fc44dfd3 Fix rtti generation for throws. WIP.
llvm-svn: 89420
2009-11-20 00:43:57 +00:00