Commit Graph

6476 Commits

Author SHA1 Message Date
Ted Kremenek 8bafa2cf9f Internally store the body of a BlockExpr using a Stmt* instead of a CompoundStmt*, and use the getBody() method to do the appropriate checking. This both removes the type-punning warnings in Expr.cpp and also makes BlockExpr have more consistency checks against modifications to its body (via StmtIterator).
llvm-svn: 56710
2008-09-26 23:24:14 +00:00
Ted Kremenek 2e53c51914 Forgot to check in header file with last commit.
llvm-svn: 56709
2008-09-26 23:24:05 +00:00
Ted Kremenek 6ed79f0c13 Use a union instead of a bunch of magic casts to implement a variant. This removes the type-punning errors for DeclGroup.
llvm-svn: 56708
2008-09-26 23:19:04 +00:00
Ted Kremenek f5e7e3ae26 Add more control-flow to test case.
llvm-svn: 56707
2008-09-26 23:05:47 +00:00
Ted Kremenek d86d39cc9e Add CFG support for implicit-control flow for VLA size expressions within an SizeOfAlignOfTypeExpr.
llvm-svn: 56706
2008-09-26 22:58:57 +00:00
Devang Patel 597e70876e Now Attributes are divided in three groups
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn

Return attributes use 0 as the index.
Function attributes use ~0U as the index.

llvm-svn: 56705
2008-09-26 22:53:57 +00:00
Ted Kremenek 928f484c2d Updated checker build.
llvm-svn: 56701
2008-09-26 22:00:01 +00:00
Chris Lattner b03dc76499 clean up a bunch of fixme's I added, by moving
DirectoryLookup::DirType into SourceManager.h

llvm-svn: 56692
2008-09-26 21:18:42 +00:00
Chris Lattner c88a23e8d7 Fix the rest of rdar://6243860 hopefully. This requires changing FileIDInfo
to whether the fileid is a 'extern c system header' in addition to whether it
is a system header, most of this is spreading plumbing around.  Once we have that,
PPLexerChange bases its "file enter/exit" notifications to PPCallbacks to
base the system header state on FileIDInfo instead of HeaderSearch.  Finally,
in Preprocessor::HandleIncludeDirective, mirror logic in GCC: the system headerness
of a file being entered can be set due to the #includer or the #includee.

llvm-svn: 56688
2008-09-26 20:12:23 +00:00
Chris Lattner 71efd8159e fit in 80 cols.
llvm-svn: 56687
2008-09-26 20:05:14 +00:00
Chris Lattner 9627d6720a alphabetize files
llvm-svn: 56673
2008-09-26 18:49:39 +00:00
Ted Kremenek ac49ea63c6 Do not create CFGs for functions/methods using blocks (need to add control-flow).
llvm-svn: 56672
2008-09-26 18:17:07 +00:00
Chris Lattner 6bea488c79 testcase for my previous patch.
llvm-svn: 56670
2008-09-26 18:07:51 +00:00
Chris Lattner e744d32b72 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.

llvm-svn: 56669
2008-09-26 17:46:45 +00:00
Ted Kremenek 68d2190226 Enter a new scope for a @try block.
llvm-svn: 56668
2008-09-26 17:32:47 +00:00
Ted Kremenek a69637ba6d Updated checker build.
llvm-svn: 56666
2008-09-26 17:04:34 +00:00
Ted Kremenek 61a625ff70 Move VLA processing logic from LiveVariables to CFG construction. This way all dataflow analyses "see" the VLA size expressions.
llvm-svn: 56655
2008-09-26 16:26:36 +00:00
Steve Naroff ba756cb3fc 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.

llvm-svn: 56652
2008-09-26 14:41:28 +00:00
Ted Kremenek 2ece64bbc4 Examine VLA size expressions when computing liveness information.
Fixes <rdar://problem/6248086>

llvm-svn: 56645
2008-09-26 05:52:45 +00:00
Daniel Dunbar 08971bf2c4 Change Radar reproducibility to "Always".
llvm-svn: 56644
2008-09-26 05:00:28 +00:00
Daniel Dunbar 26e2ab4a37 Parser support for prefix __attribute__ on @protocol.
llvm-svn: 56642
2008-09-26 04:48:09 +00:00
Daniel Dunbar c136e0ca43 Sema support for format and noreturn attributes on Objective-C methods.
llvm-svn: 56640
2008-09-26 04:12:28 +00:00
Daniel Dunbar 980c66946b Add support for CFString in format attribute.
llvm-svn: 56639
2008-09-26 03:32:58 +00:00
Daniel Dunbar 2c793a2ecd Add # of block pointer types to -print-stats.
llvm-svn: 56638
2008-09-26 03:23:00 +00:00
Daniel Dunbar e778131386 Make clang preprocessed output a bit more like gcc output.
llvm-svn: 56636
2008-09-26 01:13:35 +00:00
Daniel Dunbar b5fe494a2c Update clang to pretend to be gcc-4.2.
- This really needs to be automated and configurable.

