summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactoring the security checker a little bit so that each CallExpr check ↵Lenny Maiorani2011-04-031-60/+44
| | | | | | doesn't get called for each CallExpr. Instead it does a switch and only runs the check for the proper identifier. Slight speed improvement (probably significant on very large ASTs), and should make it easier and more clear to add more checks for other CallExpr's later. llvm-svn: 128785
* static analyzer: Add a new ProgramPoint PostCondition to represent the post ↵Ted Kremenek2011-04-031-0/+19
| | | | | | | | position of a branch condition, and a new generateNode method to BranchNodeBuilder using PostCondition ProgramPoint. This method generates a new ExplodedNode but not a new block edge. Patch by Lei Zhang! llvm-svn: 128784
* Fix RegionStore bug when doing a field load whose parent is also a field ↵Ted Kremenek2011-04-031-11/+17
| | | | | | assigned a LazyCompoundValue. Fixes <rdar://problem/9163742> and PR 9522. llvm-svn: 128783
* Make -Wheader-hygiene not complain about USING_NAMESPACE_THROUGH_MACRO in a ↵Nico Weber2011-04-022-2/+2
| | | | | | non-header file. llvm-svn: 128780
* Change the return type of CodeGenVTables::getVirtualBaseOffsetOffset() toKen Dyck2011-04-025-15/+19
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 128776
* Use CharUnits for the offsets in the VirtualBaseClassOffsetOffsetsMapTy. NoKen Dyck2011-04-022-6/+6
| | | | | | change in functionality intended. llvm-svn: 128773
* Use CharUnits for the offset type in the ClassNamesAndOffsets map inKen Dyck2011-04-021-4/+4
| | | | | | dumpLayout(). No change in functionality intended. llvm-svn: 128771
* Use CharUnits for the offsets in the VBaseOffsetOffsetsMapTy types. NoKen Dyck2011-04-021-8/+11
| | | | | | change in functionality intended. llvm-svn: 128770
* Apply a bug-fix patch from Marcin Kowalczyk to the source locations forChandler Carruth2011-04-021-1/+3
| | | | | | | | | | | a couple of operator overloads which form interesting expressions in the AST. I added test cases for both bugs with the c-index-test's token annotation feature. Also, thanks to John McCall for confirming that this is the correct solution. llvm-svn: 128768
* Remove a redundant method. We have a const version.Zhongxing Xu2011-04-021-0/+1
| | | | llvm-svn: 128762
* Teach IdempotentOperationsChecker about paths aborted because ExprEngine ↵Ted Kremenek2011-04-023-9/+19
| | | | | | didn't know how to handle a specific Expr type. llvm-svn: 128761
* static analyzer: Rename 'BlocksAborted' to 'BlocksExhausted' to reflect that ↵Ted Kremenek2011-04-023-3/+3
| | | | | | a given CFGBlock was analyzed too many times. llvm-svn: 128760
* Convert BaseOffset::NonVirtualOffset to CharUnits. No change inKen Dyck2011-04-021-12/+12
| | | | | | functionality intended. llvm-svn: 128756
* Convert offset parameters and return values of VTableComponent methods toKen Dyck2011-04-021-20/+29
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 128754
* Convert the offsets in VCallOffsetMap to CharUnits. No change inKen Dyck2011-04-021-8/+9
| | | | | | functionality intended. llvm-svn: 128753
* Convert offset parameters of VTableBuilder::IsOverriderUsed() to CharUnits.Ken Dyck2011-04-021-7/+7
| | | | | | No change in functionality intended. llvm-svn: 128752
* Fixes a rewriter bug rewriting call to a byrefFariborz Jahanian2011-04-011-19/+2
| | | | | | block pointer nested inside a block. // rdar:// 9204669 llvm-svn: 128747
* Driver/Darwin: Tweak simulator link logic a bit more to be closer to GCC.Daniel Dunbar2011-04-011-2/+8
| | | | llvm-svn: 128738
* ANother rewrite bug, rewriting a call ofFariborz Jahanian2011-04-011-1/+2
| | | | | | __byref block. // rdar://9204669 llvm-svn: 128726
* Do not try calculate the size of forward-declared template type array.Devang Patel2011-04-011-0/+8
| | | | llvm-svn: 128725
* Fix an error in TreeTransform where we failed to copy the TemplateName'sChandler Carruth2011-04-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | location into a TemplateSpecializationTypeLoc. These were found using a hand-written program to inspect every source location in TemplateSpecializationTypeLocs and Valgrind. I don't know of any way to test them in Clang's existing test suite sadly. Example code that triggers the ElaboratedType case: template <typename T> struct X1 { template <typename U> struct X1_1 { int x; }; }; template <typename T, typename U> struct X2 { typename X1<T>::template X1_1<U> B; }; X2<char, int> x2; The other fix was simply spotted by inspection. I audited all constructions of [Dependent]TemplateSpecializationTypeLocs in TreeTransform.h, and the rest set the TemplateNameLoc properly. llvm-svn: 128702
* IRgen: Reapply r128691 with a fix to ensure we don't increase alignment pastDaniel Dunbar2011-04-011-2/+13
| | | | | | that of the array element type. llvm-svn: 128698
* Revert r128691, "IRgen: Improve GCC compatibility when dealing with packedDaniel Dunbar2011-04-011-7/+2
| | | | | | arrays by propagating", it's breaking test in ways I don't understand yet. llvm-svn: 128693
* IRgen: Improve GCC compatibility when dealing with packed arrays by propagatingDaniel Dunbar2011-03-311-2/+7
| | | | | | | | the array alignment to the array access. - This is more or less the best we can do without having alignment present in the type system, but is a long way from truly matching how GCC handles this. llvm-svn: 128691
* Fix couple of rewriter bugs related to rewriting aFariborz Jahanian2011-03-311-3/+11
| | | | | | __block block declaration. //rdar://9204669 llvm-svn: 128682
* -Wuninitialized should not warn about variables captured by blocks as byref.Ted Kremenek2011-03-311-6/+11
| | | | | | | | | Note this can potentially be enhanced to detect if the __block variable is actually written by the block, or only when the block "escapes" or is actually used, but that requires more analysis than it is probably worth for this simple check. llvm-svn: 128681
* Add security syntax checker for strcpy() which causes the Static Analyzer to ↵Lenny Maiorani2011-03-311-0/+54
| | | | | | generate a warning any time the strcpy() function is used with a note suggesting to use a function which provides bounded buffers. llvm-svn: 128679
* Adding Static Analyzer checker for mempcpy().Lenny Maiorani2011-03-311-9/+73
| | | | | | Models mempcpy() so that if length is NULL the destination pointer is returned. Otherwise, the source and destination are confirmed not to be NULL and not overlapping. Finally the copy is validated to not cause a buffer overrun and the return value is bound to the address of the byte after the last byte copied. llvm-svn: 128677
* Fix spelling in a comment. (test commit)Lenny Maiorani2011-03-311-1/+1
| | | | llvm-svn: 128670
* Make ChainedIncludesSource an ExternalSemaSource, otherwise initialization ↵Sebastian Redl2011-03-312-1/+16
| | | | | | of the ASTReader is incomplete, leading to errors like not realizing std::type_info is already defined. llvm-svn: 128664
* Tell the diagnostic client about starting and ending source files when ↵Sebastian Redl2011-03-311-0/+3
| | | | | | automatically creating chained PCHs. This way, we don't get a crash whenever a diagnostic is emitted while processing the include. llvm-svn: 128663
* Driver/Darwin: Tweak link logic for simulator.Daniel Dunbar2011-03-312-1/+14
| | | | llvm-svn: 128641
* Whoops.John McCall2011-03-311-2/+2
| | | | llvm-svn: 128621
* After much contemplation, I've decided that we probably shouldn't "unique"John McCall2011-03-313-165/+247
| | | | | | | | | | | | | __block object copy/dispose helpers for C++ objects with those for different variables with completely different semantics simply because they happen to both be no more aligned than a pointer. Found by inspection. Also, internalize most of the helper generation logic within CGBlocks.cpp, and refactor it to fit my peculiar aesthetic sense. llvm-svn: 128618
* Static analyzer: fix bug in handling of dynamic_cast<>. The sink node ↵Ted Kremenek2011-03-311-97/+86
| | | | | | | | wouldn't always be the final node, thus causing the state to continue propagating. Instead, recover some path-sensitivity by conjuring a symbol. llvm-svn: 128612
* Teach static analyzer about the basics of handling new[]. We still don't ↵Ted Kremenek2011-03-311-9/+12
| | | | | | simulate constructors, but at least the analyzer doesn't think the return value is uninitialized. llvm-svn: 128611
* Move all the significant __block code into CGBlocks.cpp. No functionalityJohn McCall2011-03-313-187/+215
| | | | | | change. llvm-svn: 128608
* Oops, prefer C-style cast hereMatt Beaumont-Gay2011-03-311-1/+1
| | | | llvm-svn: 128607
* Remove a redundant isValid() checkMatt Beaumont-Gay2011-03-311-1/+1
| | | | llvm-svn: 128606
* Silence GCC warning about differing types on the branches of a conditional ↵Matt Beaumont-Gay2011-03-311-1/+1
| | | | | | expression llvm-svn: 128605
* Convert the return value ofKen Dyck2011-03-311-11/+11
| | | | | | | VCallAndVBaseOffsetBuilder::getCurrentOffsetOffset() to CharUnits. No change in functionality intended. llvm-svn: 128603
* Convert the OffsetInLayoutClass parameter ofKen Dyck2011-03-311-9/+10
| | | | | | | VCallAndVBaseOffsetBuilder::AddVBaseOffsets() to CharUnits. No change in functionality intended. llvm-svn: 128600
* Change Clang's __VERSION__ to include the same basic info as in clang -v.Daniel Dunbar2011-03-312-1/+19
| | | | | | - Please never ever ever ever write a tool that sniffs this. llvm-svn: 128599
* Convert the OffsetInLayoutClass of the VCallAndVBaseOffsetBuilderKen Dyck2011-03-311-6/+6
| | | | | | constructor to CharUnits. No change in functionality intended. llvm-svn: 128598
* Convert the RealBaseOffset parameter ofKen Dyck2011-03-311-5/+6
| | | | | | | VCallAndVBaseOffsetBuilder::AddVCallAndVBaseOffsets() to CharUnits. No change in functionality intended. llvm-svn: 128596
* Basic: Add support for a build variable to set the repository path that goesDaniel Dunbar2011-03-311-0/+4
| | | | | | into the Clang version. llvm-svn: 128595
* Use intrinsics for Neon vmull operations. Radar 9208957.Bob Wilson2011-03-311-3/+3
| | | | llvm-svn: 128590
* Add '#ifndef _PTRDIFF_T' guard around definition of ptrdiff_t. Fixes ↵Ted Kremenek2011-03-301-0/+3
| | | | | | <rdar://problem/9210154>. llvm-svn: 128578
* Begin reworking static analyzer support for C++ method calls. The current ↵Ted Kremenek2011-03-306-164/+174
| | | | | | | | | | | logic was divorced from how we process ordinary function calls, had a tremendous about of redundancy, and relied strictly on inlining behavior (which was incomplete) to provide semantics instead of falling back to the conservative analysis we use for C functions. This is a significant step into making C++ analyzer support more useful. llvm-svn: 128557
* de-sugared when accessing property reference type.Fariborz Jahanian2011-03-302-2/+2
| | | | | | Add a test case for synthesize ivar. // rdar://9070460 llvm-svn: 128554
OpenPOWER on IntegriCloud