]> granicus.if.org Git - clang/log
clang
15 years agoOpenBSD support.
Daniel Dunbar [Mon, 29 Jun 2009 20:52:51 +0000 (20:52 +0000)]
OpenBSD support.
 - Patch by Jonathan Gray!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74453 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago-Keep a reference to the ASTContext inside the TranslationUnitDecl.
Argyrios Kyrtzidis [Mon, 29 Jun 2009 17:38:40 +0000 (17:38 +0000)]
-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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74434 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove redundant leftover code.
Argyrios Kyrtzidis [Mon, 29 Jun 2009 17:38:09 +0000 (17:38 +0000)]
Remove redundant leftover code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74433 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix the FloatingLiteral API to take the isexact flag by value instead of
Chris Lattner [Mon, 29 Jun 2009 17:34:55 +0000 (17:34 +0000)]
Fix the FloatingLiteral API to take the isexact flag by value instead of
by pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74432 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove FunctionDecl::TemplateSpecializationInfo out into its own class,
Douglas Gregor [Mon, 29 Jun 2009 17:30:29 +0000 (17:30 +0000)]
Move FunctionDecl::TemplateSpecializationInfo out into its own class,
FunctionTemplateSpecializationInfo, in DeclTemplate.h. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74431 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove ASTContext::getObjCQualifiedIdType().
Steve Naroff [Mon, 29 Jun 2009 16:22:52 +0000 (16:22 +0000)]
Remove ASTContext::getObjCQualifiedIdType().
Convert clients to use ASTContext::getObjCObjectPointerType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74424 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInvalidate the alloca region by setting its default value to conjured symbol.
Zhongxing Xu [Mon, 29 Jun 2009 06:43:40 +0000 (06:43 +0000)]
Invalidate the alloca region by setting its default value to conjured symbol.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74419 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThe default answer for isBoundable() should be false.
Zhongxing Xu [Mon, 29 Jun 2009 05:44:14 +0000 (05:44 +0000)]
The default answer for isBoundable() should be false.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74418 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake the StackProtector bitfield use enums instead of obscure numbers.
Bill Wendling [Sun, 28 Jun 2009 23:01:01 +0000 (23:01 +0000)]
Make the StackProtector bitfield use enums instead of obscure numbers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74414 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove the check for vprintf* functions inside of SemaCheckStringLiteral. Fixes PR4470.
Anders Carlsson [Sun, 28 Jun 2009 19:55:58 +0000 (19:55 +0000)]
Move the check for vprintf* functions inside of SemaCheckStringLiteral. Fixes PR4470.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74413 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake these tests pass with the stack canary stuff even on targets where they default...
Chris Lattner [Sun, 28 Jun 2009 19:49:49 +0000 (19:49 +0000)]
make these tests pass with the stack canary stuff even on targets where they default to on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74412 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix incorrect AST's being produced, noticed by Eli.
Nate Begeman [Sun, 28 Jun 2009 19:12:57 +0000 (19:12 +0000)]
Fix incorrect AST's being produced, noticed by Eli.
The issue this was working around is no longer present in TOT clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74411 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoNow this test case passes.
Zhongxing Xu [Sun, 28 Jun 2009 14:25:10 +0000 (14:25 +0000)]
Now this test case passes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74410 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdjust retrieve handler priority. If a field is of array type, it should be
Zhongxing Xu [Sun, 28 Jun 2009 14:16:39 +0000 (14:16 +0000)]
Adjust retrieve handler priority. If a field is of array type, it should be
handled by RetrieveArray().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74409 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInvalidate a field of struct type by setting its default value to conjured
Zhongxing Xu [Sun, 28 Jun 2009 13:59:24 +0000 (13:59 +0000)]
Invalidate a field of struct type by setting its default value to conjured
symbol.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74408 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDo not crash on binding concrete integer location.
Zhongxing Xu [Sun, 28 Jun 2009 10:16:11 +0000 (10:16 +0000)]
Do not crash on binding concrete integer location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74407 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSimplify some code. As in region store, we always expect the location is a
Zhongxing Xu [Sun, 28 Jun 2009 09:26:15 +0000 (09:26 +0000)]
Simplify some code. As in region store, we always expect the location is a
memregion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74406 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd stack protector support to clang. This generates the 'ssp' and 'sspreq'
Bill Wendling [Sun, 28 Jun 2009 07:36:13 +0000 (07:36 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74405 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOpenCL 1.0 support:
Nate Begeman [Sun, 28 Jun 2009 02:36:38 +0000 (02:36 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74404 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement feedback from Eli re: the purpose of lax vector conversions
Nate Begeman [Sat, 27 Jun 2009 22:05:55 +0000 (22:05 +0000)]
Implement feedback from Eli re: the purpose of lax vector conversions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74397 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImprove support for overloaded operator templates.
Douglas Gregor [Sat, 27 Jun 2009 21:05:07 +0000 (21:05 +0000)]
Improve support for overloaded operator templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74390 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix the parser error hanlding for __builtin_offsetof to actually print
Eli Friedman [Sat, 27 Jun 2009 20:38:33 +0000 (20:38 +0000)]
Fix the parser error hanlding for __builtin_offsetof to actually print
out an error for a malformed __builtin_offsetof.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74388 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a Last Updated field to the C++ status page
Douglas Gregor [Sat, 27 Jun 2009 19:33:58 +0000 (19:33 +0000)]
Add a Last Updated field to the C++ status page

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74387 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRenamed MarcDestructorReferenced -> MarkDestructorReferenced
Fariborz Jahanian [Sat, 27 Jun 2009 15:05:11 +0000 (15:05 +0000)]
Renamed MarcDestructorReferenced -> MarkDestructorReferenced

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74386 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix screwup with my previous patch which broke tests. (The patch is
Eli Friedman [Sat, 27 Jun 2009 08:17:02 +0000 (08:17 +0000)]
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.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74383 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix a crash with constructs like x<false>() in C++. No testcase because
Eli Friedman [Sat, 27 Jun 2009 06:24:06 +0000 (06:24 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74381 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix a bogus error overloading an operator where the only class
Eli Friedman [Sat, 27 Jun 2009 05:59:59 +0000 (05:59 +0000)]
Fix a bogus error overloading an operator where the only class
parameter has a dependent type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74380 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement support for the format_arg attribute. Fixes PR4442.
Anders Carlsson [Sat, 27 Jun 2009 04:05:33 +0000 (04:05 +0000)]
Implement support for the format_arg attribute. Fixes PR4442.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74369 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake it possible for using decls to point to operators. Fixes PR4441.
Anders Carlsson [Sat, 27 Jun 2009 00:27:47 +0000 (00:27 +0000)]
Make it possible for using decls to point to operators. Fixes PR4441.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74362 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove the last 'GetXXX' methods from GRStateManager.
Ted Kremenek [Sat, 27 Jun 2009 00:24:54 +0000 (00:24 +0000)]
Remove the last 'GetXXX' methods from GRStateManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74361 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake a note of improvements to function templates
Douglas Gregor [Sat, 27 Jun 2009 00:08:54 +0000 (00:08 +0000)]
Make a note of improvements to function templates

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74360 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPatch to mark destructors when they are used.
Fariborz Jahanian [Fri, 26 Jun 2009 23:49:16 +0000 (23:49 +0000)]
Patch to mark destructors when they are used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74359 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix test.
Anders Carlsson [Fri, 26 Jun 2009 23:44:14 +0000 (23:44 +0000)]
Fix test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74358 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSet the rest of the flags we need to perform template argument
Douglas Gregor [Fri, 26 Jun 2009 23:27:24 +0000 (23:27 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74356 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDuring template argument deduction from a function call, allow
Douglas Gregor [Fri, 26 Jun 2009 23:10:12 +0000 (23:10 +0000)]
During template argument deduction from a function call, allow
deduction from pointer and pointer-to-member types to work even in the
presence of a qualification conversion (C++ [temp.deduct.type]p3
bullet 2).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74354 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore auto work.
Anders Carlsson [Fri, 26 Jun 2009 22:18:59 +0000 (22:18 +0000)]
More auto work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74339 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix test.
Anders Carlsson [Fri, 26 Jun 2009 21:54:43 +0000 (21:54 +0000)]
Fix test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74335 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoA little template argument deduction test uncovered an "oops". As part
Douglas Gregor [Fri, 26 Jun 2009 21:40:05 +0000 (21:40 +0000)]
A little template argument deduction test uncovered an "oops". As part
of template instantiation, we were dropping cv-qualifiers on the
instantiated type in a few places. This change reshuffles the
type-instantiation code a little bit so that there's a single place
where we add qualifiers to the instantiated type, so that we won't end
up with this same bug in the future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74331 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOpenCL 1.0 Support: fix a bug with lvalue swizzles
Nate Begeman [Fri, 26 Jun 2009 21:12:50 +0000 (21:12 +0000)]
OpenCL 1.0 Support: fix a bug with lvalue swizzles

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74324 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTemplate argument deduction is no longer responsible for checking
Douglas Gregor [Fri, 26 Jun 2009 20:57:09 +0000 (20:57 +0000)]
Template argument deduction is no longer responsible for checking
non-dependent parameter types. Instead, class template partial
specializations perform a final check of all of the instantiated
arguments. This model is cleaner, and works better for function
templates where the "final check" occurs during overload resolution.

Also, cope with cv-qualifiers when the parameter type was originally a
reference type, so that the deduced argument can be more qualified
than the transformed argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74323 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCan't have arrays of auto.
Anders Carlsson [Fri, 26 Jun 2009 19:33:28 +0000 (19:33 +0000)]
Can't have arrays of auto.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74314 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAn auto variable can't appear in its own initializer.
Anders Carlsson [Fri, 26 Jun 2009 19:16:07 +0000 (19:16 +0000)]
An auto variable can't appear in its own initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74312 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement enough of the 'auto' keyword so we can claim to support N2546.
Anders Carlsson [Fri, 26 Jun 2009 18:41:36 +0000 (18:41 +0000)]
Implement enough of the 'auto' keyword so we can claim to support N2546.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74307 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agotypo
Devang Patel [Fri, 26 Jun 2009 18:33:42 +0000 (18:33 +0000)]
typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74305 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevrt PR4228 fix for now.
Devang Patel [Fri, 26 Jun 2009 18:32:22 +0000 (18:32 +0000)]
Revrt PR4228 fix for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74304 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSimplify, and fix a possible crash (never happens however, because we don't ever
Daniel Dunbar [Fri, 26 Jun 2009 18:32:06 +0000 (18:32 +0000)]
Simplify, and fix a possible crash (never happens however, because we don't ever
take this path with non-builtin floating point types).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74303 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix bar title in graphs.
Daniel Dunbar [Fri, 26 Jun 2009 18:29:52 +0000 (18:29 +0000)]
Fix bar title in graphs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74302 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImprove template argument deduction for reference parameters when
Douglas Gregor [Fri, 26 Jun 2009 18:27:22 +0000 (18:27 +0000)]
Improve template argument deduction for reference parameters when
deducing template arguments from a function call. Plus, add a bunch of
tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74301 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOpenCL 1.0 Support:
Nate Begeman [Fri, 26 Jun 2009 18:22:18 +0000 (18:22 +0000)]
OpenCL 1.0 Support:
Add support for scalar to vector and partially initialized vector constant initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74299 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate performance numbers (missed a link)
Daniel Dunbar [Fri, 26 Jun 2009 18:15:47 +0000 (18:15 +0000)]
Update performance numbers (missed a link)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74297 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate performance numbers.
Daniel Dunbar [Fri, 26 Jun 2009 18:14:41 +0000 (18:14 +0000)]
Update performance numbers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74296 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMinor change per Doug's comments.
Fariborz Jahanian [Fri, 26 Jun 2009 16:08:57 +0000 (16:08 +0000)]
Minor change per Doug's comments.
- Fariborz

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74287 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOpenCL 1.0 support: attributes
Nate Begeman [Fri, 26 Jun 2009 06:32:41 +0000 (06:32 +0000)]
OpenCL 1.0 support: attributes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74280 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd NamedDecl::getUnderlyingDecl that can see through UsingDecl and ObjCCompatibleAli...
Anders Carlsson [Fri, 26 Jun 2009 06:29:23 +0000 (06:29 +0000)]
Add NamedDecl::getUnderlyingDecl that can see through UsingDecl and ObjCCompatibleAliasDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74279 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSee through UsingDecls in more places.
Anders Carlsson [Fri, 26 Jun 2009 05:26:50 +0000 (05:26 +0000)]
See through UsingDecls in more places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74269 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix failing test.
Anders Carlsson [Fri, 26 Jun 2009 05:14:36 +0000 (05:14 +0000)]
Fix failing test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74268 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix build break.
Zhongxing Xu [Fri, 26 Jun 2009 05:13:13 +0000 (05:13 +0000)]
Fix build break.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74267 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImprove error recovery in C++: when we hit 'implicit int' cases in C++,
Chris Lattner [Fri, 26 Jun 2009 04:45:06 +0000 (04:45 +0000)]
Improve error recovery in C++: when we hit 'implicit int' cases in C++,
these are usually because the parser was thoroughly confused.  In addition
to typing the value being declared as an int and hoping for the best, we
mark the value as invalid so we don't get chains of errors when it is
used downstream.  In C, implicit int actually is valid, so typing the thing
as int is good and marking it invalid is bad. :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74266 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix PR4452, a crash on invalid. The error recovery is still terrible in this case
Chris Lattner [Fri, 26 Jun 2009 04:27:47 +0000 (04:27 +0000)]
fix PR4452, a crash on invalid.  The error recovery is still terrible in this case
but at least we don't crash :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74264 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agooink is dead.
Chris Lattner [Fri, 26 Jun 2009 04:10:17 +0000 (04:10 +0000)]
oink is dead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74263 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix another assert related to using decls.
Anders Carlsson [Fri, 26 Jun 2009 03:54:13 +0000 (03:54 +0000)]
Fix another assert related to using decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74262 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorearrange more code, this avoids a token lookahead for foo<
Chris Lattner [Fri, 26 Jun 2009 03:52:38 +0000 (03:52 +0000)]
rearrange more code, this avoids a token lookahead for foo<

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74261 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomove some code around, no functionality change.
Chris Lattner [Fri, 26 Jun 2009 03:47:46 +0000 (03:47 +0000)]
move some code around, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74260 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosimplify some code.
Chris Lattner [Fri, 26 Jun 2009 03:45:46 +0000 (03:45 +0000)]
simplify some code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74259 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen creating LookupResults, see through UsingDecls. Fixes PR4450.
Anders Carlsson [Fri, 26 Jun 2009 03:37:05 +0000 (03:37 +0000)]
When creating LookupResults, see through UsingDecls. Fixes PR4450.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74258 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR4448.
Anders Carlsson [Fri, 26 Jun 2009 03:02:18 +0000 (03:02 +0000)]
Fix PR4448.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74257 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOpenCL 1.0 support: explicit casts to ext-vector types
Nate Begeman [Fri, 26 Jun 2009 00:50:28 +0000 (00:50 +0000)]
OpenCL 1.0 support: explicit casts to ext-vector types

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74247 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove '#include <sstream>' from libAnalysis.
Ted Kremenek [Fri, 26 Jun 2009 00:43:22 +0000 (00:43 +0000)]
Remove '#include <sstream>' from libAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74245 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate method signature.
Ted Kremenek [Fri, 26 Jun 2009 00:41:43 +0000 (00:41 +0000)]
Update method signature.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74244 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUnbreak build.
Ted Kremenek [Fri, 26 Jun 2009 00:25:05 +0000 (00:25 +0000)]
Unbreak build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74238 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd missing header file.
Ted Kremenek [Fri, 26 Jun 2009 00:15:05 +0000 (00:15 +0000)]
Add missing header file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74233 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplicit instantiation for function template specializations.
Douglas Gregor [Fri, 26 Jun 2009 00:10:03 +0000 (00:10 +0000)]
Implicit instantiation for function template specializations.

For a FunctionDecl that has been instantiated due to template argument
deduction, we now store the primary template from which it was
instantiated and the deduced template arguments. From this
information, we can instantiate the body of the function template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74232 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove orphaned header file.
Ted Kremenek [Fri, 26 Jun 2009 00:08:20 +0000 (00:08 +0000)]
Remove orphaned header file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74231 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIntroduce a new concept to the static analyzer: SValuator.
Ted Kremenek [Fri, 26 Jun 2009 00:05:51 +0000 (00:05 +0000)]
Introduce a new concept to the static analyzer: SValuator.

GRTransferFuncs had the conflated role of both constructing SVals (symbolic
expressions) as well as handling checker-specific logic. Now SValuator has the
role of constructing SVals from expressions and GRTransferFuncs just handles
checker-specific logic. The motivation is by separating these two concepts we
will be able to much more easily create richer constraint-generating logic
without coupling it to the main checker transfer function logic.

We now have one implementation of SValuator: SimpleSValuator.

SimpleSValuator is essentially the SVal-related logic that was in GRSimpleVals
(which is removed in this patch). This includes the logic for EvalBinOp,
EvalCast, etc. Because SValuator has a narrower role than the old
GRTransferFuncs, the interfaces are much simpler, and so is the implementation
of SimpleSValuator compared to GRSimpleVals. I also did a line-by-line review of
SVal-related logic in GRSimpleVals and cleaned it up while moving it over to
SimpleSValuator.

As a consequence of removing GRSimpleVals, there is no longer a
'-checker-simple' option. The '-checker-cfref' did everything that option did
but also ran the retain/release checker. Of course a user may not always wish to
run the retain/release checker, nor do we wish core analysis logic buried in the
checker-specific logic. The next step is to refactor the logic in CFRefCount.cpp
to separate out these pieces into the core analysis engine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74229 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOpenCL 1.0 Support: support "bool, true, false" tokens when compiling for OpenCL
Nate Begeman [Thu, 25 Jun 2009 23:25:15 +0000 (23:25 +0000)]
OpenCL 1.0 Support: support "bool, true, false" tokens when compiling for OpenCL

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74224 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWrite/Read new Language Options
Nate Begeman [Thu, 25 Jun 2009 23:01:11 +0000 (23:01 +0000)]
Write/Read new Language Options

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74221 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPCH support for OpenCL language options
Nate Begeman [Thu, 25 Jun 2009 22:57:40 +0000 (22:57 +0000)]
PCH support for OpenCL language options

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74220 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOpenCL 1.0 patch 2/N: Language options & file extension
Nate Begeman [Thu, 25 Jun 2009 22:43:10 +0000 (22:43 +0000)]
OpenCL 1.0 patch 2/N: Language options & file extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74217 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTest case for my last patch.
Fariborz Jahanian [Thu, 25 Jun 2009 22:40:36 +0000 (22:40 +0000)]
Test case  for my last patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74216 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCheck that index-test uses an up-to-date AST file.
Argyrios Kyrtzidis [Thu, 25 Jun 2009 22:15:12 +0000 (22:15 +0000)]
Check that index-test uses an up-to-date AST file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74214 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImproved semantic analysis and AST respresentation for function
Douglas Gregor [Thu, 25 Jun 2009 22:08:12 +0000 (22:08 +0000)]
Improved semantic analysis and AST respresentation for function
templates.

For example, this now type-checks (but does not instantiate the body
of deref<int>):

  template<typename T> T& deref(T* t) { return *t; }

  void test(int *ip) {
    int &ir = deref(ip);
  }

Specific changes/additions:
  * Template argument deduction from a call to a function template.
  * Instantiation of a function template specializations (just the
  declarations) from the template arguments deduced from a call.
  * FunctionTemplateDecls are stored directly in declaration contexts
  and found via name lookup (all forms), rather than finding the
  FunctionDecl and then realizing it is a template. This is
  responsible for most of the churn, since some of the core
  declaration matching and lookup code assumes that all functions are
  FunctionDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74213 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd some comments and clean-up some leftover code.
Argyrios Kyrtzidis [Thu, 25 Jun 2009 21:54:50 +0000 (21:54 +0000)]
Add some comments and clean-up some leftover code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74207 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPatch to diagnose and Mark use of implicit default assignment operator.
Fariborz Jahanian [Thu, 25 Jun 2009 21:45:19 +0000 (21:45 +0000)]
Patch to diagnose and Mark use of implicit default assignment operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74205 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOpenCL 1.0 Support, patch 1/N: upper case swizzle operator and hex element index.
Nate Begeman [Thu, 25 Jun 2009 21:06:09 +0000 (21:06 +0000)]
OpenCL 1.0 Support, patch 1/N: upper case swizzle operator and hex element index.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74202 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIntroduce tools/index-test.
Argyrios Kyrtzidis [Thu, 25 Jun 2009 18:22:52 +0000 (18:22 +0000)]
Introduce tools/index-test.

This tool will be the test bed for indexing related operations. It basically reads PCH files passed by the command line and performs various operations.

Currently it can accept a file:line:column which resolves to a declaration/statement and displays some information about them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74198 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIntroduce the ResolveLocationInAST function which takes an ASTContext and a SourceLoc...
Argyrios Kyrtzidis [Thu, 25 Jun 2009 18:22:41 +0000 (18:22 +0000)]
Introduce the ResolveLocationInAST function which takes an ASTContext and a SourceLocation and it resolves it into a <Decl*, Stmt*> pair.

Decl* is the declaration associated with this source location and Stmt* is the statement/expression that the location points to.
If the location does not point to a statement node, Stmt* is null.

ResolveLocationInAST (along with converting a file:line:column triplet to a SourceLocation) will be useful for an IDE client and for clang's test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74197 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHandle PCHReader::IgnorePCH, it gets returned for when the file does not exist.
Argyrios Kyrtzidis [Thu, 25 Jun 2009 18:22:30 +0000 (18:22 +0000)]
Handle PCHReader::IgnorePCH, it gets returned for when the file does not exist.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74196 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSet the end range location of a FunctionDecl to the right paren.
Argyrios Kyrtzidis [Thu, 25 Jun 2009 18:22:24 +0000 (18:22 +0000)]
Set the end range location of a FunctionDecl to the right paren.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74195 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix column checking for SourceManager::getLocation().
Argyrios Kyrtzidis [Thu, 25 Jun 2009 18:22:16 +0000 (18:22 +0000)]
Fix column checking for SourceManager::getLocation().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74194 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove declaration for unused and unimplemented static method.
Ted Kremenek [Thu, 25 Jun 2009 17:25:49 +0000 (17:25 +0000)]
Remove declaration for unused and unimplemented static method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74182 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoExtra asserts never hurt anybody, right?
Anders Carlsson [Thu, 25 Jun 2009 16:06:43 +0000 (16:06 +0000)]
Extra asserts never hurt anybody, right?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74177 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDecltype needs to have a dependent type if the expr passed to it is type dependent...
Anders Carlsson [Thu, 25 Jun 2009 15:00:34 +0000 (15:00 +0000)]
Decltype needs to have a dependent type if the expr passed to it is type dependent. Fixes PR4444.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74175 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoExplicit braces to avoid ambiguous ‘else’.
Duncan Sands [Thu, 25 Jun 2009 09:03:06 +0000 (09:03 +0000)]
Explicit braces to avoid ambiguous ‘else’.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74171 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove RegionKills GDM. Now UnknownVal is bound to regions explicitly.
Zhongxing Xu [Thu, 25 Jun 2009 05:52:16 +0000 (05:52 +0000)]
remove RegionKills GDM. Now UnknownVal is bound to regions explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74168 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove element region retrieving logic into a separate function.
Zhongxing Xu [Thu, 25 Jun 2009 05:29:39 +0000 (05:29 +0000)]
Move element region retrieving logic into a separate function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74166 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake sure install Clang headers when building clang-cc
Douglas Gregor [Thu, 25 Jun 2009 05:07:31 +0000 (05:07 +0000)]
Make sure install Clang headers when building clang-cc

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74163 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd missing dependencies to the CMake build system
Douglas Gregor [Thu, 25 Jun 2009 05:03:29 +0000 (05:03 +0000)]
Add missing dependencies to the CMake build system

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74162 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove all logic for retrieving ElementRegion binding into a separate method.
Zhongxing Xu [Thu, 25 Jun 2009 04:50:44 +0000 (04:50 +0000)]
Move all logic for retrieving ElementRegion binding into a separate method.
Revert to setting default value approach for handling struct initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74160 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove uses of std::ostream from libAnalysis.
Ted Kremenek [Wed, 24 Jun 2009 23:06:47 +0000 (23:06 +0000)]
Remove uses of std::ostream from libAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74136 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove unneeded #includes.
Ted Kremenek [Wed, 24 Jun 2009 22:26:16 +0000 (22:26 +0000)]
Remove unneeded #includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74131 91177308-0d34-0410-b5e6-96231b3b80d8