summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement overloading rules for reference bindingDouglas Gregor2008-10-293-30/+114
| | | | llvm-svn: 58381
* Temporary disable the const-object-declaration-without-initializer check, ↵Douglas Gregor2008-10-291-1/+9
| | | | | | because it depends on linkage-specifier semantics we don't yet have llvm-svn: 58377
* Add notes for SCA.Zhongxing Xu2008-10-291-0/+4
| | | | llvm-svn: 58373
* Fix for PR2966: va_start/va_end use the *address* of the Eli Friedman2008-10-291-1/+1
| | | | | | | | | | | va_list, not the value. Patch fixes an assert on x86-64 and a wrong-code bug on x86. I'm not completely sure, but I think it's a regression from r58306. Does anyone run regression tests regularly on x86-64? The crash should have been picked up there. llvm-svn: 58366
* Patch by Nikita Zhuk:Ted Kremenek2008-10-291-3/+82
| | | | | | | | | The attached patch adds additional checks to -warn-objc-missing-dealloc. It checks that all ivars which are used in implementation of synthesized properties are either a) released in dealloc if the property has retain" or "copy" attribute OR b) not released in dealloc if the property has "assign" attribute llvm-svn: 58363
* IOServiceGetMatchingServices is a release function.Ted Kremenek2008-10-291-2/+14
| | | | llvm-svn: 58362
* Fix mmintrin.h to use proper definition of functions taking noDaniel Dunbar2008-10-291-2/+2
| | | | | | | | arguments. - More important than it looks, this inhibits trivial inlining otherwise. llvm-svn: 58360
* Rename: AddDecl => BindDeclZhongxing Xu2008-10-294-17/+13
| | | | | | | | BindDecl better describes what the function does: - Bind the VarDecl to its memory region - Bind the memory region to some initial value. llvm-svn: 58359
* Tweak Sema::CheckReferenceInit so that it (optionally) computes an Douglas Gregor2008-10-295-42/+111
| | | | | | | | | | | ImplicitConversionSequence and, when doing so, following the specific rules of [over.best.ics]. The computation of the implicit conversion sequences implements C++ [over.ics.ref], but we do not (yet) have ranking for implicit conversion sequences that use reference binding. llvm-svn: 58357
* Implement initialization of a reference (C++ [dcl.init.ref]) as partDouglas Gregor2008-10-2911-64/+392
| | | | | | | | | | | | | | | | | | | of copy initialization. Other pieces of the puzzle: - Try/Perform-ImplicitConversion now handles implicit conversions that don't involve references. - Try/Perform-CopyInitialization uses CheckSingleAssignmentConstraints for C. PerformCopyInitialization is now used for all argument passing and returning values from a function. - Diagnose errors with declaring references and const values without an initializer. (Uses a new Action callback, ActOnUninitializedDecl). We do not yet have implicit conversion sequences for reference binding, which means that we don't have any overloading support for reference parameters yet. llvm-svn: 58353
* Rename ExplicitCCastExpr to CStyleCastExprDouglas Gregor2008-10-288-17/+17
| | | | llvm-svn: 58331
* Replace a dyn_cast with a cast when we know the exact typeDouglas Gregor2008-10-281-1/+1
| | | | llvm-svn: 58330
* Add newline.Zhongxing Xu2008-10-281-1/+1
| | | | llvm-svn: 58322
* Update random notes.Zhongxing Xu2008-10-281-1/+7
| | | | llvm-svn: 58321
* Don't run the verifier as part of IRgen, this is now down (per module)Daniel Dunbar2008-10-282-13/+0
| | | | | | in the driver (this means we no longer run the verifier per function, however). llvm-svn: 58307
* Improve our handling of (C++) references within Clang. Specifically:Douglas Gregor2008-10-285-38/+81
| | | | | | | | | | | - Do not allow expressions to ever have reference type - Extend Expr::isLvalue to handle more cases where having written a reference into the source implies that the expression is an lvalue (e.g., function calls, C++ casts). - Make GRExprEngine::VisitCall treat the call arguments as lvalues when they are being bound to a reference parameter. llvm-svn: 58306
* Initialize Suffix and Prefix to 0, even with a bad entry. Removes an ↵Ted Kremenek2008-10-281-1/+4
| | | | | | uninitialized value warning from gcc. llvm-svn: 58305
* Add attribute always_inline support.Daniel Dunbar2008-10-283-0/+18
| | | | llvm-svn: 58304
* Mark mmintrin functions static inline, this ensures they don't end upDaniel Dunbar2008-10-281-67/+67
| | | | | | | being emitted unless needed and doesn't inhibit inlining. - Can be fixed once we implement C99 inline semantics. llvm-svn: 58303
* - Fix type-punning warning in SVals.cpp by using a real iterator class for ↵Ted Kremenek2008-10-271-11/+11
| | | | | | | | symbol_iterator. - Add symbol_iterator support for SymbolicRegions. llvm-svn: 58300
* Remove type-punning warning in GRExprEngine. No functionality change.Ted Kremenek2008-10-271-4/+7
| | | | llvm-svn: 58292
* Comment fix, ParseAST does not take ownership of the consumer.Daniel Dunbar2008-10-271-2/+1
| | | | llvm-svn: 58281
* Added preliminary support for CompoundLiterals in the static analyzer:Ted Kremenek2008-10-274-0/+67
| | | | | | | | | | | | | | | | | | | | - GRExprEngine::VisitCompoundLiteral... (1) visits the initializer list (generating ExplodedNodes) (2) creates a CompoundMemRegion for the literal (3) creates a new state with the bound literal values using GRStateManager::BindCompoundLiteral - GRStateManager::BindCompoundLiteral simply calls StoreManager::BindCompoundLiteral to get a new store and returns a persistent GRState with that store. - BasicStore::BindCompoundLiteral simply returns the same store, as it doesn't handle field sensitivity - RegionStore::BindCompoundLiteral currently fires an assert (pending discussion of how to best implement mappings for CompoundLiteralRegion). llvm-svn: 58277
* Pull determination of the super region for a VarRegion into a single ↵Ted Kremenek2008-10-271-2/+5
| | | | | | getVarRegion() method. This provides a common clean API for clients. llvm-svn: 58272
* Added CompoundLiteralRegion to represent the (temporary) memory allocated ↵Ted Kremenek2008-10-271-0/+41
| | | | | | for a compound literal. llvm-svn: 58270
* Refactor the expression class hierarchy for casts. Most importantly:Douglas Gregor2008-10-2713-72/+161
| | | | | | | | | | | | | | | | | | | | | | - CastExpr is the root of all casts - ImplicitCastExpr is (still) used for all explicit casts - ExplicitCastExpr is now the root of all *explicit* casts - ExplicitCCastExpr (new name needed!?) is a C-style cast in C or C++ - CXXFunctionalCastExpr inherits from ExplicitCastExpr - CXXNamedCastExpr inherits from ExplicitCastExpr and is the root of all of the C++ named cast expression types (static_cast, dynamic_cast, etc.) - Added classes CXXStaticCastExpr, CXXDynamicCastExpr, CXXReinterpretCastExpr, and CXXConstCastExpr to Also, fixed returned-stack-addr.cpp, which broke once when we fixed reinterpret_cast to diagnose double->int* conversions and again when we eliminated implicit conversions to reference types. The fix is in both testcase and SemaChecking.cpp. Most of this patch is simply support for the renaming. There's very little actual change in semantics. llvm-svn: 58264
* - Move ExprIterator to Stmt.h so that it can be used by classes defined in ↵Ted Kremenek2008-10-272-2/+32
| | | | | | | | | Stmt.h - Implement child_begin() and child_end() for AsmStmt. Previously these had stub implementations that did not iterate over the input/output operands of an inline assembly statement. - Use ExprIterator for performing iteration over input/output operands. llvm-svn: 58261
* Use ASTContext::getCanonicalType() to get TypedRegion's type.Zhongxing Xu2008-10-271-1/+1
| | | | llvm-svn: 58247
* An ElementRegion is really a typed region. Its super region's type has to be ↵Zhongxing Xu2008-10-271-0/+7
| | | | | | ArrayType. llvm-svn: 58245
* When destroying a translation unit, deallocate its owned declarations in ↵Douglas Gregor2008-10-271-1/+3
| | | | | | reverse order, because there may be dependencies among the declarations. llvm-svn: 58244
* We cannot get precise lvalue for symbolic base array region.Zhongxing Xu2008-10-271-0/+3
| | | | llvm-svn: 58243
* Replace common diagnostic with a convenience function.Steve Naroff2008-10-272-38/+25
| | | | | | This simplifies debug of this particular diagnostic (and removes some code clutter). llvm-svn: 58242
* Fix <rdar://problem/6315646> clang on xcode: error: invalid operands to ↵Steve Naroff2008-10-271-5/+8
| | | | | | | | binary expression ('id<NSTableViewDelegate>' and 'XCExtendedArrayController *'). There is still a bug here (as the FIXME in the test case indicates). Prior to this patch, the bug would generate an error. Now, we simply do nothing (which is less harmful until we can get it right). The complete bug fix will require changing ASTContext::mergeTypes(), which I'd like to defer for now. llvm-svn: 58241
* Get the canonical type for struct initialization. The original code would ↵Zhongxing Xu2008-10-271-1/+5
| | | | | | crash on TypedefType. llvm-svn: 58236
* Only loc::MemRegionVal can be modified. This avoids crashing in RegionStore ↵Zhongxing Xu2008-10-271-1/+1
| | | | | | when a function pointer is used as an argument. llvm-svn: 58233
* Rename Characteristic_t to CharacteristicKindChris Lattner2008-10-274-5/+5
| | | | llvm-svn: 58224
* Fix the definition of __builtin_va_list on PPC, which was set to the V4 ABI, ↵Chris Lattner2008-10-271-2/+4
| | | | | | | | not the darwin or AIX abis. This fixes PR2904. llvm-svn: 58222
* make codegen reject initializes with designators, like this:Chris Lattner2008-10-263-2/+24
| | | | | | | | t.c:1:13: error: cannot codegen this designators yet int a[10] = {2, 4, [8]=9, 10}; ^~~~~~~~~~~~~~~~~ llvm-svn: 58220
* Remember whether an initlist had a designator in the AST.Chris Lattner2008-10-263-8/+10
| | | | llvm-svn: 58218
* pass designators into sema. This completes parser-level designatorChris Lattner2008-10-263-11/+15
| | | | | | support as far as I know. llvm-svn: 58217
* implement some more FIXMEs, by rejecting more bogus stuff inChris Lattner2008-10-261-4/+25
| | | | | | objc mode. llvm-svn: 58216
* add some simple designator testcases. Reject things like this:Chris Lattner2008-10-261-6/+10
| | | | | | | | | | | struct foo Y[10] = { [4] .arr [2] 4 // expected-error {{expected '=' or another designator}} }; because the "missing equals" extension only is valid if there is exactly one array designator. llvm-svn: 58215
* improve comments, build array and array range designator nodes, Chris Lattner2008-10-261-7/+23
| | | | | | fix an obscure memory leak. llvm-svn: 58213
* improve comments, build a Designation for field designators andChris Lattner2008-10-261-9/+26
| | | | | | improve diagnostic for a malformed field designator. llvm-svn: 58212
* restructure ParseInitializerWithPotentialDesignator to make itChris Lattner2008-10-261-76/+75
| | | | | | easier to understand and hack on, no functionality change. llvm-svn: 58210
* improve MayBeDesignationStart to do the entire determination Chris Lattner2008-10-261-17/+12
| | | | | | about whether a leading identifier is a designator. llvm-svn: 58207
* inline the decision logic that chooses between an assign expr and braceChris Lattner2008-10-261-8/+4
| | | | | | | initializer, avoiding an extra level of calls for silly things like 'int x = 4'. llvm-svn: 58206
* This patch continues parser-level implementation of designators:Chris Lattner2008-10-261-23/+41
| | | | | | | | | | | 1. It introduces new parser level abstractions for designators that are used to communicate between parser and sema. 2. This fixes a FIXME where "identifier ':'" was considered to be a designator even if it wasn't the first in a designator list. 3. In the "identifier ':'" case, it actually builds the designator representation. llvm-svn: 58205
* minor cleanupsChris Lattner2008-10-261-3/+5
| | | | llvm-svn: 58203
* Don't give a default argument to ASTContext::getFunctionType for the ↵Argyrios Kyrtzidis2008-10-265-8/+14
| | | | | | | | | TypeQuals parameter, it causes subtle bugs where TypeQuals, while necessary, are omitted from the call. -Remove the default argument. -Update all call sites of ASTContext::getFunctionType. llvm-svn: 58187
OpenPOWER on IntegriCloud