]> granicus.if.org Git - clang/log
clang
13 years agoSomething is seriously wonky with this test
Douglas Gregor [Tue, 26 Oct 2010 18:25:19 +0000 (18:25 +0000)]
Something is seriously wonky with this test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117381 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix silly typo
Douglas Gregor [Tue, 26 Oct 2010 17:32:59 +0000 (17:32 +0000)]
Fix silly typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117373 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach typo correction not to return the same keyword that matches a
Douglas Gregor [Tue, 26 Oct 2010 17:18:00 +0000 (17:18 +0000)]
Teach typo correction not to return the same keyword that matches a
typo. This can happen with context-sensitive keywords like "super",
when typo correction didn't know that "super" wasn't permitted in this
context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117372 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoOptimize field space usage in CompoundStmt, LabelStmt, Expr, and CastExpr.
John McCall [Tue, 26 Oct 2010 08:39:16 +0000 (08:39 +0000)]
Optimize field space usage in CompoundStmt, LabelStmt, Expr, and CastExpr.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117359 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoNo really, we don't have a retain/release system for statements/expressions
John McCall [Tue, 26 Oct 2010 07:05:15 +0000 (07:05 +0000)]
No really, we don't have a retain/release system for statements/expressions
anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117357 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCookie crumbs.
John McCall [Tue, 26 Oct 2010 06:41:10 +0000 (06:41 +0000)]
Cookie crumbs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117356 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoActually, that doesn't really work, and anyway we should choose
John McCall [Tue, 26 Oct 2010 06:40:27 +0000 (06:40 +0000)]
Actually, that doesn't really work, and anyway we should choose
conversion to id over conversion to void*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117355 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoConsider conversions of Objective-C pointers to 'id' to be basically of
John McCall [Tue, 26 Oct 2010 06:23:29 +0000 (06:23 +0000)]
Consider conversions of Objective-C pointers to 'id' to be basically of
the same rank as conversions of normal pointers to 'void*'.

Also, resurrect a test case.

Fixes rdar://problem/8592139

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117354 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDelay complete-type checking for arguments to no-prototype functions
Douglas Gregor [Tue, 26 Oct 2010 05:45:40 +0000 (05:45 +0000)]
Delay complete-type checking for arguments to no-prototype functions
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117353 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoA couple of tweaks to the visibility rules:
John McCall [Tue, 26 Oct 2010 04:59:26 +0000 (04:59 +0000)]
A couple of tweaks to the visibility rules:
  - 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117351 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPending further discussion, re-enable warnings for Objective C
