Steve Naroff
abefc391dd
Finish up handling all permutations of "complex int" (in Sema::UsualArithmeticConversions()).
...
A FIXME remains to verify the conversion rules are consistent with GCC.
Thanks to Eli for the new/improved test case...
llvm-svn: 46022
2008-01-15 22:21:49 +00:00
Steve Naroff
6fcfd0581d
- Change Type::isComplexType() to exlude GCC's complex integer extension. In general, we will keep the lowest level Type predicates "pure" (i.e. true to the C99 spec).
...
- Modify Sema::UsualArithmeticConversions() to work with the new definition of Type::isComplexType().
This is a nice cleanup and also fixes a bug submitted by Eli (which I've added to the test suite).
llvm-svn: 46005
2008-01-15 19:36:10 +00:00
Chris Lattner
15346fae70
avoid pasting L + "foo" into L"foo".
...
llvm-svn: 46000
2008-01-15 05:22:14 +00:00
Chris Lattner
877ca77420
avoid token pasting between identifiers and wide strings:
...
abc+L"foo" -> abc L"foo", not abcL"foo"
llvm-svn: 45999
2008-01-15 05:14:19 +00:00
Steve Naroff
8115902d6c
Add a comment...
...
llvm-svn: 45993
2008-01-15 02:05:07 +00:00
Steve Naroff
7f988889ef
Rework commit r45976, which was incorrect.
...
- Add Type::isComplexIntegerType(), Type::getAsComplexIntegerType().
- Don't inlude complex types with Type::isIntegerType(), which is too general.
- Use the new predicates in Sema::UsualArithmeticConversions() to recognize/convert the types.
llvm-svn: 45992
2008-01-15 01:41:59 +00:00
Ted Kremenek
e584359716
Removed implicit transitions to a "BlockExit" location; we now handle
...
the end of the block by processing empty blocks (at BlockEntrance) or
when we have just processed the last statement in a block (at PostStmt).
llvm-svn: 45991
2008-01-15 00:24:08 +00:00
Ted Kremenek
619bd1a8a0
Removed mutation of CFGBlock through operator[]. For now the underlying ASTs,
...
however, can still be manipulated through the returned Stmt*.
llvm-svn: 45990
2008-01-15 00:18:01 +00:00
Steve Naroff
d8c7d484af
Make sure Sema::GetTypeForDeclarator() deals with abstract declarators when diagnosing incorrect code.
...
Bug submitted by Eli.
llvm-svn: 45989
2008-01-14 23:33:18 +00:00
Ted Kremenek
3e743661c5
Added prototype implementation of path-sens. analysis core engine.
...
llvm-svn: 45986
2008-01-14 23:24:37 +00:00
Ted Kremenek
50fd838140
Added operator[] for CFGBlock. This provides random access to the statements
...
of a block.
llvm-svn: 45984
2008-01-14 23:18:55 +00:00
Chris Lattner
49f980c334
Fix build issue on cygwin, patch by Sam Bishop
...
llvm-svn: 45977
2008-01-14 21:47:29 +00:00
Steve Naroff
c28f46c6b4
Teach Type::isIntegerType() about GCC's __complex__ integer extensions...
...
Bug submitted by Eli.
llvm-svn: 45976
2008-01-14 21:38:57 +00:00
Steve Naroff
012484d6c8
Fix crasher when redefining functions. Not 100% pleased with this solution, but it is clearly an improvement. Will discuss with Chris later.
...
llvm-svn: 45975
2008-01-14 20:51:29 +00:00
Ted Kremenek
cb994b6a72
Cleaned up comment.
...
llvm-svn: 45970
2008-01-14 18:42:38 +00:00
Ted Kremenek
94acc6ac9a
Cleaned up comment.
...
llvm-svn: 45969
2008-01-14 18:41:42 +00:00
Ted Kremenek
a018a2c0f4
When serializing CompoundLiteralExpr, serialize out the file scope flag before
...
serializing the subexpression (Init), as this results in a more efficient
encoding in the bitstream.
llvm-svn: 45967
2008-01-14 18:29:39 +00:00
Steve Naroff
d32419de0d
Record if a compound literal expression is @ file scope. This allows us to implement C99 6.5.2.5p6. This could have been done without modifying the AST (by checking the decl type and passing the info down to isContextExpr), however we concluded this is more desirable.
...
Bug/patch by Eli Friedman!
llvm-svn: 45966
2008-01-14 18:19:28 +00:00
Ted Kremenek
d065a790d9
Removed 'inline' keywords from methods now defined in ExplodedGraph.cpp.
...
llvm-svn: 45965
2008-01-14 18:11:35 +00:00
Ted Kremenek
a0a3e9bb07
Change uses of std::cerr/std::cout to llvm::Lcerr/llvm::cout, and remove
...
#include<iostream>.
Patch provided by Sam Bishop.
llvm-svn: 45962
2008-01-14 16:44:48 +00:00
Steve Naroff
4871fe0b8f
Revert r45951, Chris says it violates the C99 spec.
...
llvm-svn: 45961
2008-01-14 16:10:57 +00:00
Anders Carlsson
a1afcab6f9
_asm is another valid alias for asm.
...
llvm-svn: 45957
2008-01-14 07:46:40 +00:00
Anders Carlsson
1ba25ca171
Add codegen upport for implicit casts to aggregate exprs.
...
llvm-svn: 45954
2008-01-14 06:28:57 +00:00
Chris Lattner
f14ba63620
add a note
...
llvm-svn: 45953
2008-01-14 06:27:57 +00:00
Chris Lattner
fd65291aa3
Fix ASTContext::typesAreCompatible when analyzing a function type with
...
proto and function type without proto. It would never call
'functionTypesAreCompatible' because they have different type classes.
llvm-svn: 45952
2008-01-14 05:45:46 +00:00
Steve Naroff
090353191c
Rewrite Expr::isNullPointerConstant() to deal with multiple levels of explicit casts.
...
Now, isNullPointerConstant() will return true for the following: "(void*)(double*)0"
llvm-svn: 45951
2008-01-14 02:53:34 +00:00
Steve Naroff
826e91ae04
Change Sema::CheckAddressOfOperation() to respect C99-only addressof rules.
...
Remove diagnostics from Sema::CheckIndirectionOperand(). C89/C99 allow dereferencing an incomplete type. clang appears to be emulating some incorrect gcc behavior (see below).
void
foo (void)
{
struct b;
struct b* x = 0;
struct b* y = &*x; // gcc produces an error ("dereferencing pointer to incomplete type")
}
With this patch, the above is now allowed.
Bug/Patch by Eli Friedman!
llvm-svn: 45933
2008-01-13 17:10:08 +00:00
Ted Kremenek
d122bbdb06
Moved destructor logic of templated class ExplodedGraph to non-templated
...
parent class ExplodedGraphImpl.
llvm-svn: 45930
2008-01-13 05:33:04 +00:00
Ted Kremenek
6d7aee6edd
Added node cleanup to dstor of ExplodedGraph.
...
llvm-svn: 45929
2008-01-13 05:03:01 +00:00
Ted Kremenek
eb370bc386
Created ExplodedGraph.cpp and moved most method implementations of
...
ExplodedNodeImpl::NodeGroup from being defined inline to being defined
"out-of-line" in ExplodedGraph.cpp. This removes a dependence on including
<vector> in ExplodedGraph.h, and will hopefully result in smaller generated code
with negligible performance impact.
llvm-svn: 45928
2008-01-13 04:56:13 +00:00
Ted Kremenek
49bbee0b1d
Moved 'ExplodedNodeGroup' into class 'ExplodedNode' as the nested class
...
'NodeGroup.'
llvm-svn: 45927
2008-01-13 04:20:10 +00:00
Ted Kremenek
39dfeadd93
Fixed lines preventing compilation.
...
llvm-svn: 45926
2008-01-13 04:18:40 +00:00
Ted Kremenek
2ae51a5d27
Now include "CFG.h" because the inline methods of "BlockEntrance" accessor
...
the methods of CFGBlock.
llvm-svn: 45925
2008-01-13 04:08:45 +00:00
Ted Kremenek
990d7d5205
Fixed some comments.
...
llvm-svn: 45924
2008-01-13 04:03:38 +00:00
Ted Kremenek
76245f3ed0
Removed ExplodedNode.h, since its contents are now in ExplodedGraph.h
...
llvm-svn: 45923
2008-01-13 04:00:44 +00:00
Ted Kremenek
8f13ec74c4
Merged ExplodedNode.h into ExplodedGraph.h, since the ExplodedNode class will
...
only be used in the context of the ExplodedGraph class.
llvm-svn: 45922
2008-01-13 04:00:16 +00:00
Ted Kremenek
cfe8235fa1
Changed implementation of successor and predecessor sets for ExplodedNode
...
to optimize for the common case of having a single predecessor and a single
successor.
llvm-svn: 45921
2008-01-13 03:55:50 +00:00
Chris Lattner
0a8c2325fc
allow __func__ in objc methods.
...
llvm-svn: 45915
2008-01-12 19:32:28 +00:00
Chris Lattner
317e6ba07f
Tighten up handling of __func__ and friends: it should be an array
...
of const char, and it should error if it occurs outside a function.
Is it valid in an objc method? If so we should handle that too.
llvm-svn: 45910
2008-01-12 18:39:25 +00:00
Chris Lattner
a81a0279cc
Fix the type of predefined identifiers like __func__. Patch by
...
Eli Friedman!
llvm-svn: 45906
2008-01-12 08:14:25 +00:00
Chris Lattner
65531e8fb7
Fix a fixme, by only parsing extern "C" in C++ mode.
...
llvm-svn: 45905
2008-01-12 07:08:43 +00:00
Chris Lattner
38376f1595
Add first pieces of support for parsing and representing
...
extern "C" in C++ mode. Patch by Mike Stump!
llvm-svn: 45904
2008-01-12 07:05:38 +00:00
Chris Lattner
177977ac19
When forming the squigly underline for a diagnostic, make sure to
...
verify that the source range corresponds to the current file, not
just the current line. This allows us to emit:
a.c:1:44: error: invalid operands to binary expression ('double' and 'int *')
double a; int *b; void f(void) { int c = a +
~ ^
instead of:
a.c:1:44: error: invalid operands to binary expression ('double' and 'int *')
double a; int *b; void f(void) { int c = a +
~ ~ ^
for PR1906 (note the leading ~).
Thanks to Neil for noticing this.
llvm-svn: 45901
2008-01-12 06:43:35 +00:00
Ted Kremenek
8d71e25590
Fix misspelling of "existent".
...
Do not use std::cerr; use llvm::cerr instead.
Patch provided by Sam Bishop!
llvm-svn: 45880
2008-01-11 20:42:05 +00:00
Ted Kremenek
5906b9e79a
Added ProgramPoint.cpp, which implements several methods of the subclasses
...
of ProgramPoint.
llvm-svn: 45866
2008-01-11 16:36:20 +00:00
Ted Kremenek
b1dec454bb
Renamed ProgramEdge.h to ProgramPoint.h
...
llvm-svn: 45847
2008-01-11 00:43:12 +00:00
Ted Kremenek
e5ccf9a96c
Renamed ProgramEdge to ProgramPoint and changed subclasses of ProgramEdge
...
to have a much simpler, cleaner interpretation of what is a "location"
in a function (as encoded by a CFG).
llvm-svn: 45846
2008-01-11 00:40:29 +00:00
Ted Kremenek
d7a7abed62
Fixed 80-col violation.
...
llvm-svn: 45845
2008-01-11 00:18:40 +00:00
Fariborz Jahanian
af5d80cba5
Avoid redefinition of __objcFastEnumerationState
...
llvm-svn: 45842
2008-01-10 23:04:06 +00:00
Steve Naroff
98f7203680
- Teach Expr::isConstantExpr() about InitListExpr's (and offsetof, since I noticed it was missing).
...
- Rename CheckInitializer() to CheckInitializerTypes().
- Removed the isStatic argument to CheckInitializerTypes() and all of it's subroutines. Checking for constant expressions is now done separately.
- Added CheckForConstantInitializer().
llvm-svn: 45840
2008-01-10 22:15:12 +00:00