summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* If a virtual member function has the 'final' attribute, we can devirtualize ↵Anders Carlsson2010-10-271-4/+11
| | | | | | calls to it. llvm-svn: 117444
* Add helper for extracting the CXXRecordDecl for the implicit argument toChandler Carruth2010-10-271-0/+11
| | | | | | | a member call expression. This has proved to be a common pattern for users of RecursiveASTVisitor. llvm-svn: 117439
* If visiting RHS causes us to finish 'Block', e.g. the RHS is a StmtExprZhongxing Xu2010-10-271-3/+8
| | | | | | | | | containing a DoStmt, and the LHS doesn't create a new block, then we should return RBlock. Otherwise we'll incorrectly return NULL. Also relax an assertion in VisitWhileStmt(). Reset 'Block' when it is finished. llvm-svn: 117436
* Avoid calculating linkage until the more obvious checks have run whenJohn McCall2010-10-271-15/+18
| | | | | | deciding whether to queue a decl for unused-declaration warnings. llvm-svn: 117431
* Don't compute linkage for a declaration as part of the #pragma weakJohn McCall2010-10-271-8/+12
| | | | | | | forward-declaration support unless there's really a mapping for that name. llvm-svn: 117426
* Add support for code completion on stdin.Dan Gohman2010-10-261-1/+4
| | | | llvm-svn: 117414
* Patch to provide guard when initializing instancesFariborz Jahanian2010-10-262-2/+15
| | | | | | | of static data member of a class template. Fixes //rdar :// 8562966 and pr8409. llvm-svn: 117410
* Extract procedures to do scalar-to-memory and memory-to-scalar conversionsJohn McCall2010-10-263-85/+128
| | | | | | | in IR gen, and use those to fix a correctness issue with bool atomic intrinsics. rdar://problem/8461234 llvm-svn: 117403
* Simplify this code: don't check for the same error twoDan Gohman2010-10-261-4/+6
| | | | | | | different ways. Check once, and use an assert to handle consistency checking. llvm-svn: 117397
* getOrCreateContentCache never returns null, so overrideFileContentsDan Gohman2010-10-261-4/+2
| | | | | | doesn't need its return value. llvm-svn: 117393
* Factor out the code for emitting code to load vtable pointer membersDan Gohman2010-10-264-15/+16
| | | | | | so that it's done in one place. llvm-svn: 117386
* Teach typo correction not to return the same keyword that matches aDouglas Gregor2010-10-261-1/+20
| | | | | | | | typo. This can happen with context-sensitive keywords like "super", when typo correction didn't know that "super" wasn't permitted in this context. llvm-svn: 117372
* Optimize field space usage in CompoundStmt, LabelStmt, Expr, and CastExpr.John McCall2010-10-262-20/+22
| | | | | | | | | There's probably still significant padding waste on x86-64 UNIXen, but the difference in 32-bit compiles should be significant. There are a lot of Expr nodes left that could lose a word this way. llvm-svn: 117359
* No really, we don't have a retain/release system for statements/expressionsJohn McCall2010-10-2612-137/+117
| | | | | | anymore. llvm-svn: 117357
* Actually, that doesn't really work, and anyway we should chooseJohn McCall2010-10-261-10/+1
| | | | | | conversion to id over conversion to void*. llvm-svn: 117355
* Consider conversions of Objective-C pointers to 'id' to be basically ofJohn McCall2010-10-261-1/+10
| | | | | | | | | | the same rank as conversions of normal pointers to 'void*'. Also, resurrect a test case. Fixes rdar://problem/8592139 llvm-svn: 117354
* Delay complete-type checking for arguments to no-prototype functionsDouglas Gregor2010-10-261-12/+6
| | | | | | | | until after we've checked/promoted the argument. Hopefully fixes the Emacs regression due to my recent change that expanded type-checking in the presence of K&R function definitions. llvm-svn: 117353
* A couple of tweaks to the visibility rules: John McCall2010-10-262-3/+22
| | | | | | | | | | | - tags with C linkage should ignore visibility=hidden - functions and variables with explicit visibility attributes should ignore the linkage of their types Either of these should be sufficient to fix PR8457. Also, FileCheck-ize a test case. llvm-svn: 117351
* Pending further discussion, re-enable warnings for Objective CJohn McCall2010-10-261-10/+20
| | | | | | | | | | | covariant/contravariant overrides and implementations, but do so under control of a new flag (-Wno-objc-covariant-overrides, which yes does cover contravariance too). *At least* the covariance cases will probably be enabled by default shortly, but that's not totally uncontroversial. llvm-svn: 117346
* When de-serializing a type that is supposed to be canonical, callDouglas Gregor2010-10-262-22/+27
| | | | | | | | | | | | | getCanonicalType() to make sure that the type we got back is actually canonical. This is the case for most types, which always build a canonical type when given canonical components. However, some types that involve expressions in their canonicalization (e.g., array types with dependent sizes) don't always build canonical types from canonical components, because there is no such thing as a "canonical" expression. Therefore, we do this extra mapping to ensure that the canonical types we store are actually canonical. llvm-svn: 117344
* Fix lazy symbolication bug in RegionStore involving fields of global ↵Ted Kremenek2010-10-261-4/+14
| | | | | | | | | | | variables. When invalidated, the entire globals memory space gets assigned a symbolic value, but that value was not being used for lazy symbolication of fields of globals. This could result in cases where bogus null dereferences were being reported. Fixes PR 8440. llvm-svn: 117336
* Move 'includeGlobals' as a field into ClusterAnalysis.Ted Kremenek2010-10-261-8/+12
| | | | llvm-svn: 117335
* Tweak null dereference checker to give better diagnostics for null ↵Ted Kremenek2010-10-261-19/+47
| | | | | | dereferences resulting from array accesses. llvm-svn: 117334
* Add infrastructure for emitting TBAA metadata with the "constant" flag.Dan Gohman2010-10-252-4/+16
| | | | llvm-svn: 117328
* Patch for mis-compile of statement expressions withFariborz Jahanian2010-10-251-6/+28
| | | | | | | non-trivial copy constructors. // rdar: //8540501. A test will be added to llvm nightly tests. llvm-svn: 117324
* Trim an unnecessary #include.Dan Gohman2010-10-251-1/+0
| | | | llvm-svn: 117321
* Factor out the code for creating the Root and Char nodes, so thatDan Gohman2010-10-252-26/+37
| | | | | | they can be used outside of the main getTBAAInfo function. llvm-svn: 117320
* Look through the address-of operator to find the function beingDouglas Gregor2010-10-251-0/+4
| | | | | | called. Fixes another aspect of PR8314. llvm-svn: 117308
* When we're calling a function that we know based on its K&R-styleDouglas Gregor2010-10-251-10/+37
| | | | | | | | function definition, we should still use a prototype to type-check and convert the function arguments, if such a prototype exists. Fixes PR8314. llvm-svn: 117305
* Add check for UnknownVals for mutexes in ObjCAtSyncChecker. Fixes crash ↵Ted Kremenek2010-10-251-0/+3
| | | | | | reported in PR 8458. llvm-svn: 117300
* Only warn for mismatched types in Objective-C methods when they are ↵David Chisnall2010-10-251-4/+94
| | | | | | | | | | incompatible, not when they are simply different. Now we test whether the difference in types breaks the principle of substitutability, rather than whether they are different. A common idiom in Objective-C is to provide a definition of a method in a subclass that returns a more-specified version of an object than the superclass. This does not violate the principle of substitutability, because you can always use the object returned by the subclass anywhere that you could use the type returned by the superclass. It was, however, generating warnings with clang, leading people to believe that semantically correct code was incorrect and requiring less accurate type specification and explicit down-casts (neither of which is a good thing to encourage). This change ensures that any method definition has parameter and return types that make it accept anything that something conforming to the declaration may pass and return something that the caller will expect, but allows stricter definitions. llvm-svn: 117271
* Improve the tracking of source locations for parentheses in constructor calls.Chandler Carruth2010-10-257-43/+68
| | | | | | | | | | | | This adds them where missing, and traces them through PCH. We fix at least one bug in the extents found by the Index library, and make a lot of refactoring tools which care about the exact formulation of a constructor call easier to write. Also some minor cleanups to more consistently follow the friend pattern instead of the setter pattern when rebuilding a serialized AST. Patch originally by Samuel Benzaquen. llvm-svn: 117254
* Added generation of destructors for member constant size arrays.Marcin Swiderski2010-10-251-2/+15
| | | | | | There's only one destructor call generated for each not empty array (at least for now this should be enough). llvm-svn: 117252
* Added generation of destructors for constant size arrays.Marcin Swiderski2010-10-251-2/+10
| | | | | | There's only one destructor call generated for each not empty array (at least for now this should be enough). llvm-svn: 117251
* Implement GNU C extension: two types are compatible if they appearPeter Collingbourne2010-10-241-2/+46
| | | | | | | as a function argument, one of the types is a transparent union type and the other type is compatible with a union member llvm-svn: 117243
* Keep track in chained PCH of implicit members that were added after the ↵Argyrios Kyrtzidis2010-10-244-7/+25
| | | | | | definition was completed. llvm-svn: 117240
* Start fleshing out ASTMutationListener; notify when a tag definition is ↵Argyrios Kyrtzidis2010-10-244-1/+50
| | | | | | | | | completed. In that case a chained PCH will record the updates to the DefinitionData pointer of forward references. If a forward reference mutated into a definition re-write it into the chained PCH, this is too big of a change. llvm-svn: 117239
* Introduce a DeclsToRewrite field in ASTWrite, used for collecting the decls ↵Argyrios Kyrtzidis2010-10-241-0/+7
| | | | | | that will be replaced in the chained PCH. llvm-svn: 117238
* Some method renaming, no functionality change.Argyrios Kyrtzidis2010-10-241-4/+4
| | | | llvm-svn: 117237
* Refactoring.Argyrios Kyrtzidis2010-10-243-82/+96
| | | | | | | - Pass around RecordDataImpl instead of the concrete RecordData so that any SmallVector can be used. - Move ASTDeclWriter::WriteCXXDefinitionData to ASTWriter::AddCXXDefinitionData. llvm-svn: 117236
* Put the mechanism in place to track modifications in an AST entity that were ↵Argyrios Kyrtzidis2010-10-248-16/+104
| | | | | | | | | | | | committed after its initial creation/deserialization and store the changes in a chained PCH. The idea is that the AST entities call methods on the ASTMutationListener to give notifications of changes; the PCHWriter implements the ASTMutationListener interface and stores the incremental changes of the updated entity. WIP llvm-svn: 117235
* Simplify and "robust-ify" the way that CXXRecord references point to the ↵Argyrios Kyrtzidis2010-10-243-58/+35
| | | | | | | | definition data when loaded from PCH. Temporary disable 'test/PCH/chain-cxx.cpp' until a better way to fix it is in place. llvm-svn: 117234
* Minor refactoring; Pull reading/writing DefinitionData out into a function.Argyrios Kyrtzidis2010-10-242-89/+96
| | | | llvm-svn: 117233
* - Fixed subexpressions evaluation order for binary operators to match order ↵Marcin Swiderski2010-10-241-7/+9
| | | | | | | | in code generated with the compiler, - Fixed test cases for unreachable code warnings produced by Sema. llvm-svn: 117220
* C++ [basic.scope.hiding] allows an ordinary name to hide a non-tagDouglas Gregor2010-10-231-2/+7
| | | | | | | name *in the same scope*, but not across scopes. Implement the highlighted condition. llvm-svn: 117212
* Update remaining attribute macros to new style.Chandler Carruth2010-10-232-5/+3
| | | | llvm-svn: 117204
* Update to use 'LLVM_*' macro names for attributes.Chandler Carruth2010-10-231-2/+2
| | | | llvm-svn: 117201
* Warn if a variable marked with the "unused" attribute is used. Patch by ↵Anders Carlsson2010-10-222-1/+9
| | | | | | Darin Adler! llvm-svn: 117184
* Parse attributes on enumerators and instantiate attributes on enum decls.John McCall2010-10-223-9/+20
| | | | llvm-svn: 117182
* In the presence of using declarations, we can find the same classDouglas Gregor2010-10-221-30/+66
| | | | | | | | members in class subobjects of different types. So long as the underlying declaration sets are the same, and the declaration sets involve non-instance members, this is not an ambiguity. llvm-svn: 117163
OpenPOWER on IntegriCloud