John McCall [Tue, 26 Oct 2010 00:53:53 +0000 (00:53 +0000)]
Pending further discussion, re-enable warnings for Objective C
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117346 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen de-serializing a type that is supposed to be canonical, call
Douglas Gregor [Tue, 26 Oct 2010 00:51:02 +0000 (00:51 +0000)]
When de-serializing a type that is supposed to be canonical, call
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117344 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix lazy symbolication bug in RegionStore involving fields of global variables. ...
Ted Kremenek [Tue, 26 Oct 2010 00:06:17 +0000 (00:06 +0000)]
Fix lazy symbolication bug in RegionStore involving fields of global 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117336 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove 'includeGlobals' as a field into ClusterAnalysis.
Ted Kremenek [Tue, 26 Oct 2010 00:06:15 +0000 (00:06 +0000)]
Move 'includeGlobals' as a field into ClusterAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117335 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTweak null dereference checker to give better diagnostics for null dereferences resul...
Ted Kremenek [Tue, 26 Oct 2010 00:06:13 +0000 (00:06 +0000)]
Tweak null dereference checker to give better diagnostics for null dereferences resulting from array accesses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117334 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd infrastructure for emitting TBAA metadata with the "constant" flag.
Dan Gohman [Mon, 25 Oct 2010 23:51:23 +0000 (23:51 +0000)]
Add infrastructure for emitting TBAA metadata with the "constant" flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117328 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPatch for mis-compile of statement expressions with
Fariborz Jahanian [Mon, 25 Oct 2010 23:27:26 +0000 (23:27 +0000)]
Patch for mis-compile of statement expressions with
non-trivial copy constructors. // rdar: //8540501.
A test will be added to llvm nightly tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117324 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTrim an unnecessary #include.
Dan Gohman [Mon, 25 Oct 2010 21:59:29 +0000 (21:59 +0000)]
Trim an unnecessary #include.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117321 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFactor out the code for creating the Root and Char nodes, so that
Dan Gohman [Mon, 25 Oct 2010 21:48:30 +0000 (21:48 +0000)]
Factor out the code for creating the Root and Char nodes, so that
they can be used outside of the main getTBAAInfo function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117320 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd and describe a quick script to migrate gcc builtins that clang doesn't
Eric Christopher [Mon, 25 Oct 2010 21:17:59 +0000 (21:17 +0000)]
Add and describe a quick script to migrate gcc builtins that clang doesn't
know about to the default APIs for x86 vector operations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117313 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLook through the address-of operator to find the function being
Douglas Gregor [Mon, 25 Oct 2010 20:48:33 +0000 (20:48 +0000)]
Look through the address-of operator to find the function being
called. Fixes another aspect of PR8314.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117308 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen we're calling a function that we know based on its K&R-style
Douglas Gregor [Mon, 25 Oct 2010 20:39:23 +0000 (20:39 +0000)]
When we're calling a function that we know based on its K&R-style
function definition, we should still use a prototype to type-check and
convert the function arguments, if such a prototype exists. Fixes
PR8314.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117305 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd check for UnknownVals for mutexes in ObjCAtSyncChecker. Fixes crash reported...
Ted Kremenek [Mon, 25 Oct 2010 20:20:56 +0000 (20:20 +0000)]
Add check for UnknownVals for mutexes in ObjCAtSyncChecker.  Fixes crash reported in PR 8458.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117300 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoOnly warn for mismatched types in Objective-C methods when they are incompatible...
David Chisnall [Mon, 25 Oct 2010 17:23:52 +0000 (17:23 +0000)]
Only warn for mismatched types in Objective-C methods when they are 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117271 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImprove the tracking of source locations for parentheses in constructor calls.
Chandler Carruth [Mon, 25 Oct 2010 08:47:36 +0000 (08:47 +0000)]
Improve the tracking of source locations for parentheses in constructor calls.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117254 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdded generation of destructors for member constant size arrays.
Marcin Swiderski [Mon, 25 Oct 2010 07:05:54 +0000 (07:05 +0000)]
Added generation of destructors for member constant size arrays.
There's only one destructor call generated for each not empty array (at least for now this should be enough).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117252 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdded generation of destructors for constant size arrays.
Marcin Swiderski [Mon, 25 Oct 2010 07:00:40 +0000 (07:00 +0000)]
Added generation of destructors for constant size arrays.
There's only one destructor call generated for each not empty array (at least for now this should be enough).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117251 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement GNU C extension: two types are compatible if they appear
Peter Collingbourne [Sun, 24 Oct 2010 18:30:18 +0000 (18:30 +0000)]
Implement GNU C extension: two types are compatible if they appear
as a function argument, one of the types is a transparent union type
and the other type is compatible with a union member

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117243 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKeep track in chained PCH of implicit members that were added after the definition...
Argyrios Kyrtzidis [Sun, 24 Oct 2010 17:26:54 +0000 (17:26 +0000)]
Keep track in chained PCH of implicit members that were added after the definition was completed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117240 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStart fleshing out ASTMutationListener; notify when a tag definition is completed.
Argyrios Kyrtzidis [Sun, 24 Oct 2010 17:26:50 +0000 (17:26 +0000)]
Start fleshing out ASTMutationListener; notify when a tag definition is 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117239 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce a DeclsToRewrite field in ASTWrite, used for collecting the decls that...
Argyrios Kyrtzidis [Sun, 24 Oct 2010 17:26:46 +0000 (17:26 +0000)]
Introduce a DeclsToRewrite field in ASTWrite, used for collecting the decls that will be replaced in the chained PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117238 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSome method renaming, no functionality change.
Argyrios Kyrtzidis [Sun, 24 Oct 2010 17:26:43 +0000 (17:26 +0000)]
Some method renaming, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117237 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRefactoring.
Argyrios Kyrtzidis [Sun, 24 Oct 2010 17:26:40 +0000 (17:26 +0000)]
Refactoring.
- Pass around RecordDataImpl instead of the concrete RecordData so that any SmallVector can be used.
- Move ASTDeclWriter::WriteCXXDefinitionData to ASTWriter::AddCXXDefinitionData.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117236 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPut the mechanism in place to track modifications in an AST entity that were committe...
Argyrios Kyrtzidis [Sun, 24 Oct 2010 17:26:36 +0000 (17:26 +0000)]
Put the mechanism in place to track modifications in an AST entity that were 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117235 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSimplify and "robust-ify" the way that CXXRecord references point to the definition...
Argyrios Kyrtzidis [Sun, 24 Oct 2010 17:26:31 +0000 (17:26 +0000)]
Simplify and "robust-ify" the way that CXXRecord references point to the definition data when loaded from PCH.

