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.
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.
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.
Chris Lattner [Fri, 19 Sep 2008 17:44:00 +0000 (17:44 +0000)]
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.
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).
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.
Daniel Dunbar [Wed, 17 Sep 2008 21:22:33 +0000 (21:22 +0000)]
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.
Minor pass-sensitivity improvement:
if we know that 'len != 0' and know that 'i == 0' then we know that
'i < len' must evaluate to true and cannot evaluate to false
Steve Naroff [Tue, 16 Sep 2008 23:11:46 +0000 (23:11 +0000)]
Remove support for BlockExprExpr. For example...
^(expression) or ^(int arg1, float arg2)(expression)
...is no longer supported.
All block literals now require a compound statement.
Steve Naroff [Tue, 16 Sep 2008 22:25:10 +0000 (22:25 +0000)]
Sema::ActOnBlockReturnStmt(): Need to perform the UsualUnaryConversions on the return type.
Sema::CheckReturnStackAddr(): Make sure we skip over implicit casts.
Added some more test cases...
ProgramPoint now takes the space of two pointers instead of one. This change was
motivated because it became clear that the number of subclasses of ProgramPoint
would expand and we ran out of bits to represent a pointer variant. As a plus of
this change, BlockEdge program points can now be represented explicitly without
using a cache of CFGBlock* pairs in CFG.
Daniel Dunbar [Fri, 12 Sep 2008 18:39:42 +0000 (18:39 +0000)]
Round out object size checking builtins (fprintf ones disabled as we
have no mapping to FILE*). We are also missing printf format
attributes for the printf style ones.
Daniel Dunbar [Fri, 12 Sep 2008 18:10:20 +0000 (18:10 +0000)]
Add --suppress-system-warnings (on by default, use =0 to disable)
- For investigating warnings in system headers / builtins.
- Currently also enables the behavior that allows silent redefinition
of types in system headers. Conceptually these are separate but I
didn't feel it was worth two options (or changing LangOptions).
Daniel Dunbar [Thu, 11 Sep 2008 23:12:46 +0000 (23:12 +0000)]
Iterate on sema for :? in Objective-C:
- Follow C99 behavior of using other operand type when one of
operands is a null pointer constant.
- Fix overenthusiastic devolving of any Objective-C types to id:
o If either operand has an Objective-C object type then:
- If both operands are interfaces and either operand can be
assigned to the other, use that type as the composite type.
- Otherwise, if either type is id, use id as the composite type.
- Otherwise, warn about incompatible types and use id as the
composite type.
- Return handling of qualified idea to separate test following
general pointer type checking.
o Upgraded from old code to allow devolving to id (without warning,
which matches GCC).
- <rdar://problem/6212771>
Add test case for issues fixed above, XFAIL though because it exposed
a new issue in property handling.
Echo stderr/stdout from clang subprocess to both the stderr of ccc-analyzer and
to an output file. This way users can both see the output of 'clang' as well as
enable background logging of files that clang encounters problems on.
Steve Naroff [Thu, 11 Sep 2008 15:29:03 +0000 (15:29 +0000)]
Fix <rdar://problem/6210791> clang ObjC rewriter: @try / @catch block with no @finally does not call objc_exception_try_exit.
Need a couple tweaks to RewriteObjCTryStmt(). Need to deal with implicit finally clauses (to make sure objc_exception_try_exit is called). Also fixed a related bug where we need to generate an implicit @catch else clause (to again make sure objc_exception_try_exit is called).
Daniel Dunbar [Thu, 11 Sep 2008 01:48:57 +0000 (01:48 +0000)]
Use ABIArgInfo for decisions about function arguments (not just return
value).
- Added ABIArgInfo::ByVal (mostly supported) and ABIArgInfo::Expand
(asserted out).
- Added classifyArgumentType which currently just uses
ABIArgInfo::Default or ByVal. This nearly matches old behavior, but
we now set ByVal in a few situations we may have left it off before
(on complex, for example).
Fold Parser::ParseTag into Parser::ParseEnumSpecifier, as suggested in this post:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-September/002721.html
Daniel Dunbar [Thu, 11 Sep 2008 00:04:36 +0000 (00:04 +0000)]
Bug fix, apply default argument promotion in message sends for which
no method declaration was found.
- This was allowing arrays to pass "by value" among other things.
Add assert in CodeGen that arguments cannot have array type.
Daniel Dunbar [Wed, 10 Sep 2008 07:04:09 +0000 (07:04 +0000)]
Implement ABIArgType::Coerce support.
- As a test, enable basic usage for some common x86-32 cases. This
increases our x86-32 compliance (on other targets our compliance
will just be broken in a different way).
Daniel Dunbar [Wed, 10 Sep 2008 04:01:49 +0000 (04:01 +0000)]
Move FunctionType conversion into CGCall.cpp:
- Added CodeGenTypes::GetFunctionType, taking a CGFunctionInfo.
- Updated Obj-C runtimes to use this instead of rolling the
llvm::FunctionType by hand.
- Killed CodeGenTypes::{ConvertReturnType, DecodeArgumentTypes}.
Add ABIArgInfo class to encapsulate ABI decision of how to lower types
to LLVM.
- Will move to target sometime soon.
Daniel Dunbar [Wed, 10 Sep 2008 00:41:16 +0000 (00:41 +0000)]
Tweak CGCall functions again:
- Realized these functions will eventually need access to more data,
moved to CodeGenModule. Eventually they should probably live
together in some other helper class.
Add new 'CXXConditionDeclExpr' expression node used for a 'condition' declaration, e.g: "if (int x=0) {...}".
It is a subclass of DeclRefExpr and the main difference is that CXXConditionDeclExpr owns the declaration that it references.