llvm-svn: 56635
2008-09-26 01:13:13 +00:00
Daniel Dunbar 2c61b32beb Comment fix.
llvm-svn: 56634
2008-09-26 01:11:51 +00:00
Ted Kremenek 894036d2cd Updated checker build.
llvm-svn: 56633
2008-09-26 00:50:00 +00:00
Ted Kremenek a34ea3b9cf Have @finally introduce a new scope.
Fixes: <rdar://problem/6248119> @finally doesn't introduce a new scope

llvm-svn: 56629
2008-09-26 00:31:16 +00:00
Devang Patel 322300d1c2 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.

llvm-svn: 56623
2008-09-25 21:02:23 +00:00
Ted Kremenek 15146a56e1 Emulate gcc driver-driver functionality: run analyzer separately for each separate -arch option.
llvm-svn: 56618
2008-09-25 20:17:57 +00:00
Daniel Dunbar 8e519d0d48 Disable report crashes link for the time being.
llvm-svn: 56617
2008-09-25 19:59:17 +00:00
Ted Kremenek c6c4f239d6 Update Xcode project.
llvm-svn: 56612
2008-09-25 17:13:59 +00:00
Ted Kremenek a5e23f6b78 Added prototype implementation of the DeclGroup, DeclGroupRef, and DeclGroupOwningRef classes.
Documentation and testing are pending.

llvm-svn: 56611
2008-09-25 17:13:40 +00:00
Daniel Dunbar 0dbad4670c Add link to report analyzer failures (parse errors, asserts, etc).
llvm-svn: 56606
2008-09-25 06:05:31 +00:00
Daniel Dunbar 1ac2ccb47e Update scan-build to add markers about crashes.
llvm-svn: 56603
2008-09-25 01:10:50 +00:00
Ted Kremenek 72e4b0b54c Include clang preprocessed sources as well with "crashes" output.
llvm-svn: 56601
2008-09-25 00:51:44 +00:00
Ted Kremenek 1ad3b3df2f Use .txt extension for info files.
llvm-svn: 56598
2008-09-25 00:25:16 +00:00
Steve Naroff f17c232a9e Downgrade incompatible block pointer error to a warning (to be consistent with incompatible pointer warnings in general).
llvm-svn: 56595
2008-09-24 23:31:10 +00:00
Steve Naroff 4efed31acf Fix a couple harmless warnings when compiling optimized with gcc (reported by mrs@apple.com).
llvm-svn: 56591
2008-09-24 22:46:45 +00:00
Steve Naroff c60873ce44 Fix <rdar://problem/6243788> clang: Incorrect return statement for Blocks?
llvm-svn: 56590
2008-09-24 22:26:48 +00:00
Daniel Dunbar 3a28b9acbd Add more testing of Obj-C property synthesis.
llvm-svn: 56564
2008-09-24 18:00:13 +00:00
Daniel Dunbar d8d1fec6bd Add scan-view '--allow-all-hosts' option, by default access is now
restricted to 127.0.0.1.

llvm-svn: 56563
2008-09-24 17:59:41 +00:00
Ted Kremenek 26971ffcc5 Update checker build.
llvm-svn: 56562
2008-09-24 17:45:52 +00:00
Steve Naroff c792570eb1 Fix some const-ness to keep the VisualStudio C++ compiler happy.
llvm-svn: 56560
2008-09-24 17:22:34 +00:00
Steve Naroff 921a45c6d6 Extend ASTContext::getTypeInfo() and ASTContext::getObjCEncodingForType() for BlockTypes.
This fixes <rdar://problem/6240616> clang: Assertion failed when using typedef and Blocks.

llvm-svn: 56554
2008-09-24 15:05:44 +00:00
Ted Kremenek 1f58ec6475 Updated test case.
llvm-svn: 56548
2008-09-24 06:40:03 +00:00
Daniel Dunbar 5449ce5d75 Implement Obj-C synthesized setters for copy / retain.
llvm-svn: 56547
2008-09-24 06:32:09 +00:00
Daniel Dunbar a08dff1be1 Implement Obj-C getter synthesis for copy and retain.
Also, "simple" getter synthesis no longer uses temporary AST objects.

llvm-svn: 56544
2008-09-24 04:04:31 +00:00
Daniel Dunbar 1c64e5d12f 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).

llvm-svn: 56543
2008-09-24 04:00:38 +00:00