Граф коммитов

1512 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek 00c0a30acd Do not create CFGs for functions/methods using blocks (need to add control-flow).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56672 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 18:17:07 +00:00
Chris Lattner 7a73940198 emulate a bit of GCC path lookup weirdness: if a system
directory is shadowed by a user directory in the lookup
path, ignore the user directory not the system one.  Not
doing this can affect file lookup and the "is a system
header" bit on locations.  For example:
  clang -v -I/usr/include inc.c -E | & grep /usr/inc
now prints:

# 1 "/usr/include/i386/_types.h" 1 3 4
# 37 "/usr/include/i386/_types.h" 3 4
# 70 "/usr/include/i386/_types.h" 3 4

instead of:

# 1 "/usr/include/i386/_types.h" 1
# 37 "/usr/include/i386/_types.h"
# 70 "/usr/include/i386/_types.h"

This is part of rdar://6243860.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56669 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 17:46:45 +00:00
Ted Kremenek 3527b59f24 Enter a new scope for a @try block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56668 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 17:32:47 +00:00
Ted Kremenek fcd06f77be Move VLA processing logic from LiveVariables to CFG construction. This way all dataflow analyses "see" the VLA size expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56655 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 16:26:36 +00:00
Steve Naroff 4f6a7d7ead Tweak Expr::isModifiableLvalue() and Expr::isLvalue() to better deal with BlockDeclRef exprs.
This fixes <rdar://problem/6248392> clang: Error when using address of stack variable inside block.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56652 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 14:41:28 +00:00
Ted Kremenek 84fa6b90ab Examine VLA size expressions when computing liveness information.
Fixes <rdar://problem/6248086>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 05:52:45 +00:00
Daniel Dunbar 246e70f69c Parser support for prefix __attribute__ on @protocol.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56642 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 04:48:09 +00:00
Daniel Dunbar 3568249c2d Sema support for format and noreturn attributes on Objective-C methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56640 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 04:12:28 +00:00
Daniel Dunbar 085e8f7da3 Add support for CFString in format attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56639 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 03:32:58 +00:00
Daniel Dunbar 248e1c01d3 Add # of block pointer types to -print-stats.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56638 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 03:23:00 +00:00
Daniel Dunbar 38a67c9dfb Update clang to pretend to be gcc-4.2.
- This really needs to be automated and configurable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56635 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 01:13:13 +00:00
Ted Kremenek aefc36656d Have @finally introduce a new scope.
Fixes: <rdar://problem/6248119> @finally doesn't introduce a new scope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 00:31:16 +00:00
Devang Patel 761d7f78e2 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56623 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 21:02:23 +00:00
Ted Kremenek d17062cc23 Added prototype implementation of the DeclGroup, DeclGroupRef, and DeclGroupOwningRef classes.
Documentation and testing are pending.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56611 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 17:13:40 +00:00
Steve Naroff ba80c9abcc Downgrade incompatible block pointer error to a warning (to be consistent with incompatible pointer warnings in general).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56595 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 23:31:10 +00:00
Steve Naroff 16564420ff Fix <rdar://problem/6243788> clang: Incorrect return statement for Blocks?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56590 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:26:48 +00:00
Steve Naroff 485eeff9ba Extend ASTContext::getTypeInfo() and ASTContext::getObjCEncodingForType() for BlockTypes.
This fixes <rdar://problem/6240616> clang: Assertion failed when using typedef and Blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56554 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 15:05:44 +00:00
Daniel Dunbar 86957eb200 Implement Obj-C synthesized setters for copy / retain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56547 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 06:32:09 +00:00
Daniel Dunbar c1cf4a579f Implement Obj-C getter synthesis for copy and retain.
Also, "simple" getter synthesis no longer uses temporary AST objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56544 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 04:04:31 +00:00
Daniel Dunbar 29e0bccf2b Refactor some CodeGen functionality:
- Add CodeGenFunction::{EmitReturnOfRValue, EmitIvarOffset}
 - Factor EmitLValueForIvar out of EmitObjCIvarRefLValue.

No non-error functionality change (some unsupported errors are
degraded to asserts for the time being).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56543 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 04:00:38 +00:00
Daniel Dunbar 49f6602707 Add Obj-C runtime methods to get runtime specific functions for
implementing property access.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56542 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 03:38:44 +00:00
Devang Patel 0fb1d15c37 Adjust whitespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 01:03:00 +00:00
Devang Patel d0646bd7c1 s/ParamAttrsWithIndex/FnAttributeWithIndex/g
Rename to match changes done on llvm side.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56537 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 01:01:36 +00:00
Daniel Dunbar 95e61fb7cd Implement type checking of Objective-C property attributes.
- readonly and readwrite are mutually exclusive.
 - assign, copy, and retain are mutually exclusive.
 - copy and retain are invalid on non-object types.
 - Warn about using default 'assign' property on object types
   (attempting to follow gcc behavior).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56507 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 21:53:23 +00:00
