Fariborz Jahanian
28c5a8ba4a
Adds synthesize ivars to DeclContext.
...
llvm-svn: 73000
2009-06-06 16:36:41 +00:00
Anders Carlsson
8544647e9c
Make ParmVarDecl::getDefaultArg() more robust, it now asserts that the argument is not unparsed. Add a new hasDefaultArg() and use it in places where getDefaultArg() was called when the argument was unparsed.
...
llvm-svn: 72984
2009-06-06 04:14:07 +00:00
Eli Friedman
2696b1e25e
Default builtin creation to off; we don't really want to be doing it
...
without a relevant source location anyway. Fixes the issue with weird
warnings when including objc/Object.h on OS X.
llvm-svn: 72978
2009-06-06 02:08:44 +00:00
Fariborz Jahanian
6845383426
Use of DeclContext for objc's ivars. No functionality
...
change. More to follow.
llvm-svn: 72951
2009-06-05 18:16:35 +00:00
Anders Carlsson
b3d05d6d11
Improvements to CXXExprWithTemporaries in preparation for fixing a bug with default arguments that have temporaries.
...
llvm-svn: 72944
2009-06-05 15:38:08 +00:00
Eli Friedman
302c4e1683
Address review comments for #pragma weak.
...
llvm-svn: 72926
2009-06-05 06:28:29 +00:00
Anders Carlsson
184cb4123e
Make TemplateArgumentListBuilder take an ASTContext (because we're probably going to need it later). Move push_back to the .cpp file. If the passed in template argument is a type, assert that it's canonical.
...
llvm-svn: 72918
2009-06-05 05:31:27 +00:00
Anders Carlsson
c8e7113a9f
Make the TemplateArgumentList take a TemplateArgumentListBuilder.
...
llvm-svn: 72917
2009-06-05 04:47:51 +00:00
Anders Carlsson
1b28c3efe2
Change the specialization decls to take a TemplateArgumentListBuilder.
...
llvm-svn: 72916
2009-06-05 04:06:48 +00:00
Anders Carlsson
8aa89d4049
Add a helper class for building template argument lists.
...
llvm-svn: 72915
2009-06-05 03:43:12 +00:00
Anders Carlsson
03c9e87410
Fix another crash and actually make the test case work.
...
llvm-svn: 72913
2009-06-05 02:45:24 +00:00
Eli Friedman
5ed5198a5a
Start of a Sema implementation for #pragma weak. This isn't really the
...
right approach, but I'm still not sure what the best way to go about this is.
llvm-svn: 72912
2009-06-05 02:44:36 +00:00
Anders Carlsson
dd096d888b
Fix a case when the TemplateArgs vector can be empty.
...
llvm-svn: 72911
2009-06-05 02:12:32 +00:00
Douglas Gregor
b7ae10f764
Several improvements to template argument deduction:
...
- Once we have deduced template arguments for a class template partial
specialization, we use exactly those template arguments for instantiating
the definition of the class template partial specialization.
- Added template argument deduction for non-type template parameters.
- Added template argument deduction for dependently-sized array types.
With these changes, we can now implement, e.g., the remove_reference
type trait. Also, Daniel's Ackermann template metaprogram now compiles
properly.
llvm-svn: 72909
2009-06-05 00:53:49 +00:00
Eli Friedman
319ce956a9
Fix up this compatibility hack to be more compatible with gcc.
...
llvm-svn: 72901
2009-06-04 23:03:07 +00:00
Fariborz Jahanian
7dae11446f
More refactoring/cleanup of objc ivars.
...
llvm-svn: 72871
2009-06-04 17:08:55 +00:00
Anders Carlsson
35533d11b3
Template argument deduction for incomplete and constant array types. Doug, please review.
...
llvm-svn: 72844
2009-06-04 04:11:30 +00:00
Anders Carlsson
8936009a91
Make sure to call FullExpr before parsing anything else.
...
llvm-svn: 72834
2009-06-04 02:18:15 +00:00
Douglas Gregor
5cdac0a52e
Template argument deduction for references
...
llvm-svn: 72822
2009-06-04 00:21:18 +00:00
Douglas Gregor
55ca8f6443
When performing template argument deduction, ensure that multiple
...
deductions of the same template parameter are equivalent. This allows
us to implement the is_same type trait (!).
Also, move template argument deduction into its own file and update a
few build systems with this change (grrrr).
llvm-svn: 72819
2009-06-04 00:03:07 +00:00
Eli Friedman
aef810900a
Minor cleanup for implicit int warnings.
...
llvm-svn: 72770
2009-06-03 12:22:01 +00:00
Argyrios Kyrtzidis
b1d51aa18a
Use "()" instead of "(void)" when pretty-printing a parameter-less function type for C++.
...
llvm-svn: 72747
2009-06-03 02:06:50 +00:00
Eli Friedman
9baa191f31
PR4142: Add %m format string specifier.
...
llvm-svn: 72726
2009-06-02 08:36:19 +00:00
Eli Friedman
fcbf7d2baf
PR4287: allow a variadic prototype to make a subsequent K&R style
...
definition variadic. I'm not completely sure it's legal, but the
standard can be interpreted as making it legal, and gcc seems to think
it's legal, so I didn't add an extension warning.
llvm-svn: 72689
2009-06-01 09:24:59 +00:00
Anders Carlsson
6f9dabff6d
Make sure to copy back arguments that can be changed by FindAllocationOverload. This fixes placement new. (Sebastian, please review).
...
llvm-svn: 72673
2009-05-31 20:26:12 +00:00
Anders Carlsson
2418712039
Fix an off by one error when trying to perform copy initialization of operator new and operator delete arguments. Sebastian, please review.
...
llvm-svn: 72670
2009-05-31 19:49:47 +00:00
Chris Lattner
6e127a6d86
Downgrade an error about "return in a no-return function" from being
...
an error to being a warning that defaults to error. If you want this to
be a warning, you have to explicitly pass -Winvalid-noreturn to clang to
map it back to a warning.
llvm-svn: 72669
2009-05-31 19:32:13 +00:00
Sebastian Redl
fb3f1794e1
Disallow exception specs on typedefs.
...
llvm-svn: 72664
2009-05-31 11:47:27 +00:00
Eli Friedman
42a8465518
Fix for PR4285: allow intializing a const wchar_t array with a wide
...
string.
llvm-svn: 72663
2009-05-31 10:54:53 +00:00
Douglas Gregor
2373c599b5
Initial infrastructure for class template partial specialization. Here
...
we have the basics of declaring and storing class template partial
specializations, matching class template partial specializations at
instantiation time via (limited) template argument deduction, and
using the class template partial specialization's pattern for
instantiation.
This patch is enough to make a simple is_pointer type trait work, but
not much else.
llvm-svn: 72662
2009-05-31 09:31:02 +00:00
Anders Carlsson
feefce601f
Forgot the implementation. Thanks Eli.
...
llvm-svn: 72647
2009-05-30 22:51:20 +00:00
Anders Carlsson
777711ba0b
Add RemoveOutermostTemporaryBinding. Not used yet.
...
llvm-svn: 72644
2009-05-30 22:47:03 +00:00
Anders Carlsson
73b836bf3d
Clean up the newly added C++ AST nodes.
...
llvm-svn: 72643
2009-05-30 22:38:53 +00:00
Anders Carlsson
a524f6fce6
It's OK for a full expr to be null. This fixes the failing test cases.
...
llvm-svn: 72642
2009-05-30 22:24:16 +00:00
Anders Carlsson
5de832ecfa
ActOnReturnStmt should also take a FullExprArg.
...
llvm-svn: 72641
2009-05-30 21:42:34 +00:00
Anders Carlsson
5e9444f541
AddInitializerToDecl needs to take a full expression.
...
llvm-svn: 72640
2009-05-30 21:37:25 +00:00
Anders Carlsson
c78576e250
Add the newly created temporary to the ExprTemporaries stack.
...
llvm-svn: 72638
2009-05-30 21:21:49 +00:00
Anders Carlsson
a29ded9ba8
Stop using CXXTempVarDecl and use CXXTemporary instead.
...
llvm-svn: 72634
2009-05-30 21:05:25 +00:00
Anders Carlsson
4b2434da54
Remove VarDecl from CXXConstructExpr.
...
llvm-svn: 72633
2009-05-30 20:56:46 +00:00
Anders Carlsson
b228818554
Bind temporaries correctly when instantiating expressions.
...
llvm-svn: 72632
2009-05-30 20:52:37 +00:00
Anders Carlsson
28486d420b
Remove VarDecl from CheckInitializerTypes now that CXXConstructExpr doesn't need to take a VarDecl anymore. (It still does, but it won't for long)
...
llvm-svn: 72630
2009-05-30 20:41:30 +00:00
Anders Carlsson
2d4cada7f7
Add Sema::MaybeBindToTemporary which takes an expression and (if needed) wraps it in a CXXBindTemporaryExpr. Use this when creating CXXTemporaryObjectExprs.
...
llvm-svn: 72629
2009-05-30 20:36:53 +00:00
Anders Carlsson
993a4b3080
Add a CXXBindTemporaryExpr.
...
llvm-svn: 72627
2009-05-30 20:03:25 +00:00
Anders Carlsson
36b75a4619
Replace a cast with a dyn_cast as suggested by Doug.
...
llvm-svn: 72624
2009-05-30 17:26:39 +00:00
Douglas Gregor
182319375a
Pretty printing and improved representation for namespace alias declarations
...
llvm-svn: 72616
2009-05-30 06:48:27 +00:00
Douglas Gregor
3bc6e4c72a
Printing for using directives, e.g.,
...
using namespace std::debug;
Extended UsingDirectiveDecl to store the nested-name-specifier that
precedes the nominated namespace.
llvm-svn: 72614
2009-05-30 06:31:56 +00:00
Anders Carlsson
65d5820892
Add a member lookup criteria constructor for searching for overridden virtual member functions. Use this instead of regular name lookup when checking for overriding functions so we will see declarations that would otherwise be hidden. Fixes 6902298.
...
llvm-svn: 72601
2009-05-30 00:52:53 +00:00
Douglas Gregor
278f52ec29
Refactor and clean up the AST printer, so that it uses a DeclVisitor,
...
walks through DeclContexts properly, and prints more of the
information available in the AST. The functionality is still available
via -ast-print, -ast-dump, etc., and also via the new member functions
Decl::dump() and Decl::print().
llvm-svn: 72597
2009-05-30 00:08:05 +00:00
Anders Carlsson
01bcef4a17
Make the LookupBase boolean an enum instead.
...
llvm-svn: 72594
2009-05-29 23:42:05 +00:00
Douglas Gregor
7de5966d76
Create a new PrintingPolicy class, which we pass down through the AST
...
printing logic to help customize the output. For now, we use this
rather than a special flag to suppress the "struct" when printing
"struct X" and to print the Boolean type as "bool" in C++ but "_Bool"
in C.
llvm-svn: 72590
2009-05-29 20:38:28 +00:00