summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Eliminate Sema::CheckValueInitialization; its callers now useDouglas Gregor2009-12-163-110/+181
| | | | | | | | | | | | | | InitializationSequence to perform the actual initialization. Also, introduced the notion of a tree of initialized entities, so that we can know where an initialization began when dealing with nested initializations (as occur when performing list initialization). This will, eventually, be useful for producing better diagnostics when list initialization fails, because we can show the path from the top-level object being initialized down to the actual subobject where initialization failed. llvm-svn: 91516
* More work on the FullExpr class.Anders Carlsson2009-12-161-18/+34
| | | | llvm-svn: 91513
* Teach RetainSummaryManager::getSummary(FunctionDecl* FD) that ↵Ted Kremenek2009-12-161-1/+5
| | | | | | 'FD->getIdentifier()' will not always return a non-null IdentifierInfo*. llvm-svn: 91512
* Teach OSAtomicChecker that a FunctionDecl's name isn't always a simple ↵Ted Kremenek2009-12-161-3/+7
| | | | | | IdentifierInfo*. llvm-svn: 91511
* Teach NoReturnFunctionChecker that FunctionDecl::getIdentifier() is not ↵Ted Kremenek2009-12-161-3/+2
| | | | | | guaranteed to return a non-null IdentifierInfo*. llvm-svn: 91510
* Mangle CXXOperatorCallExprs, fixes PR5796.Anders Carlsson2009-12-161-0/+10
| | | | llvm-svn: 91507
* Expose C++ methods to GRExprEngine.Zhongxing Xu2009-12-161-0/+14
| | | | llvm-svn: 91506
* Fix semantic diagnostics that embed English works, from Nicola Gigante!Douglas Gregor2009-12-169-73/+83
| | | | llvm-svn: 91503
* Add (initial?) static analyzer support for handling C++ references.Ted Kremenek2009-12-166-79/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change was a lot bigger than I originally anticipated; among other things it requires us storing more information in the CFG to record what block-level expressions need to be evaluated as lvalues. The big change is that CFGBlocks no longer contain Stmt*'s by CFGElements. Currently CFGElements just wrap Stmt*, but they also store a bit indicating whether the block-level expression should be evalauted as an lvalue. DeclStmts involving the initialization of a reference require us treating the initialization expression as an lvalue, even though that information isn't recorded in the AST. Conceptually this change isn't that complicated, but it required bubbling up the data through the CFGBuilder, to GRCoreEngine, and eventually to GRExprEngine. The addition of CFGElement is also useful for when we want to handle more control-flow constructs or other data we want to keep in the CFG that isn't represented well with just a block of statements. In GRExprEngine, this patch introduces logic for evaluating the lvalues of references, which currently retrieves the internal "pointer value" that the reference represents. EvalLoad does a two stage load to catch null dereferences involving an invalid reference (although this could possibly be caught earlier during the initialization of a reference). Symbols are currently symbolicated using the reference type, instead of a pointer type, and special handling is required creating ElementRegions that layer on SymbolicRegions (see the changes to RegionStoreManager). Along the way, the DeadStoresChecker also silences warnings involving dead stores to references. This was the original change I introduced (which I wrote test cases for) that I realized caused GRExprEngine to crash. llvm-svn: 91501
* Add an addition check for undefined behavior for when we hit aMike Stump2009-12-161-0/+2
| | | | | | __builtin_unreachable. WIP. llvm-svn: 91499
* Implement additional undefined checks for additional loads and stores. WIP.Mike Stump2009-12-163-4/+49
| | | | llvm-svn: 91498
* Check in a rudimentary FullExpr class that isn't used anywhere yet. Rename ↵Anders Carlsson2009-12-167-15/+77
| | | | | | Action::FullExpr to Action::MakeFullExpr to avoid name clashes. llvm-svn: 91494
* Successive anonymous namespaces name the same scope. I misinterpreted theJohn McCall2009-12-161-14/+35
| | | | | | standard the last time. Fixes PR5766. llvm-svn: 91493
* Switch the C++ new expression over to InitializationSequence, ratherDouglas Gregor2009-12-1610-115/+237
| | | | | | | | | | | | | | | | | | | | | than using its own partial implementation of initialization. Switched CheckInitializerTypes over to InitializedEntity/InitializationKind, to help move us closer to InitializationSequence. Added InitializedEntity::getName() to retrieve the name of the entity, for diagnostics that care about such things. Implemented support for default initialization in InitializationSequence. Clean up the determination of the "source expressions" for an initialization sequence in InitializationSequence::Perform. Taught CXXConstructExpr to store more location information. llvm-svn: 91492
* Diagnose attempting to assign to a sub-structure of an ivarFariborz Jahanian2009-12-152-4/+17
| | | | | | using objective-c property. (fixes radar 7449707) llvm-svn: 91474
* Remove ValueManager::getRegionValueSymbolValOrUnknown(). It was just extra ↵Ted Kremenek2009-12-151-7/+6
| | | | | | veneer on top of getRegionValueSymbolVal(). llvm-svn: 91471
* Link up member-class redeclarations during template instantiation.John McCall2009-12-151-0/+6
| | | | | | This test courtesy of LLVM. llvm-svn: 91462
* Fixes a code gen bug related to accessing a nowFariborz Jahanian2009-12-152-1/+4
| | | | | | | | | non-existing 'isa' field of a non-existing struct type all related to legacy type definition for 'id' which we have dropped in clang in favor of a built-in type. (fixes radar 7470820). llvm-svn: 91455
* ShouldDestroyTemporaries? I don't think so.Anders Carlsson2009-12-1510-42/+18
| | | | llvm-svn: 91450
* enable reuse of MacroArgs objects. This is a small (2.5%) win Chris Lattner2009-12-151-10/+32
| | | | | | | | | | on PR5610 (2.185 -> 2.130s). The big issue is that this is making insanely huge macro argument lists with over a million tokens in it. The reason that mallco and free are so expensive is that we are actually going to the kernel to get it, and switching to a bump pointer allocator won't change this in an interesting way. llvm-svn: 91449
* If a ParmVarDecl's default argument is a CXXExprWithTemporaries, return the ↵Anders Carlsson2009-12-152-9/+31
| | | | | | underlying expr instead. Add getNumDefaultArgTemporaries and getDefaultArgTemporary which returns the temporaries a default arg creates. llvm-svn: 91439
* Support OpenCL 1.1 odd-length vector component accessors.Nate Begeman2009-12-151-9/+1
| | | | | | | For hi/odd of an odd-length vector, the last component is undefined. Since we shuffle with an undef vector, no CodeGen needs to change to support this. llvm-svn: 91437
* Implement conditional block invocation rewriteFariborz Jahanian2009-12-151-12/+28
| | | | | | and some clean up and a block rewriter test. llvm-svn: 91435
* Fix some diagnostic-related FIXMEs, from Nicola GiganteDouglas Gregor2009-12-152-6/+5
| | | | llvm-svn: 91433
* Elaborated types are specifier types, based on a patch from CorneliusDouglas Gregor2009-12-151-0/+1
| | | | llvm-svn: 91431
* Add comments.Zhongxing Xu2009-12-151-1/+2
| | | | llvm-svn: 91430
* Remove displayProgress parameter.Zhongxing Xu2009-12-151-1/+0
| | | | llvm-svn: 91429
* update to match LLVM API change:Chris Lattner2009-12-153-19/+9
| | | | | | | | | Remove isPod() from DenseMapInfo, splitting it out to its own isPodLike type trait. This is a generally useful type trait for more than just DenseMap, and we really care about whether something acts like a pod, not whether it really is a pod. llvm-svn: 91422
* Fix a COVTCTII (crash-on-valid-that-clang-thinks-is-invalid, duh),Daniel Dunbar2009-12-151-1/+1
| | | | | | | note_previous_decl was used where note_previous_declaration was intended. Better names or PR5785 might be nice. llvm-svn: 91413
* Until we can make the dead stores checker smarter, dont' emit dead store ↵Ted Kremenek2009-12-151-0/+4
| | | | | | warnings for C++ objects (whose constructors/destructors have possible side-effects). llvm-svn: 91412
* Fix a small bug in ComputeMethodVtableIndices.Eli Friedman2009-12-151-2/+10
| | | | llvm-svn: 91411
* This patch should fix PR2461. It allows clang to apply the noreturnMike Stump2009-12-152-6/+6
| | | | | | | | | attribute to function pointers. It also fixes Sema to check function pointers for the noreturn attribute when checking for fallthrough. Patch by Chip Davis, with a slight fix to pass the testsuite. llvm-svn: 91408
* Diagnose the use of typedefs for template specialization types in the scopeJohn McCall2009-12-151-1/+20
| | | | | | | | specifiers for out-of-line declarations, e.g. typedef Temp<int> MyTemp; template <> MyTemp::foo; llvm-svn: 91395
* Don't force the emission of destructor definitions.Eli Friedman2009-12-151-3/+3
| | | | llvm-svn: 91394
* set up the machinery for a MacroArgs cache hanging off Preprocessor.Chris Lattner2009-12-153-2/+29
| | | | | | | | | We creating and free thousands of MacroArgs objects (and the related std::vectors hanging off them) for the testcase in PR5610 even though there are only ~20 live at a time. This doesn't actually use the cache yet. llvm-svn: 91391
* Start the ball rolling on C++ support in the static analyzer. ForTed Kremenek2009-12-152-0/+37
| | | | | | | | now, don't construct CFGs that contain C++ try/catch statements, and have GRExprEngine abort a path if it encounters a C++ construct it doesn't understand (which is mostly everything at this point). llvm-svn: 91389
* Fix spacing.Mike Stump2009-12-151-1/+1
| | | | llvm-svn: 91386
* Driver: Pass -resource-dir to clang -cc1, since the driver presumably ↵Daniel Dunbar2009-12-151-1/+11
| | | | | | already found itself. llvm-svn: 91384
* Ensure we preserve line information for each trap forMike Stump2009-12-151-1/+9
| | | | | | -fcatch-undefined-behavior if we aren't optimizing. WIP. llvm-svn: 91382
* Switch codegen for -fcatch-undefined-bahavior over to __builtin_trapMike Stump2009-12-154-26/+20
| | | | | | instead of abort to improve codesize and codegen. llvm-svn: 91374
* Add -resource-dir to clang -cc1, this allows the base directory for compilerDaniel Dunbar2009-12-153-15/+11
| | | | | | | resources (e.g., /usr/lib/clang/1.1) to be passed on the command line instead of computed. llvm-svn: 91370
* Implement value initialization in InitializationSequence; untestedDouglas Gregor2009-12-152-14/+71
| | | | | | WIP, yet again. llvm-svn: 91368
* Fix PR5716 by bandaging over the solution until we can come back to it.John McCall2009-12-141-1/+6
| | | | | | I apologize for friend declarations. llvm-svn: 91359
* Fix: <rdar://problem/7468209> SymbolManager::isLive() should not crash on ↵Ted Kremenek2009-12-143-3/+14
| | | | | | captured block variables that are passed by reference llvm-svn: 91348
* We have to allow one to form an address for one past the end. WIP.Mike Stump2009-12-141-1/+1
| | | | llvm-svn: 91347
* move the VarargsElided member of MacrosArgs to shrink the MacroArgs structChris Lattner2009-12-144-15/+17
| | | | | | | on 64-bit targets. Pass Preprocessor into create/destroy methods of MacroArgs even though it isn't used yet. llvm-svn: 91345
* fix typoChris Lattner2009-12-141-1/+1
| | | | llvm-svn: 91343
* Add support for detecting undefined shift behavior. WIP.Mike Stump2009-12-143-7/+27
| | | | llvm-svn: 91341
* Patch to fix 32-bit @try failure with internal assertion when compiling Fariborz Jahanian2009-12-141-2/+5
| | | | | | an Objective-C rethrow nested inside another try/catch block. (fixes radar 7466728). llvm-svn: 91335
* Minor cleanups for constructor initialization in InitializationSequenceDouglas Gregor2009-12-142-3/+3
| | | | llvm-svn: 91325
OpenPOWER on IntegriCloud