summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Back out r70506 (exception spec in AST) again. We won't have exception specs ↵Sebastian Redl2009-05-066-53/+13
| | | | | | until we've had a lot more discussion. llvm-svn: 71125
* Handle -march for the LLVM recognized cpu names.Daniel Dunbar2009-05-061-10/+35
| | | | | | | - x86 target feature handling should not be feature complete, even if the code quality is lacking. llvm-svn: 71123
* Refactor BugReporter interface to have a new 'BugReporterContext' andTed Kremenek2009-05-062-92/+80
| | | | | | | | | | | 'BugReporterVisitor'. This simplifies callbacks from BugReporter to BugReports (via VisitNode). It also lays the foundation for arbitrary visitor "call backs" that can be registered to a BugReporterContext as a PathDiagnostic is constructed. These call backs can help operate as separate "experts" that can work on constructed pieces of a PathDiagnostic for which they possess special knowledge. llvm-svn: 71121
* More x86 target feature support.Daniel Dunbar2009-05-061-4/+58
| | | | | | | | | | | | | | | | | | - Apologies for the extremely gross code duplication, I want to get this working and then decide how to get this information out of the back end. - This replaces -m[no-]sse4[12] by -m[no-]sse4, it appears gcc doesn't distinguish them? - -msse, etc. now properly disable/enable related features. - Don't always define __SSE3__... - The main missing functionality bit here is that we don't initialize the features based on the CPU for all -march options. llvm-svn: 71117
* Fix analyzer regression reported in PR 4164:Ted Kremenek2009-05-062-13/+54
| | | | | | | | | | - Update the old StoreManager::CastRegion to strip off 'ElementRegions' when casting to void* (Zhongxing: please validate) - Pass-by-reference argument invalidation logic in CFRefCount.cpp: - Strip ElementRegions when the ElementRegion is just a 'raw data' view on top of the underlying typed region. llvm-svn: 71094
* Improve RegionStoreManager::getSizeInElements()Zhongxing Xu2009-05-061-2/+53
| | | | | | | | - add a static function getTypeWidth(), which computes the width of a type with the help of TargetInfo. - no-outofbounds.c now passes for region store. llvm-svn: 71080
* Add a GDM for recording the cast type of regions.Zhongxing Xu2009-05-061-2/+25
| | | | llvm-svn: 71076
* The super region of ElementRegion no longer needs to be TypedRegion. In theZhongxing Xu2009-05-061-1/+1
| | | | | | future we would create ElementRegion directly on top of typeless regions. llvm-svn: 71075
* Implement a heuristic type size comparison method for now.Zhongxing Xu2009-05-061-3/+19
| | | | llvm-svn: 71074
* Tweak x86 -mcpu defaults.Daniel Dunbar2009-05-062-0/+8
| | | | | | | | | - Default to yonah on Darwin (to get SSE3). - Default to Pentium4 (32-bit) and x86-64 (64-bit) on non-Darwin. Welcome to the 21st century. llvm-svn: 71069
* Add parsing of friend specifiers.Anders Carlsson2009-05-062-0/+17
| | | | llvm-svn: 71067
* Eliminate extra vertical space in Clang diagnosticsDouglas Gregor2009-05-061-21/+3
| | | | llvm-svn: 71066
* Fix rdar://6860124 - invalid input constraint 'J' in asmChris Lattner2009-05-061-1/+9
| | | | | | | This recognizes all the target-independent constant constraints that have target-specific meanings. llvm-svn: 71064
* Improve handling of (X86) target features.Daniel Dunbar2009-05-062-96/+99
| | | | | | | | | | | | | | | | | | | | | - This is a WIP... - This adds -march= handling to the driver, and fixes the defaulting of -mcpu on Darwin (which was using the wrong test). Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as -target-feature [+-]name In clang-cc, communicate with the (clang) target to discover the legal features of a target, and the features which are enabled based on -mcpu. This is currently hardcoded just enough to not be a feature regression, we need to get this information from the backend's TableGen information somehow. This is used to construct the full list of features which are being used, which is in turn used to initialize the predefines. llvm-svn: 71061
* remove commented code.Zhongxing Xu2009-05-061-8/+0
| | | | llvm-svn: 71060
* Make StoreManager::CastRegion() virtual and implement a new CastRegion() forZhongxing Xu2009-05-061-0/+80
| | | | | | | | | RegionStore. This CastRegion() performs casts according to the kind of the region being cast instead of the type that is cast to. llvm-svn: 71058
* Add --analyze-auto.Daniel Dunbar2009-05-061-2/+3
| | | | | | | | - Currently just an alias for --analyze, eventually we want to refit --analyze so that it is less automatic (i.e., does not force plist output and does not hard code the list of checks). llvm-svn: 71056
* Fixes a bug for objc2's gc in the presense of type-casts.Fariborz Jahanian2009-05-051-1/+3
| | | | llvm-svn: 71041
* BugReporter (extensive diagnostics): improve location context generation for theTed Kremenek2009-05-051-3/+29
| | | | | | start of 'do' and '@synchronized' statements. llvm-svn: 71038
* source-level CFG: have the body for the @synchronized start with its own basicTed Kremenek2009-05-051-1/+12
| | | | | | block. This makes it a little easier for diagnostics generation. llvm-svn: 71037
* BugReporter (extensive diagnostics): Fix getEnclosingStmtLocation to reasonTed Kremenek2009-05-051-7/+8
| | | | | | | about Exprs that are not consumed and fix where the loop iteration diagnostic goes. llvm-svn: 71027
* Fix subtle bug in ParentMap::isConsumedExpr(): correctly ignore *parents* thatTed Kremenek2009-05-051-1/+1
| | | | | | are ParenExpr or CastExprs. llvm-svn: 71026
* Fix rdar://6849429 - -Wunused-value with deeply nested macro expansion ↵Chris Lattner2009-05-051-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | generates untraceable warnings The "instantiated from" messages coming from the caret diagnostics system are basically walking the macro expansion tree, emitting each level as it goes. However, it was skipping certain leaves in the tree by skipping up the entire instantiation arm every time it went up one spelling arm. This caused it to miss some things. For example, in this testcase: #define M1(x) x #define M2 1; void foo() { M1(M2) } we now print: /Users/sabre/Desktop/clang-unused-value-macro.c:6:2: warning: expression result unused M1(M2) ^~~~~~ /Users/sabre/Desktop/clang-unused-value-macro.c:6:5: note: instantiated from: M1(M2) ^~ /Users/sabre/Desktop/clang-unused-value-macro.c:3:12: note: instantiated from: #define M2 1; ^ Previously we didn't print the last line, so we never emitted the caret pointing to the 1! Incidentally, the spaces between the lines is really noisy, I think we should reconsider this heuristic (which adds them when the printed code starts too close to the start of the line). The regression test can't use -verify, because -verify doesn't catch notes for macro instantiation history. llvm-svn: 71025
* Patch to support Gnu runtime's typed selectors.Fariborz Jahanian2009-05-054-15/+72
| | | | | | Patch by David Chisnall. llvm-svn: 71023
* Implement attribute 'ns_autorelease'.Ted Kremenek2009-05-055-20/+36
| | | | llvm-svn: 70990
* Issue a warning in odd case of instance method usedFariborz Jahanian2009-05-051-0/+9
| | | | | | | in a 'Class' receiver which is not a root instance method. llvm-svn: 70987
* When defining a function whose type has no prototype, make an effortChris Lattner2009-05-051-6/+79
| | | | | | | | to go back and clean up existing uses of the bitcasted function. This is not just an optimization: it is required for correctness to get always inline functions to work, see testcases in function-attributes.c. llvm-svn: 70971
* fix some more cases where we'd emit a file with a line of 0 for implicitChris Lattner2009-05-051-5/+13
| | | | | | | types. In this case, it was objc_selector and objc_class. This fixes rdar://6852754 - clang sometimes generates incorrect/unknown file/line info for DW_TAG__structure_type dies llvm-svn: 70969
* Do not generate bogus location info for DW_TAG_inheritanceChris Lattner2009-05-051-1/+1
| | | | | | | | DIEs. We were generating a loc with line of 0 and a file. These tags do not need locations at all, just remove it. this fixes rdar://6852792 - Clang generates incorrect (and unnecessary) file and line info for DW_TAG_inheritance dies llvm-svn: 70966
* Fix generated debug info for decls with no location (which include self/_cmdChris Lattner2009-05-051-4/+10
| | | | | | | | in ObjC) to not emit file/line location information. Previously we would output a file with bogus line information. This fixes: rdar://6852814 - Clang generates incorrect file & line info for automatic/understood formal parameters for objc-programs llvm-svn: 70965
* Turns out that Sebastian already implemented the logic to compute theDouglas Gregor2009-05-053-74/+1
| | | | | | | composite pointer type, and his is better! Updated relational- and equality-operator checking accordingly. llvm-svn: 70963
* Refactor global decls to hold either a regular Decl or a CXXConstructorDecl ↵Anders Carlsson2009-05-053-20/+72
| | | | | | + ctor type or a CXXDestructorDecl + dtor type. llvm-svn: 70962
* Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').Ted Kremenek2009-05-055-10/+46
| | | | llvm-svn: 70952
* Remove an unneeded lookup routine.Daniel Dunbar2009-05-051-35/+7
| | | | llvm-svn: 70951
* Rename ownership attributes:Ted Kremenek2009-05-052-32/+25
| | | | | | | | | | ns_ownership_returns -> ns_returns_owned ns_ownership_retain -> ns_retains ns_ownership_release -> ns_releases cf_ownership_retain -> cf_retains cf_ownership_release -> cf_releases llvm-svn: 70949
* Fix unused variable warningTed Kremenek2009-05-051-1/+1
| | | | llvm-svn: 70946
* Remove possibly incorrect assertion that doesn't matter.Ted Kremenek2009-05-051-3/+0
| | | | llvm-svn: 70943
* Rename attribute 'ns_ownership_returns' to 'ns_returns_ownership'.Ted Kremenek2009-05-042-4/+4
| | | | llvm-svn: 70941
* Remove experimental attribute 'ns_ownership_make_collectable.'Ted Kremenek2009-05-045-13/+0
| | | | llvm-svn: 70940
* Provide basic support for generation of objc2's Fariborz Jahanian2009-05-042-2/+16
| | | | | | | objc_assign_global API when assigning to global objective-c object pointer. llvm-svn: 70939
* Fix the field count in interface record layout (it was incorrectlyDaniel Dunbar2009-05-042-12/+7
| | | | | | | | | | | | compensating for super classes). This was making the reported class sizes for empty classes very, very wrong. - Also, we now report the size info for an empty class like gcc (as the offset of the start, not as 0, 0). - Add a few more test cases we were mishandling before (padding bit field at end of struct, for example). llvm-svn: 70938
* Compute interface instanceStart and instanceSize using the recordDaniel Dunbar2009-05-041-25/+6
| | | | | | | | | layout. - This is much simpler / more efficient. - This also properly computes the size in the presence of bit-fields. llvm-svn: 70916
* ignore weak_import attribute on objc method decls.Fariborz Jahanian2009-05-041-2/+2
| | | | llvm-svn: 70901
* Rename attributes 'objc_ownership...' to 'ns_ownership...'.Ted Kremenek2009-05-045-49/+47
| | | | llvm-svn: 70897
* "Fix" a problem with debug info in the presence of always_inlineChris Lattner2009-05-041-2/+9
| | | | | | | | | | | | | | | | | | | function calls. For a program like this: #include <stdio.h> static __inline__ __attribute__((always_inline)) int bar(int x) { return 4; } int main() { int X = bar(4); printf("%d\n", X); } clang was not outputing any debug info for the body of main(). This is because the backend is getting confused by the region_start/end that clang is emitting for block scopes. For now, just disable these (matching llvm-gcc), this stuff is in progress of rework anyway. llvm-svn: 70889
* BugReporter (extensive diagnostics): don't mark location contexts that areTed Kremenek2009-05-041-2/+3
| | | | | | control-flow expressions as dead. llvm-svn: 70887
* Fix false positive null dereference by unifying code paths in GRSimpleVals forTed Kremenek2009-05-042-63/+24
| | | | | | | '==' and '!=' (some code in the '!=' was not replicated in the '==' code, causing some constraints to get lost). llvm-svn: 70885
* Rename attributes:Ted Kremenek2009-05-045-24/+24
| | | | | | | | | | | 'objc_ownership_cfretain' -> 'cf_ownership_retain' 'objc_ownership_cfrelease' -> 'cf_ownership_release' Motivation: Core Foundation objects can be used in isolation from Objective-C, and this forces users to reason about the separate semantics of CF objects. More Sema support pending. llvm-svn: 70884
* Remove support for ObjCMethodDecl attributes that appear between theTed Kremenek2009-05-044-52/+3
| | | | | | | | return type and the selector. This is inconsistent with C functions (where such attributes would be placed on the return type, not the the FunctionDecl), and is inconsistent with what people are use to seeing. llvm-svn: 70878
* "The attached diff fixes the //FIXME in message send to super. This should ↵Chris Lattner2009-05-041-4/+4
| | | | | | | | now be faster, and works in the presence of class posing. This is now the same approach as used in GCC (the earlier code was a quick hack to get something working)." Patch by David Chisnall! llvm-svn: 70877
OpenPOWER on IntegriCloud