Temporary disable 'test/PCH/chain-cxx.cpp' until a better way to fix it is in place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117234 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMinor refactoring; Pull reading/writing DefinitionData out into a function.
Argyrios Kyrtzidis [Sun, 24 Oct 2010 17:26:27 +0000 (17:26 +0000)]
Minor refactoring; Pull reading/writing DefinitionData out into a function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117233 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix tyop.
Anders Carlsson [Sun, 24 Oct 2010 12:51:00 +0000 (12:51 +0000)]
Fix tyop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117225 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago- Fixed subexpressions evaluation order for binary operators to match order in code...
Marcin Swiderski [Sun, 24 Oct 2010 08:21:40 +0000 (08:21 +0000)]
- Fixed subexpressions evaluation order for binary operators to match order in code generated with the compiler,
- Fixed test cases for unreachable code warnings produced by Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117220 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove the "used but marked unused" warning behind a special warning flag for now.
Anders Carlsson [Sun, 24 Oct 2010 04:28:00 +0000 (04:28 +0000)]
Move the "used but marked unused" warning behind a special warning flag for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117219 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoC++ [basic.scope.hiding] allows an ordinary name to hide a non-tag
Douglas Gregor [Sat, 23 Oct 2010 16:06:17 +0000 (16:06 +0000)]
C++ [basic.scope.hiding] allows an ordinary name to hide a non-tag
name *in the same scope*, but not across scopes. Implement the
highlighted condition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117212 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate remaining attribute macros to new style.
Chandler Carruth [Sat, 23 Oct 2010 08:44:57 +0000 (08:44 +0000)]
Update remaining attribute macros to new style.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117204 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate to use 'LLVM_*' macro names for attributes.
Chandler Carruth [Sat, 23 Oct 2010 08:21:37 +0000 (08:21 +0000)]
Update to use 'LLVM_*' macro names for attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117201 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWarn if a variable marked with the "unused" attribute is used. Patch by Darin Adler!
Anders Carlsson [Fri, 22 Oct 2010 23:37:08 +0000 (23:37 +0000)]
Warn if a variable marked with the "unused" attribute is used. Patch by Darin Adler!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117184 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoParse attributes on enumerators and instantiate attributes on enum decls.
John McCall [Fri, 22 Oct 2010 23:36:17 +0000 (23:36 +0000)]
Parse attributes on enumerators and instantiate attributes on enum decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117182 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMinor tweak so that fixit-errors.c is never compiled; it crashes and pops up a crash...
Anders Carlsson [Fri, 22 Oct 2010 23:35:40 +0000 (23:35 +0000)]
Minor tweak so that fixit-errors.c is never compiled; it crashes and pops up a crash dialog on my system.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117181 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate compatibility page for objective-c.
Fariborz Jahanian [Fri, 22 Oct 2010 22:35:51 +0000 (22:35 +0000)]
Update compatibility page for objective-c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117168 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach clang_getCursorReferenced() and friends about BlockDeclRefExprs.
Douglas Gregor [Fri, 22 Oct 2010 22:24:08 +0000 (22:24 +0000)]
Teach clang_getCursorReferenced() and friends about BlockDeclRefExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117167 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn the presence of using declarations, we can find the same class
Douglas Gregor [Fri, 22 Oct 2010 22:08:47 +0000 (22:08 +0000)]
In the presence of using declarations, we can find the same class
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117163 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a horrible bug in all dataflow analyses that use CFGRecStmtVisitor (including...
Ted Kremenek [Fri, 22 Oct 2010 22:08:32 +0000 (22:08 +0000)]
Fix a horrible bug in all dataflow analyses that use CFGRecStmtVisitor (including live variables analysis).
We shouldn't recurse into CompoundStmts since they are already inlined in the CFG.  This could result in
bogus dead stores warnings (among other things).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117162 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix '-analyzer-display-progress' for Objective-C methods. Also remove obsolete code.
Ted Kremenek [Fri, 22 Oct 2010 22:08:29 +0000 (22:08 +0000)]
Fix '-analyzer-display-progress' for Objective-C methods.  Also remove obsolete code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117161 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTest emoved.
Fariborz Jahanian [Fri, 22 Oct 2010 22:05:40 +0000 (22:05 +0000)]
Test emoved.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117160 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAfter discussion with Doug and John, I am reverting
Fariborz Jahanian [Fri, 22 Oct 2010 22:05:03 +0000 (22:05 +0000)]
After discussion with Doug and John, I am reverting
the patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117159 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange handling of inline asm 'p' constraint to match llvm-gcc.
Dale Johannesen [Fri, 22 Oct 2010 21:07:10 +0000 (21:07 +0000)]
Change handling of inline asm 'p' constraint to match llvm-gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117149 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSubstantially revise how clang computes the visibility of a declaration to
John McCall [Fri, 22 Oct 2010 21:05:15 +0000 (21:05 +0000)]
Substantially revise how clang computes the visibility of a declaration to
more closely parallel the computation of linkage.  This gets us to a state
much closer to what gcc emits, modulo bugs, which will undoubtedly arise in
abundance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117147 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPatch fixes miscompile with non-trivial copy constructors and
Fariborz Jahanian [Fri, 22 Oct 2010 21:01:02 +0000 (21:01 +0000)]
Patch fixes miscompile with non-trivial copy constructors and
statement expressions, //rdar: //8540501

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117146 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDelay record type's debug info emission, in -flimit-debug-info mode, if member expres...
Devang Patel [Fri, 22 Oct 2010 18:56:27 +0000 (18:56 +0000)]
Delay record type's debug info emission, in -flimit-debug-info mode, if member expression's base is call expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117127 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert unintentional check-in.
Devang Patel [Fri, 22 Oct 2010 18:31:12 +0000 (18:31 +0000)]
Revert unintentional check-in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117120 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen we perform name lookup for a template, we may end up finding an
Douglas Gregor [Fri, 22 Oct 2010 17:36:51 +0000 (17:36 +0000)]
When we perform name lookup for a template, we may end up finding an
ambiguous name where none of the declarations found are actually
templates. In this case, make sure we clear out the ambiguous-path
data when recomputing the lookup result kind. Fixes PR8439.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117112 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't try to guess svn version when current path is a symlink.
Oscar Fuentes [Fri, 22 Oct 2010 17:16:39 +0000 (17:16 +0000)]
Don't try to guess svn version when current path is a symlink.

See PR 8473.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117110 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTidy up MIPS_linkage name. Provide it only if it does not match regular name, otherwi...
Devang Patel [Fri, 22 Oct 2010 17:11:50 +0000 (17:11 +0000)]
Tidy up MIPS_linkage name. Provide it only if it does not match regular name, otherwise it confuses debugger.
This is tested by local.C in llvmgcc testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117107 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore class anonymization.
Benjamin Kramer [Fri, 22 Oct 2010 16:48:22 +0000 (16:48 +0000)]
More class anonymization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117106 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove classes into anonymous namespaces.
Benjamin Kramer [Fri, 22 Oct 2010 16:33:16 +0000 (16:33 +0000)]
Move classes into anonymous namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117104 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen performing name lookup for a namespace definition, only look into
Douglas Gregor [Fri, 22 Oct 2010 15:24:46 +0000 (15:24 +0000)]
When performing name lookup for a namespace definition, only look into
the current context's redeclaration context, ignoring using
directives. Fixes PR8430.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117097 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach the C++ simple-type-specifier parser and tentative parses about
Douglas Gregor [Thu, 21 Oct 2010 23:17:00 +0000 (23:17 +0000)]
Teach the C++ simple-type-specifier parser and tentative parses about
protocol-qualified types such as id<Protocol>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117081 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate clang_getCursor() test to check searches on include directives
Douglas Gregor [Thu, 21 Oct 2010 20:55:34 +0000 (20:55 +0000)]
Update clang_getCursor() test to check searches on include directives

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117063 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRename clang's TBAA tree root from "experimental" to "simple".
Dan Gohman [Thu, 21 Oct 2010 18:50:04 +0000 (18:50 +0000)]
Rename clang's TBAA tree root from "experimental" to "simple".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117046 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTweak diagnostics for redeclaration of a @property in a class extension where the...
Ted Kremenek [Thu, 21 Oct 2010 18:49:42 +0000 (18:49 +0000)]
Tweak diagnostics for redeclaration of a @property in a class extension where the redelcaration and original
declaration have the 'readwrite' attribute.  This is a common case, and we can issue a more lucid diagnostic.

Fixes <rdar://problem/7629420>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117045 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTidy up comment (remove extraneous text).
Ted Kremenek [Thu, 21 Oct 2010 18:49:36 +0000 (18:49 +0000)]
Tidy up comment (remove extraneous text).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117044 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd some more comments.
Dan Gohman [Thu, 21 Oct 2010 18:49:12 +0000 (18:49 +0000)]
Add some more comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117043 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement the integral promotion rules for the C++0x char16_t and
Douglas Gregor [Thu, 21 Oct 2010 18:04:08 +0000 (18:04 +0000)]
Implement the integral promotion rules for the C++0x char16_t and
char32_t character types and enable built-in overloaded operator
candidates for these types. Fixes PR8432.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117038 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDiagnose the declaration of template template parameters that
Douglas Gregor [Thu, 21 Oct 2010 17:26:49 +0000 (17:26 +0000)]
Diagnose the declaration of template template parameters that
themselves have no template parameters. This is actually a restriction
due to the grammar of template template parameters, but we choose to
diagnose it in Sema to provide better recovery.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117032 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAlways treat 'main' as an extern "C" function, so that we detect
Douglas Gregor [Thu, 21 Oct 2010 16:57:46 +0000 (16:57 +0000)]
Always treat 'main' as an extern "C" function, so that we detect
redeclarations of main appropriately rather than allowing it to be
overloaded. Also, disallowing declaring main as a template.

Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117029 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen checking whether a return statement returns a stack-local
Douglas Gregor [Thu, 21 Oct 2010 16:21:08 +0000 (16:21 +0000)]
When checking whether a return statement returns a stack-local
variable, handle conditional operators involving a
throw-expression. Fixes GCC DejaGNU's g++.dg/template/cond4.C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117027 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r117005, WIN32 is not predefined after all.
Francois Pichet [Thu, 21 Oct 2010 16:14:56 +0000 (16:14 +0000)]
Revert r117005, WIN32 is not predefined after all.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117026 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTweak the ObjCAtSyncChecker to assume that a mutex is non-nil after checking that...
Ted Kremenek [Thu, 21 Oct 2010 15:38:55 +0000 (15:38 +0000)]
Tweak the ObjCAtSyncChecker to assume that a mutex is non-nil after checking that it is
nil.  Otherwise we can get false paths where a second @synchronized using the mutex
can have a bogus warning.  Fixes <rdar://problem/8578650>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117016 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMSVC defines WIN32 as a predefined macro.
Francois Pichet [Thu, 21 Oct 2010 09:39:28 +0000 (09:39 +0000)]
MSVC defines WIN32 as a predefined macro.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117005 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTargets: Fix MinGW and VisualStudio predefined macros.
Michael J. Spencer [Thu, 21 Oct 2010 08:22:51 +0000 (08:22 +0000)]
Targets: Fix MinGW and VisualStudio predefined macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117003 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImprove the implementation of libclang's token-annotation logic for
Douglas Gregor [Thu, 21 Oct 2010 06:10:04 +0000 (06:10 +0000)]
Improve the implementation of libclang's token-annotation logic for
entities in the preprocessing record. Previously, we would only end up
getting the first token of a preprocessing record annotated
correctly. For example, given

  #include "foo.h"

we would only get the '#' annotated as an inclusion directive; the
'include' and '"foo.h"' tokens would be given the general 'processing
directive' annotation.

Now, we get proper annotations for entities in the preprocessing
record.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117001 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd test for Windows predefined macros.
Michael J. Spencer [Thu, 21 Oct 2010 05:23:48 +0000 (05:23 +0000)]
Add test for Windows predefined macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117000 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReorganize predefined macros for all Windows targets.
Michael J. Spencer [Thu, 21 Oct 2010 05:21:48 +0000 (05:21 +0000)]
Reorganize predefined macros for all Windows targets.

This adds an option to set the _MSC_VER macro without
recompiling. This is very useful when testing compatibility
with the Windows SDK and c++stdlib headers.

-fmsc-version=<version> (defaults to VS2003 (1300))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116999 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPreviously, the printf warnings would say your arguments type was 'int' when it was...
Ted Kremenek [Thu, 21 Oct 2010 04:00:58 +0000 (04:00 +0000)]
Previously, the printf warnings would say your arguments type was 'int' when it was really a 'char'
or a 'short'. This fixes that and allows the hints to suggest 'h' modifiers for small ints.

Patch by Justin Bogner!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116996 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove unused variable.
Ted Kremenek [Thu, 21 Oct 2010 04:00:51 +0000 (04:00 +0000)]
Remove unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116995 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoputback r116782, it's a safe fix and should not break windows
Andrew Trick [Thu, 21 Oct 2010 03:59:06 +0000 (03:59 +0000)]
putback r116782, it's a safe fix and should not break windows

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116994 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix Whitespace.
Michael J. Spencer [Thu, 21 Oct 2010 03:16:25 +0000 (03:16 +0000)]
Fix Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116990 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert "Cleanup and fix predefined macros for windows."
Michael J. Spencer [Thu, 21 Oct 2010 03:14:35 +0000 (03:14 +0000)]
Revert "Cleanup and fix predefined macros for windows."

Didn't realize this was on my branch ;/.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116989 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCleanup and fix predefined macros for windows.
Michael J. Spencer [Thu, 21 Oct 2010 03:13:04 +0000 (03:13 +0000)]
Cleanup and fix predefined macros for windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116988 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPass TInfo to CXXDestructorDecl::Create(), just like we do for other
Craig Silverstein [Thu, 21 Oct 2010 00:44:50 +0000 (00:44 +0000)]
Pass TInfo to CXXDestructorDecl::Create(), just like we do for other
function decls.

Reviewed by rjmccall and nlewycky.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116979 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agorevert r116782 & r116793 to fix msvc9 buildbots
Andrew Trick [Wed, 20 Oct 2010 23:52:37 +0000 (23:52 +0000)]
revert r116782 & r116793 to fix msvc9 buildbots

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116976 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen implicit members are added to a C++ record, notify the serializer so that a...
Argyrios Kyrtzidis [Wed, 20 Oct 2010 23:48:42 +0000 (23:48 +0000)]
When implicit members are added to a C++ record, notify the serializer so that a chained PCH writes the definition again.
Thanks to Doug for the hint!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116975 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoModify the assumptions of an assert; the updated latest redeclaration can have the...
Argyrios Kyrtzidis [Wed, 20 Oct 2010 23:48:40 +0000 (23:48 +0000)]
Modify the assumptions of an assert; the updated latest redeclaration can have the same location
if it's a template specialization pointing at the template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116974 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove obsolete GRAuditor and GRSimpleAPICheck, which have been completely subsumed...
Ted Kremenek [Wed, 20 Oct 2010 23:48:34 +0000 (23:48 +0000)]
Remove obsolete GRAuditor and GRSimpleAPICheck, which have been completely subsumed by the Checker interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116973 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoConvert GRSimpleAPIChecks in BasicObjCFoundationChecks to be Checkers.
Ted Kremenek [Wed, 20 Oct 2010 23:38:56 +0000 (23:38 +0000)]
Convert GRSimpleAPIChecks in BasicObjCFoundationChecks to be Checkers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116971 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoExtend the preprocessing record and libclang with support for
Douglas Gregor [Wed, 20 Oct 2010 22:00:55 +0000 (22:00 +0000)]
Extend the preprocessing record and libclang with support for
inclusion directives, keeping track of every #include, #import,
etc. in the translation unit. We keep track of the source location and
kind of the inclusion, how the file name was spelled, and the
underlying file to which the inclusion resolved.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116952 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCall clang_disposeTokens() when we are done with the set of tokens.
Ted Kremenek [Wed, 20 Oct 2010 21:22:15 +0000 (21:22 +0000)]
Call clang_disposeTokens() when we are done with the set of tokens.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116946 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGet FunctionDecl to recurse on FunctionTypeLoc rather than
Craig Silverstein [Wed, 20 Oct 2010 21:13:35 +0000 (21:13 +0000)]
Get FunctionDecl to recurse on FunctionTypeLoc rather than
FunctionType!  I didn't realize it was available, until rjmccall
pointed out that DeclaratorDecl made the typeloc available.  This
makes FunctionDecl recursion *much* easier, because the typeloc can
take care of default parameters, so we no longer have to do that
separately, which means we can just do a normal type traversal instead
of this special-case WalkUp stuff we did before.

The only downside -- and it's minor -- is that because the TypeLoc
handles both the return type and the argument types, we can't recurse
on the explicit template args in the right place (which would be
between them).  I do it beforehand instead.  So for
   int MyFunc<float>(char x);
we get callbacks in the order: float, int, char.

Reviewed by chandlerc

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116945 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix chained PCH issue; make sure all visible decls that will be put into a UPDATE_VIS...
Argyrios Kyrtzidis [Wed, 20 Oct 2010 16:22:56 +0000 (16:22 +0000)]
Fix chained PCH issue; make sure all visible decls that will be put into a UPDATE_VISIBLE block were recorded beforehand.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116931 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMinor optimization; Try to iterator over redeclarations only when necessary.
Argyrios Kyrtzidis [Wed, 20 Oct 2010 16:22:49 +0000 (16:22 +0000)]
Minor optimization; Try to iterator over redeclarations only when necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116930 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixes a potential crash in rewriter when sending message
Fariborz Jahanian [Wed, 20 Oct 2010 16:07:20 +0000 (16:07 +0000)]
Fixes a potential crash in rewriter when sending message
to 'super'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116928 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTry again to pacify the build bots. =/ I'm getting a Darwin machine to test on.
Chandler Carruth [Wed, 20 Oct 2010 08:24:03 +0000 (08:24 +0000)]
Try again to pacify the build bots. =/ I'm getting a Darwin machine to test on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116918 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGCC 4.4 warns that Receiver may be used uninitialized in this function.
Duncan Sands [Wed, 20 Oct 2010 08:21:16 +0000 (08:21 +0000)]
GCC 4.4 warns that Receiver may be used uninitialized in this function.
As far as I can see, gcc is right to think this!  The following change
will cause a nice segfault rather than undefined behaviour if this case
occurs.  Someone who understands what this code is supposed to do should
probably take a proper look.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116917 91177308-0d34-0410-b5e6-96231b3b80d8