summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* When determining whether an expression refers to a bit-field, lookDouglas Gregor2009-05-024-31/+33
| | | | | | | | | into the left-hand side of an assignment expression. This completes most of PR3500; the only remaining part is to deal with the GCC-specific implementation-defined behavior for "unsigned long" (and other) bit-fields. llvm-svn: 70623
* Add CFG support for @synchronized. This fixes <rdar://problem/6848820>.Ted Kremenek2009-05-021-3/+11
| | | | llvm-svn: 70620
* When creating a dwarf record type for an objc interface, make sure to propagateChris Lattner2009-05-021-2/+6
| | | | | | | the runtime version number onto it, so that the debugger knows it's an objc interface, not a C struct. rdar://6848435 llvm-svn: 70618
* capture whether optimizations are enabled or not in debug infoChris Lattner2009-05-021-2/+2
| | | | llvm-svn: 70617
* encode the version of the objc runtime into the dwarf compile unit. ↵Chris Lattner2009-05-021-4/+11
| | | | | | | | rdar://6848435, several other fixes coming. llvm-svn: 70616
* Fix bitfield promotions in several more cases. We don't seem to work hard ↵Douglas Gregor2009-05-021-3/+20
| | | | | | enough at determining whether an expression is a bitfield or not, yet. llvm-svn: 70613
* Fix crasher in CFG construction when not properly handling ASTs that containTed Kremenek2009-05-021-44/+106
| | | | | | | expressions not yet properly handled by the CFGBuilder. This failure resulted in a null CFGBlock* being used in rare cases (causing a crash). llvm-svn: 70612
* Add Sema checking for __block on vm declarations. Radar 6441502Mike Stump2009-05-011-0/+5
| | | | llvm-svn: 70601
* When printing a source line as part of a diagnostic, the source lineDouglas Gregor2009-05-011-35/+180
| | | | | | | | | | | | | | | | | | | | | | | | might be wider than we're supposed to print. In this case, we try to select the "important" subregion of the source line, which contains everything that we want to show (e.g., with underlining and the caret itself) and tries to also contain some of the context. From the fantastically long line in the test case, we get an error message that slices down to this: message-length.c:18:120: warning: comparison of distinct pointer types ('int *' and 'float *') a_func_to_call(ip == FloatPointer, ip[ALongIndexName], ~~ ^ ~~~~~~~~~~~~ There are a bunch of gee-it-sounds-good heuristics in here, which seem to do well on the various simple tests I've thrown at it. However, we're going to need to look at a bunch more diagnostics to tweak these heuristics. This is the second part of <rdar://problem/6711348>. Almost there! llvm-svn: 70597
* It's an error to call offsetof on a non-POD type.Anders Carlsson2009-05-011-0/+7
| | | | llvm-svn: 70595
* Get rid of CXXDestroyExpr.Anders Carlsson2009-05-012-20/+6
| | | | llvm-svn: 70586
* Add a new BFS GRWorkList and make it the default worklist model forTed Kremenek2009-05-011-1/+23
| | | | | | GRCoreEngine. This tends to result in shorter paths for pathological cases. llvm-svn: 70585
* Rename CXXExprWithCleanup to CXXExprWithTemporaries.Anders Carlsson2009-05-012-8/+9
| | | | llvm-svn: 70584
* We can now call member functions where the base is a pointer.Anders Carlsson2009-05-011-4/+1
| | | | llvm-svn: 70579
* Implement -fmessage-length=N, which word-wraps diagnostics to N columns. Douglas Gregor2009-05-012-7/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | Also, put a line of whitespace between the diagnostic and the source code/caret line when the start of the actual source code text lines up (or nearly lines up) with the most recent line of the diagnostic. For example, here it's okay for the last line of the diagnostic to be (vertically) next to the source line, because there is horizontal whitespace to separate them: decl-expr-ambiguity.cpp:12:16: error: function-style cast to a builtin type can only take one argument typeof(int)(a,5)<<a; However, here is a case where we need the vertical separation (since there is no horizontal separation): message-length.c:10:46: warning: incompatible pointer types initializing 'void (int, float, char, float)', expected 'int (*)(int, float, short, float)' int (*fp1)(int, float, short, float) = f; This is part one of <rdar://problem/6711348>. llvm-svn: 70578
* Implement bit-field promotion rules for C99. Fixes PR3500.Douglas Gregor2009-05-011-4/+63
| | | | llvm-svn: 70571
* Check for method type conflict between declaration inFariborz Jahanian2009-05-012-37/+96
| | | | | | | | class/protocol and implementation which could be an imm. implementation or down in the inheritance hierarchy. llvm-svn: 70568
* Replace more release+static_cast with takeAs.Anders Carlsson2009-05-017-28/+25
| | | | llvm-svn: 70567
* Replace a bunch of static_cast + release with takeAs.Anders Carlsson2009-05-015-17/+17
| | | | llvm-svn: 70566
* StoreManager::CastRegion:Ted Kremenek2009-05-011-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't layer TypedViewRegions on top of any region except SymbolicRegions and AllocaRegions. This follows from my offline discussion within Zhongxing about how TypedViewRegions really only represent memory getting re-appropriated for a new purpose. Fallout from this change: - Move test case from xfail_rdar_6440393.m to misc-ps-64.m (it now passes). - test/Analysis/fields.c now fails for region store (crash). Marking XFAIL. - test/Analysis/rdar-6441136-region.c now fails (only runs with region store). Marking XFAIL. Diagnosis: The analyzer now correctly identifies an early out-of-bounds memory access then the one flagged: rdar-6541136-region.c:17:3: warning: Load or store into an out-of-bound memory position. *p = 1; ^~ Changing the line: char *p = (void*) &wonky[1]; to char *p = (void*) &wonky[0]; (which should delay the buffer overrun) causes region store to crash, probably because it expects a TypedViewRegion. - test/Analysis/casts.c (region store) now fails (crash). Marking XFAIL. llvm-svn: 70565
* Basic Store: Always convert a non::LocAsInteger to a Loc when storing to a ↵Ted Kremenek2009-05-011-17/+16
| | | | | | pointer. llvm-svn: 70564
* Update CMake file.Ted Kremenek2009-05-011-0/+1
| | | | llvm-svn: 70563
* Get rid of the implicit deref call when calling member functions where the ↵Anders Carlsson2009-05-011-12/+22
| | | | | | base is a pointer. llvm-svn: 70562
* teach -parse-noop about int128_t and friends.Chris Lattner2009-05-011-7/+14
| | | | llvm-svn: 70547
* BugReporter (extensive diagnostics): introduce the notion of a "dead"Ted Kremenek2009-05-011-10/+41
| | | | | | | | location context. This allows us to postpone the decision of whether or not a context should add a control-flow piece to the diagnostics when inspecting its subexpressions. llvm-svn: 70545
* Finish a thought in CheckVariableDeclaration's comment. No functionality changeDouglas Gregor2009-05-011-2/+3
| | | | llvm-svn: 70544
* Remove #if 0'ed code.Ted Kremenek2009-05-011-173/+0
| | | | llvm-svn: 70542
* PR4013 and PR4105: pointer-like types can only be cast to/from integers Eli Friedman2009-05-011-0/+11
| | | | | | and other pointer-like types. llvm-svn: 70531
* Don't assert when we think we need copy/dispose, but don't need them.Mike Stump2009-05-011-1/+2
| | | | | | Radar 6838889 llvm-svn: 70525
* Don't use indirect memory destinations for inline asm. Fixes 6841383.Anders Carlsson2009-05-011-15/+27
| | | | llvm-svn: 70523
* C++ destructors can have a single unnamed void parameter. Fixes ↵Anders Carlsson2009-04-301-1/+8
| | | | | | <rdar://problem/6841210>. llvm-svn: 70519
* Remove a warning when this file is compiled optimized.Fariborz Jahanian2009-04-301-1/+2
| | | | llvm-svn: 70518
* Rework the way we handle constructor decls to be less hacky and fix PR3948 ↵Anders Carlsson2009-04-303-23/+23
| | | | | | completely. llvm-svn: 70516
* Use of super class ivar to synthesize property is back to being error.Fariborz Jahanian2009-04-301-1/+1
| | | | llvm-svn: 70514
* retain/release checker: Hook up attributes 'objc_ownership_retain' andTed Kremenek2009-04-301-10/+20
| | | | | | 'objc_ownership_release' to the effects on receivers. llvm-svn: 70507
* Make a home for exception specs in the AST. Now Sema can hook them up.Sebastian Redl2009-04-306-13/+53
| | | | llvm-svn: 70506
* Allow attributes 'objc_ownership_retain' and 'objc_ownership_release' to beTed Kremenek2009-04-301-5/+7
| | | | | | | applied to ObjCMethodDecls, not just parameters. This allows one to specific side-effects on the receiver of a message expression. No checker support yet. llvm-svn: 70505
* Hook up Sema support for attributes on Objective-C method declarations thatTed Kremenek2009-04-304-3/+43
| | | | | | | | | | | | | appear between the return type and the selector. This is a separate code path from regular attribute processing, as we only want to (a) accept only a specific set of attributes in this place and (b) want to distinguish to clients the context in which an attribute was added to an ObjCMethodDecl. Currently, the attribute 'objc_ownership_returns' is the only attribute that uses this new feature. Shortly I will add a warning for 'objc_ownership_returns' to be placed at the end of a method declaration. llvm-svn: 70504
* Add parsing support in an Objective-C method declaration for attributes betweenTed Kremenek2009-04-301-0/+6
| | | | | | the return type and selector. Haven't hooked this up to Sema yet. llvm-svn: 70501
* Properly compute the alignment of typedefs that make use of theDouglas Gregor2009-04-302-32/+45
| | | | | | | | | | | | | | "aligned" attribute. Previously, we were skipping over these attributes when we jumped directly to the canonical type. Now, ASTContext::getTypeInfo walks through typedefs and other "non-canonical" types manually, looking for "aligned" attributes on typedefs. As part of this change, I moved the GNU-specific logic (such as determining the alignment of void or of a function pointer) out of the expression evaluator and into ASTContext::getTypeInfo. llvm-svn: 70497
* API for message dispatch of methods returning floatsFariborz Jahanian2009-04-301-5/+12
| | | | | | to match gcc's closely. llvm-svn: 70493
* Fix for PR4108: be a bit looser with the casts that we accept in Eli Friedman2009-04-301-2/+3
| | | | | | constant initializers. llvm-svn: 70483
* fix i128 to return in 2 64-bit registers (rax/rdx on x86-64)Chris Lattner2009-04-301-2/+2
| | | | llvm-svn: 70481
* only support int128_t on 64-bit and larger targets. 32-bit targets don'tChris Lattner2009-04-301-9/+12
| | | | | | have support for __divti3 and friends. llvm-svn: 70480
* Handle case in EvalReturn where we cache out in the ExplodedGraph.Ted Kremenek2009-04-301-7/+11
| | | | llvm-svn: 70475
* retain/release checker: Use the ObjCMethodDecl in the @implementation if noTed Kremenek2009-04-301-2/+4
| | | | | | matching ObjCMethodDecl exists in the @interface. llvm-svn: 70474
* retain/release checker: Resolve method decl in @interface after getting theTed Kremenek2009-04-301-3/+4
| | | | | | ObjCInterfaceDecl, not before. llvm-svn: 70473
* int128_t is apparently 128-bit aligned on all 64-bit targets, andChris Lattner2009-04-301-7/+5
| | | | | | | not supported on 32-bit targets, so we can define it to be 128-bit aligned there too :) llvm-svn: 70465
* initial support for __[u]int128_t, which should be basicallyChris Lattner2009-04-308-2/+46
| | | | | | | | compatible with VC++ and GCC. The codegen/mangling angle hasn't been fully ironed out yet. Note that we accept int128_t even in 32-bit mode, unlike gcc. llvm-svn: 70464
* Sema checking for incorrect placement of __block. Radar 6441502Mike Stump2009-04-301-1/+9
| | | | llvm-svn: 70452
OpenPOWER on IntegriCloud