Argyrios Kyrtzidis
e3d025995c
Introduce DeclContext::getParentASTContext().
...
It's not getASTContext() to avoid "getASTContext is ambiguous" compiler errors for subclasses of both Decl and DeclContext.
llvm-svn: 74505
2009-06-30 02:35:38 +00:00
Argyrios Kyrtzidis
ddcd132a5b
Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.
...
Timings showed no significant difference before and after the commit.
llvm-svn: 74504
2009-06-30 02:35:26 +00:00
Argyrios Kyrtzidis
8a803cc351
Remove the ASTContext parameter from the printing related methods of Decl.
...
llvm-svn: 74503
2009-06-30 02:35:04 +00:00
Argyrios Kyrtzidis
4e1a72b37b
Decl::getTranslationUnitDecl() should return itself when the Decl is a TranslationUnitDecl.
...
llvm-svn: 74502
2009-06-30 02:34:53 +00:00
Argyrios Kyrtzidis
b4b64ca752
Remove the ASTContext parameter from the attribute-related methods of Decl.
...
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.
This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.
llvm-svn: 74501
2009-06-30 02:34:44 +00:00
Chris Lattner
c61089a6c2
Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions.
...
This is simple enough, but then I thought it would be nice to make PrintingPolicy
get a LangOptions so that various things can key off "bool" and "C++" independently.
This spiraled out of control. There are many fixme's, but I think things are slightly
better than they were before.
One thing that can be improved: CFG should probably have an ASTContext pointer in it,
which would simplify its clients.
llvm-svn: 74493
2009-06-30 01:26:17 +00:00
Fariborz Jahanian
e853bfa970
Take care of Chris's comments.
...
llvm-svn: 74486
2009-06-30 00:17:27 +00:00
Anders Carlsson
124f34c150
Make an error message more clear.
...
llvm-svn: 74481
2009-06-30 00:06:57 +00:00
Fariborz Jahanian
651185bf47
A more detailed diagnosis of ill-formed ctor-initializer
...
list.
llvm-svn: 74480
2009-06-30 00:02:17 +00:00
Daniel Dunbar
86e35b3aba
Use true/false instead of 1/0.
...
llvm-svn: 74479
2009-06-29 23:58:47 +00:00
Anders Carlsson
074a18a8fd
Improvements to decltype. We now don't crash anymore when the expr is an overloaded function decl.
...
llvm-svn: 74472
2009-06-29 22:58:55 +00:00
Daniel Dunbar
302ab13b1a
Don't define __KPRINTF_ATTRIBUTE__ unconditionally on OpenBSD.
...
llvm-svn: 74467
2009-06-29 22:45:37 +00:00
Douglas Gregor
e8925dbc1d
Improve code generation for function template specializations:
...
- Track implicit instantiations vs. the not-yet-supported explicit
specializations
- Give implicit instantiations of function templates (and member
functions of class templates) linkonce_odr linkage.
- Improve name mangling for function template specializations,
including the template arguments of the instantiation and the return
type of the function.
Note that our name-mangling is improved, but not correct: we still
don't mangle substitutions, although the manglings we produce can be
demangled.
llvm-svn: 74466
2009-06-29 22:39:32 +00:00
Fariborz Jahanian
2be8bf44cd
Diagnose multiple initialzation of data-member/base
...
in the ctor-initializer list. More to come.
llvm-svn: 74465
2009-06-29 22:33:26 +00:00
Anders Carlsson
d7a1bc4466
Remove some dead code
...
llvm-svn: 74460
2009-06-29 21:39:57 +00:00
Douglas Gregor
8f5d4423ca
Keep track of function template specializations, to eliminate
...
redundant, implicit instantiations of function templates and provide a
place where we can hang function template specializations.
llvm-svn: 74454
2009-06-29 20:59:39 +00:00
Daniel Dunbar
10de9e6602
OpenBSD support.
...
- Patch by Jonathan Gray!
llvm-svn: 74453
2009-06-29 20:52:51 +00:00
Argyrios Kyrtzidis
743e7db794
-Keep a reference to the ASTContext inside the TranslationUnitDecl.
...
-Introduce Decl::getASTContext() which returns the reference from the TranslationUnitDecl that it is contained in.
The general idea is that Decls can point to their own ASTContext so that it is no longer required to "manually" keep track and make sure that you pass the correct ASTContext to Decls' methods, e.g. methods like Decl::getAttrs should eventually not require a ASTContext parameter.
llvm-svn: 74434
2009-06-29 17:38:40 +00:00
Argyrios Kyrtzidis
3cfb28a68d
Remove redundant leftover code.
...
llvm-svn: 74433
2009-06-29 17:38:09 +00:00
Chris Lattner
e4edb8e818
Fix the FloatingLiteral API to take the isexact flag by value instead of
...
by pointer.
llvm-svn: 74432
2009-06-29 17:34:55 +00:00
Douglas Gregor
70d83e27a4
Move FunctionDecl::TemplateSpecializationInfo out into its own class,
...
FunctionTemplateSpecializationInfo, in DeclTemplate.h. No functionality change.
llvm-svn: 74431
2009-06-29 17:30:29 +00:00
Steve Naroff
8d9cc9ebc1
Remove ASTContext::getObjCQualifiedIdType().
...
Convert clients to use ASTContext::getObjCObjectPointerType().
llvm-svn: 74424
2009-06-29 16:22:52 +00:00
Zhongxing Xu
4744d560b8
Invalidate the alloca region by setting its default value to conjured symbol.
...
llvm-svn: 74419
2009-06-29 06:43:40 +00:00
Zhongxing Xu
25d710ee50
The default answer for isBoundable() should be false.
...
llvm-svn: 74418
2009-06-29 05:44:14 +00:00
Bill Wendling
1835107ed0
Make the StackProtector bitfield use enums instead of obscure numbers.
...
llvm-svn: 74414
2009-06-28 23:01:01 +00:00
Anders Carlsson
b012ca92ac
Move the check for vprintf* functions inside of SemaCheckStringLiteral. Fixes PR4470.
...
llvm-svn: 74413
2009-06-28 19:55:58 +00:00
Chris Lattner
877a48e67a
make these tests pass with the stack canary stuff even on targets where they default to on.
...
llvm-svn: 74412
2009-06-28 19:49:49 +00:00
Nate Begeman
886448d694
Fix incorrect AST's being produced, noticed by Eli.
...
The issue this was working around is no longer present in TOT clang.
llvm-svn: 74411
2009-06-28 19:12:57 +00:00
Zhongxing Xu
55e070031f
Now this test case passes.
...
llvm-svn: 74410
2009-06-28 14:25:10 +00:00
Zhongxing Xu
0628f539a8
Adjust retrieve handler priority. If a field is of array type, it should be
...
handled by RetrieveArray().
llvm-svn: 74409
2009-06-28 14:16:39 +00:00
Zhongxing Xu
6f610707cf
Invalidate a field of struct type by setting its default value to conjured
...
symbol.
llvm-svn: 74408
2009-06-28 13:59:24 +00:00
Zhongxing Xu
d260db1238
Do not crash on binding concrete integer location.
...
llvm-svn: 74407
2009-06-28 10:16:11 +00:00
Zhongxing Xu
f7a6de3a12
Simplify some code. As in region store, we always expect the location is a
...
memregion.
llvm-svn: 74406
2009-06-28 09:26:15 +00:00
Bill Wendling
d63bbadbef
Add stack protector support to clang. This generates the 'ssp' and 'sspreq'
...
function attributes. There are predefined macros that are defined when stack
protectors are used: __SSP__=1 with -fstack-protector and __SSP_ALL__=2 with
-fstack-protector-all.
llvm-svn: 74405
2009-06-28 07:36:13 +00:00
Nate Begeman
bd956c4290
OpenCL 1.0 support:
...
Handle rules for ExtVector + ExtVector and ExtVector + Scalar operations.
Fix problem Eli noticed where we were allowing pointer types to be splatted to
vector elements.
llvm-svn: 74404
2009-06-28 02:36:38 +00:00
Nate Begeman
c8961a424d
Implement feedback from Eli re: the purpose of lax vector conversions
...
llvm-svn: 74397
2009-06-27 22:05:55 +00:00
Douglas Gregor
15448f8d23
Improve support for overloaded operator templates.
...
llvm-svn: 74390
2009-06-27 21:05:07 +00:00
Eli Friedman
5e774b1333
Fix the parser error hanlding for __builtin_offsetof to actually print
...
out an error for a malformed __builtin_offsetof.
llvm-svn: 74388
2009-06-27 20:38:33 +00:00
Douglas Gregor
0799d916e1
Add a Last Updated field to the C++ status page
...
llvm-svn: 74387
2009-06-27 19:33:58 +00:00
Fariborz Jahanian
3fe6b61b23
Renamed MarcDestructorReferenced -> MarkDestructorReferenced
...
llvm-svn: 74386
2009-06-27 15:05:11 +00:00
Eli Friedman
d95e1cda9e
Fix screwup with my previous patch which broke tests. (The patch is
...
making sure we return true when annotating a function template with
explicit template arguments, but not when we don't annotate anything.)
llvm-svn: 74383
2009-06-27 08:17:02 +00:00
Eli Friedman
9fe1bb40ae
Fix a crash with constructs like x<false>() in C++. No testcase because
...
it doesn't actually work yet; we just error out a bit more gracefully.
llvm-svn: 74381
2009-06-27 06:24:06 +00:00
Eli Friedman
173e0b7a96
Fix a bogus error overloading an operator where the only class
...
parameter has a dependent type.
llvm-svn: 74380
2009-06-27 05:59:59 +00:00
Anders Carlsson
f0a7f3b089
Implement support for the format_arg attribute. Fixes PR4442.
...
llvm-svn: 74369
2009-06-27 04:05:33 +00:00
Anders Carlsson
74d7f0dd65
Make it possible for using decls to point to operators. Fixes PR4441.
...
llvm-svn: 74362
2009-06-27 00:27:47 +00:00
Ted Kremenek
8e5f6951eb
Remove the last 'GetXXX' methods from GRStateManager.
...
llvm-svn: 74361
2009-06-27 00:24:54 +00:00
Douglas Gregor
1e880602ad
Make a note of improvements to function templates
...
llvm-svn: 74360
2009-06-27 00:08:54 +00:00
Fariborz Jahanian
24a175b37c
Patch to mark destructors when they are used.
...
llvm-svn: 74359
2009-06-26 23:49:16 +00:00
Anders Carlsson
bae2737202
Fix test.
...
llvm-svn: 74358
2009-06-26 23:44:14 +00:00
Douglas Gregor
fc516c93c1
Set the rest of the flags we need to perform template argument
...
deduction using a base class of the argument type. No actual
functionality change; this is just a hook.
llvm-svn: 74356
2009-06-26 23:27:24 +00:00