Steve Naroff dca6d6e8b0 Fix <rdar://problem/6240065> clang: __BLOCKS__ should be defined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56503 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 21:28:24 +00:00
Daniel Dunbar b55a42bf9b Add x86_64 Linux target.
- PR2824


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56491 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 17:37:57 +00:00
Daniel Dunbar e1226d24d2 Bug fix, result of isIntegerConstantExpr could be of incorrect width
for type.
  - PR2817


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56482 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 23:53:24 +00:00
Ted Kremenek 778246ae47 Output "REPORTHEADER" and "REPORTSUMMARYEXTRA" tags for use with scan-view.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56440 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 17:33:32 +00:00
Steve Naroff 33ae3afcf8 Remove unused slot/reference and update Sema::ActOnIdentifierExpr().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56438 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 15:31:56 +00:00
Steve Naroff 4f9b9f1e68 Fix http://llvm.org/bugs/show_bug.cgi?id=2816.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56433 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 10:28:57 +00:00
Ted Kremenek a05131a971 Change casing of bug type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-21 19:08:31 +00:00
Ted Kremenek b344f91f00 The checks in BasicObjCFoundationChecks now have a category: "API Misuse (Apple)"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56403 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-21 19:01:39 +00:00
Ted Kremenek 0b00785872 The "unused ivar" check now has a category: "Optimization"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-21 18:58:22 +00:00
Ted Kremenek 2713347374 Built-in checks now have a category: "Logic Errors"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56401 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-21 18:57:28 +00:00
Ted Kremenek a6aa83e5c7 Added experimental "intelligent-sizing" of HTML message bubbles based on the contents of the message.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56400 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-21 18:52:59 +00:00
Ted Kremenek 62059e8095 Add a bug category for NSError** checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-21 06:57:40 +00:00
Ted Kremenek 8c036c7f77 Add "category" to BugTypes, allowing bugs to be grouped.
Changed casing of many bug names.  The convention will be to have bug names (mostly) lower cased, and categories use some capitalization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56385 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-20 04:23:38 +00:00
Ted Kremenek 82bae3f6bf Add PostStore, a new ProgramPoint to distinguish between 'stores' and other PostStmts.
GRExprEngine:
  Use PostStore in EvalStore.
  Use a second version of EvalStore in EvalBinaryOperator to associate the store with the expression on the LHS.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56383 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-20 01:50:34 +00:00
Ted Kremenek a8fe39fbec Bug fix: for the base transfer function logic for casts, handle const casts as just propagating the value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-19 20:51:22 +00:00
Ted Kremenek 0a41e5a03a Fixed logic error in BasicConstraintManager pointed out by Zhongxing Xu.
For checking if a symbol >= value, we need to check if symbol == value || symbol
> value. When checking symbol > value and we know that symbol != value, the path
is infeasible only if value == maximum integer.

For checking if a symbol <= value, we need to check if symbol == value || symbol
< value. When checking symbol < value and we know that symbol != value, the path
is infeasible only if value == minimum integer.

Updated test case exercising this logic: we only prune paths if the values are
unsigned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56354 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-19 18:00:36 +00:00
Chris Lattner 69d349a874 Fix rdar://6222856: the receiver of a message expr is an
arbitrary expr, not just a assign expr.  The grammar comment
was right, the code was just wrong.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56353 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-19 17:44:00 +00:00
Ted Kremenek 2675875099 When we have a binary expression 'int operator symbol', properly rewrite this as
'symbol operator-reverse int'. This patch is a combination of code from
Zhongxing Xu and myself (Zhongxing noticed this bug for the cases of
relational operators).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56351 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-19 17:31:13 +00:00
Zhongxing Xu 94b8312a8d Add an omitted case for AssumeSymInt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-19 06:07:59 +00:00
Ted Kremenek f968308f83 Add panic function "__assert_fail".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56327 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-19 02:30:47 +00:00
Ted Kremenek 37fc826f94 Register the implicit null-dereferenced object as a notable symbol.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56319 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-18 23:23:19 +00:00
Ted Kremenek 7360fda1ef Implement second part of PR 2600: NSError** parameter may be null, and should be checked before being dereferenced.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56318 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-18 23:09:54 +00:00
Ted Kremenek cfdf9b4edf Change implementation of NSError** coding-style check to be invoked at the end of the retain/release analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56312 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-18 21:25:13 +00:00
Steve Naroff 9eae5761c0 Finish pushing blocks attribute through the clang attribute machinery.
Also added a couple simple tests from the "gcc.apple" test suite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56309 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-18 16:44:58 +00:00
Ted Kremenek f45d18c08b Implemented one of the checks requested in PR 2600:
"Method accepting NSError** argument should have non-void return value to indicate that an error occurred."

Test case written, but the header needs to be delta-debugged reduced.  Will commit shortly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56297 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-18 06:33:41 +00:00
Daniel Dunbar 834af45658 Improve x86 ABI compatibility.
- Enables use of ABIArgInfo::Expand when needed. This greatly
   improves our x86 ABI compatibility.

 - As the infrastructure for target specific ABI handling isn't built
   yet, this change means ABI compatibility on other platforms is once
   again broken in a different way than before.

 - Upcoming: Figure out how to refactor ABI handling into
   targets. More documentation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56293 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-17 21:22:33 +00:00