]> granicus.if.org Git - clang/log
clang
12 years agoFix potential memory leak for clients of clang_getOverriddenCursors(). If the number...
Ted Kremenek [Mon, 14 Nov 2011 23:51:37 +0000 (23:51 +0000)]
Fix potential memory leak for clients of clang_getOverriddenCursors().  If the number of overriden cursors is 0, do not allocate an array of CXCursors.  This fixes a memory leak in c-index-test, and clients who use this API in a similar way.

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

12 years agoA space in a diagnostic group is a bead idea.
Benjamin Kramer [Mon, 14 Nov 2011 23:44:04 +0000 (23:44 +0000)]
A space in a diagnostic group is a bead idea.

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

12 years agoPrint a typo correction hint for unknown warning flags.
Benjamin Kramer [Mon, 14 Nov 2011 23:30:34 +0000 (23:30 +0000)]
Print a typo correction hint for unknown warning flags.

$ clang -Wololo t.c
warning: unknown warning option '-Wololo'; did you mean '-Wall'? [-Wunknown-warning-option]

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

12 years agoDon't track depfiles as result files which need to be cleaned up on failure.
Matt Beaumont-Gay [Mon, 14 Nov 2011 23:24:52 +0000 (23:24 +0000)]
Don't track depfiles as result files which need to be cleaned up on failure.

This is a partial revert of r143846. While cleaning up after a crash is
probably a good idea, we were also deleting .d files if the compilation failed
due to invalid input, which is not the desired behavior. The test is XFAIL'd
until the cleanup code can be reworked to do the right thing.

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

12 years agoWhen we're checking access in a dependent context, don't try to look
Douglas Gregor [Mon, 14 Nov 2011 23:00:43 +0000 (23:00 +0000)]
When we're checking access in a dependent context, don't try to look
at the bases of an undefined class. Fixes <rdar://problem/10438657>.

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

12 years ago[libclang] Slight changes to the indexing API and bigger internal changes for it.
Argyrios Kyrtzidis [Mon, 14 Nov 2011 22:39:19 +0000 (22:39 +0000)]
[libclang] Slight changes to the indexing API and bigger internal changes for it.

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

12 years agoUse Sema::RequireCompleteType to check for the completeness of
Douglas Gregor [Mon, 14 Nov 2011 22:10:01 +0000 (22:10 +0000)]
Use Sema::RequireCompleteType to check for the completeness of
Objective-C classes. This has two purposes: to consistently provide
"forward declaration here" notes when we hit an incomplete type, and
to give LLDB a chance to complete the type.

RequireCompleteType bits from Sean Callanan!

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

12 years agoARC: make assignment to 'self' within class methods illegal. Fixes <rdar://problem...
Ted Kremenek [Mon, 14 Nov 2011 21:59:25 +0000 (21:59 +0000)]
ARC: make assignment to 'self' within class methods illegal.  Fixes <rdar://problem/10416568>.

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

12 years ago[static analyzer] Tweak RetainCountChecker's diagnostics to correctly indicate if...
Ted Kremenek [Mon, 14 Nov 2011 21:59:21 +0000 (21:59 +0000)]
[static analyzer] Tweak RetainCountChecker's diagnostics to correctly indicate if a message was due to a property access.  This can
potentially be refactored for other clients, and this is a regression from the refactoring of property acceses.

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

12 years ago[analyzer;Regionstore] handle loads from StringLiteral elements for StringLiterals...
Ted Kremenek [Mon, 14 Nov 2011 20:05:54 +0000 (20:05 +0000)]
[analyzer;Regionstore] handle loads from StringLiteral elements for StringLiterals representing wide strings.  Fixes PR 11294.

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

12 years agoIn ARC, don't reclaim objects of Class type.
John McCall [Mon, 14 Nov 2011 19:53:16 +0000 (19:53 +0000)]
In ARC, don't reclaim objects of Class type.

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

12 years agoChange the checks in the type aka printing. A confusing case where the string
Richard Trieu [Mon, 14 Nov 2011 19:39:25 +0000 (19:39 +0000)]
Change the checks in the type aka printing.  A confusing case where the string
of the first type is the same as the aka string of the second type, but both
types are different.  Update the logic to print an aka for the first type to
show that they are different.

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

12 years ago[analyzer] teach AnalysisDeclContext::getSelfDecl() about blocks that capture the...
Ted Kremenek [Mon, 14 Nov 2011 19:36:08 +0000 (19:36 +0000)]
[analyzer] teach AnalysisDeclContext::getSelfDecl() about blocks that capture the 'self' variable of the enclosing ObjC method decl.  Fixes <rdar://problem/10380300>.

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

12 years agoFixup comment.
Eric Christopher [Mon, 14 Nov 2011 18:55:02 +0000 (18:55 +0000)]
Fixup comment.

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

12 years ago[PCH] Load the chained objc categories only after recursive loading is finished
Argyrios Kyrtzidis [Mon, 14 Nov 2011 07:07:59 +0000 (07:07 +0000)]
[PCH] Load the chained objc categories only after recursive loading is finished
otherwise we may crash.

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

12 years agoFix a regression in wide character codegen. See PR11369.
Nico Weber [Mon, 14 Nov 2011 05:17:37 +0000 (05:17 +0000)]
Fix a regression in wide character codegen. See PR11369.

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

12 years ago[PCH] Do not crash if a class extension in a chained PCH introduces/redeclares a...
Argyrios Kyrtzidis [Mon, 14 Nov 2011 04:52:29 +0000 (04:52 +0000)]
[PCH] Do not crash if a class extension in a chained PCH introduces/redeclares a property.

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

12 years ago[PCH] In ASTWriter::WriteChainedObjCCategories use getDeclID since the decls
Argyrios Kyrtzidis [Mon, 14 Nov 2011 04:52:24 +0000 (04:52 +0000)]
[PCH] In ASTWriter::WriteChainedObjCCategories use getDeclID since the decls
should have been already emitted.

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

12 years ago[libclang] Move the check for errors in c-index-test before the TU gets disposed.
Argyrios Kyrtzidis [Sun, 13 Nov 2011 23:39:14 +0000 (23:39 +0000)]
[libclang] Move the check for errors in c-index-test before the TU gets disposed.

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

12 years ago[PCH] When chaining a PCH and serializing HeaderSearch, make sure the HeaderFileInfos
Argyrios Kyrtzidis [Sun, 13 Nov 2011 22:08:39 +0000 (22:08 +0000)]
[PCH] When chaining a PCH and serializing HeaderSearch, make sure the HeaderFileInfos
from the primary PCH is deserialized, otherwise we lose info that headers were
already #imported/#included.

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

12 years ago[libclang] for c-index-test, check for CINDEXTEST_FAILONERROR when doing -test-load...
Argyrios Kyrtzidis [Sun, 13 Nov 2011 22:08:33 +0000 (22:08 +0000)]
[libclang] for c-index-test, check for CINDEXTEST_FAILONERROR when doing -test-load-source-reparse

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

12 years agoDon't crash when a duplicate interface/protocol is inside an extern "C" context.
Argyrios Kyrtzidis [Sun, 13 Nov 2011 22:08:30 +0000 (22:08 +0000)]
Don't crash when a duplicate interface/protocol is inside an extern "C" context.

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

12 years agoFix the signature of the getcontext builtin. Patch by Dimitry Andric.
Rafael Espindola [Sun, 13 Nov 2011 21:51:09 +0000 (21:51 +0000)]
Fix the signature of the getcontext builtin. Patch by Dimitry Andric.

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

12 years agoSilence unused variable warning.
Benjamin Kramer [Sun, 13 Nov 2011 16:52:09 +0000 (16:52 +0000)]
Silence unused variable warning.

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

12 years agoWhen reference binding array rvalues, such as those created by compound
Peter Collingbourne [Sun, 13 Nov 2011 00:51:30 +0000 (00:51 +0000)]
When reference binding array rvalues, such as those created by compound
literals of array type, materialise a temporary.

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

12 years agoRepresent an APValue based on a Decl as that Decl, rather than a DeclRefExpr
Richard Smith [Sat, 12 Nov 2011 22:28:03 +0000 (22:28 +0000)]
Represent an APValue based on a Decl as that Decl, rather than a DeclRefExpr
or MemberExpr which refers to it. As a side-effect, MemberExprs which refer to
static member functions and static data members are now emitted as constant
expressions.

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

12 years ago[PCH] Fix the test.
Argyrios Kyrtzidis [Sat, 12 Nov 2011 21:07:54 +0000 (21:07 +0000)]
[PCH] Fix the test.

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

12 years agoAdd a method in ASTMutationListener for the last use of Decl's [is/set]ChangedSinceDe...
Argyrios Kyrtzidis [Sat, 12 Nov 2011 21:07:52 +0000 (21:07 +0000)]
Add a method in ASTMutationListener for the last use of Decl's [is/set]ChangedSinceDeserialization
and remove them.

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

12 years ago[PCH] When completing an objc forward reference, do not serialize the chain of its...
Argyrios Kyrtzidis [Sat, 12 Nov 2011 21:07:46 +0000 (21:07 +0000)]
[PCH] When completing an objc forward reference, do not serialize the chain of its categories because
it is going to be rewritten (and the chain will be serialized again), otherwise we may form a cycle in its
categories list when deserializing.

Also introduce ASTMutationListener::CompletedObjCForwardRef to notify that a forward reference
was completed; using Decl's isChangedSinceDeserialization/setChangedSinceDeserialization
is bug inducing and kinda gross, we should phase it out.

Fixes infinite loop in rdar://10418538.

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

12 years agoRemove unnecessary 'else's after 'return's.
David Blaikie [Sat, 12 Nov 2011 20:54:14 +0000 (20:54 +0000)]
Remove unnecessary 'else's after 'return's.

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

12 years agoAdd missing casts to AST.
Eli Friedman [Sat, 12 Nov 2011 03:56:23 +0000 (03:56 +0000)]
Add missing casts to AST.

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

12 years ago[libclang] Further simplify the indexing API.
Argyrios Kyrtzidis [Sat, 12 Nov 2011 02:16:30 +0000 (02:16 +0000)]
[libclang] Further simplify the indexing API.

That stuff can be added later on if we need them.
Also add some const goodness.

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

12 years agoTweak the module map file test slightly, by putting one of the headers
Douglas Gregor [Sat, 12 Nov 2011 00:24:49 +0000 (00:24 +0000)]
Tweak the module map file test slightly, by putting one of the headers
into a submodule. Submodules aren't actually supported anywhere else,
but we do parse them, so this verifies that we're at least seeing
through them properly.

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

12 years agoImplement a minor optimization when loading module maps to satisfy a
Douglas Gregor [Sat, 12 Nov 2011 00:22:19 +0000 (00:22 +0000)]
Implement a minor optimization when loading module maps to satisfy a
module import: don't re-check for a loaded module unless we've
actually loaded a new module map file. Already-loaded module map files
aren't interesting.

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

12 years agoWhen searching for a module, speculatively load module maps to see if
Douglas Gregor [Sat, 12 Nov 2011 00:05:07 +0000 (00:05 +0000)]
When searching for a module, speculatively load module maps to see if
the module is described in one of the module maps in a search path or
in a subdirectory off the search path that has the same name as the
module we're looking for.

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

12 years agoMake test compatible with ARM hosts.
Eli Friedman [Fri, 11 Nov 2011 23:36:04 +0000 (23:36 +0000)]
Make test compatible with ARM hosts.

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

12 years agoTeach the search for modules to consider modules described by a module
Douglas Gregor [Fri, 11 Nov 2011 23:20:24 +0000 (23:20 +0000)]
Teach the search for modules to consider modules described by a module
map, so long as they have an umbrella header. This makes it possible
to introduce a module map + umbrella header for a given set of
headers, to turn it into a module.

There are two major deficiencies here: first, we don't go hunting for
module map files when we just see a module import (so we won't know
about the modules described therein). Second, we don't yet have a way
to build modules that don't have umbrella headers, or have incomplete
umbrella headers.

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

12 years agoFix some typos, grammar errors, etc. in cursor kind descriptions
Douglas Gregor [Fri, 11 Nov 2011 22:35:18 +0000 (22:35 +0000)]
Fix some typos, grammar errors, etc. in cursor kind descriptions

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

12 years agoWire up the mapping from header files mentioned in module maps over to
Douglas Gregor [Fri, 11 Nov 2011 22:18:48 +0000 (22:18 +0000)]
Wire up the mapping from header files mentioned in module maps over to
the corresponding (top-level) modules. This isn't actually useful yet,
because we don't yet have a way to build modules out of module maps.

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

12 years agoResolve the header files named in module map "header" and "umbrella"
Douglas Gregor [Fri, 11 Nov 2011 21:55:48 +0000 (21:55 +0000)]
Resolve the header files named in module map "header" and "umbrella"
declarations to actual files.

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

12 years agoExtend -Wno-bind-to-temporary-copy and -Wno-{unnamed,local}-type-template-args
Richard Smith [Fri, 11 Nov 2011 19:29:23 +0000 (19:29 +0000)]
Extend -Wno-bind-to-temporary-copy and -Wno-{unnamed,local}-type-template-args
to disable the corresponding -Wc++98-compat warnings in addition to the C++11
extension warnings, so that people already using these flags can switch to C++11
mode and turn on -Wc++98-compat.

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

12 years agoRename SPECIAL_TYPE_jmp_buf and SPECIAL_TYPE_sigjmp_buf to follow the
Douglas Gregor [Fri, 11 Nov 2011 19:13:12 +0000 (19:13 +0000)]
Rename SPECIAL_TYPE_jmp_buf and SPECIAL_TYPE_sigjmp_buf to follow the
convention of SPECIAL_TYPE*.

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

12 years agoIntroduce basic support for parsing module map files.
Douglas Gregor [Fri, 11 Nov 2011 19:10:28 +0000 (19:10 +0000)]
Introduce basic support for parsing module map files.

Module map files provide a way to map between headers and modules, so
that we can layer a module system on top of existing headers without
changing those headers at all.

This commit introduces the module map file parser and the module map
that it generates, and wires up the module map file parser so that
we'll automatically find module map files as part of header
search. Note that we don't yet use the information stored in the
module map.

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

12 years agoWhen importing an ObjCInterfaceDecl, ensure that
Sean Callanan [Fri, 11 Nov 2011 17:39:52 +0000 (17:39 +0000)]
When importing an ObjCInterfaceDecl, ensure that
superclass information is imported before validating
it.  This fixes spurious "incompatible superclasses"
errors in LLDB.

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

12 years agoTweak CXLoadedDiagnosticSetImpl::makeString() to include an extra null character...
Ted Kremenek [Fri, 11 Nov 2011 15:19:48 +0000 (15:19 +0000)]
Tweak CXLoadedDiagnosticSetImpl::makeString() to include an extra null character, and change the creation of the FixIT's string to again just rely on this string (instead of duplicating it when calling createCXString).

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

12 years agoSilence compiler warning.
Benjamin Kramer [Fri, 11 Nov 2011 14:13:03 +0000 (14:13 +0000)]
Silence compiler warning.

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

12 years agoConstant expression evalation: const_cast support.
Richard Smith [Fri, 11 Nov 2011 08:28:03 +0000 (08:28 +0000)]
Constant expression evalation: const_cast support.

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

12 years agoSearch for libstdc++.dylib in llvm-gcc's files on darwin10. rdar://10419079
Bob Wilson [Fri, 11 Nov 2011 07:47:04 +0000 (07:47 +0000)]
Search for libstdc++.dylib in llvm-gcc's files on darwin10. rdar://10419079

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

12 years agolibclang/CXLoadedDiagnostic.cpp: Work around not to miss the string terminator on...
NAKAMURA Takumi [Fri, 11 Nov 2011 07:27:33 +0000 (07:27 +0000)]
libclang/CXLoadedDiagnostic.cpp: Work around not to miss the string terminator on fixit.

FixIts might be exposed as C string via clang_getCString(), though the zero terminator is not allocated in CXLoadedDiagnosticSetImpl::makeString.

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

12 years agoDon't recurse so deep in this test, pending APValue rework to further reduce the
Richard Smith [Fri, 11 Nov 2011 07:10:32 +0000 (07:10 +0000)]
Don't recurse so deep in this test, pending APValue rework to further reduce the
stack pressure.

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

12 years agoReduce the constexpr stack pressure somewhat. Hopefully this will be enough to
Richard Smith [Fri, 11 Nov 2011 05:48:57 +0000 (05:48 +0000)]
Reduce the constexpr stack pressure somewhat. Hopefully this will be enough to
please the buildbots.

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

12 years agotest/Misc/serialized-diags.c: Tweak FileCheck expressions to be tolerant to DOSish...
NAKAMURA Takumi [Fri, 11 Nov 2011 05:12:45 +0000 (05:12 +0000)]
test/Misc/serialized-diags.c: Tweak FileCheck expressions to be tolerant to DOSish output.

FIXME: For now, " = 0Parse Issueexpected ';' after expression{{XXX}}" would not be matched due to unexpected garbage{{XXX} on some hosts.

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

12 years agoConstant expression evaluation: support for constexpr member functions. This
Richard Smith [Fri, 11 Nov 2011 04:05:33 +0000 (04:05 +0000)]
Constant expression evaluation: support for constexpr member functions. This
reinstates r144273; a combination of r144333's fix for NoOp rvalue-to-lvalue
casts and some corresponding changes here resolve the regression which that
caused.

This patch also adds support for some additional forms of member function call,
along with additional testing.

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

12 years agoPlace 'argument unused during compilation' under a -W flag. Fixes <rdar://problem...
Ted Kremenek [Fri, 11 Nov 2011 03:58:21 +0000 (03:58 +0000)]
Place 'argument unused during compilation' under a -W flag.  Fixes <rdar://problem/10403653>.

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

12 years agoDon't apply NRVO to over-aligned variables. The caller only
John McCall [Fri, 11 Nov 2011 03:57:31 +0000 (03:57 +0000)]
Don't apply NRVO to over-aligned variables.  The caller only
guarantees alignment up to the ABI alignment of the return type.

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

12 years agoBe sure to insulate block literals from any cleanups in their
John McCall [Fri, 11 Nov 2011 03:19:12 +0000 (03:19 +0000)]
Be sure to insulate block literals from any cleanups in their
enclosing full-expressions.  It is somewhat amazing that
this hasn't come up as a problem before.

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

12 years agoAdd Linux multiarch include directories for mips/mipsel. Patch from Simon Atanasyan.
Eli Friedman [Fri, 11 Nov 2011 03:05:19 +0000 (03:05 +0000)]
Add Linux multiarch include directories for mips/mipsel.  Patch from Simon Atanasyan.

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

12 years agoinclude/clang-c/Index.h: Update CINDEX_LINKAGE on 6 decls. Corresponds to libclang...
NAKAMURA Takumi [Fri, 11 Nov 2011 02:51:09 +0000 (02:51 +0000)]
include/clang-c/Index.h: Update CINDEX_LINKAGE on 6 decls. Corresponds to libclang.exports in r144343

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

12 years agoMake sure that restrict-qualifying an array actually adds a restrict qualifier. PR113...
Eli Friedman [Fri, 11 Nov 2011 02:00:42 +0000 (02:00 +0000)]
Make sure that restrict-qualifying an array actually adds a restrict qualifier. PR11354.  (operator bool() is evil!)

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

12 years ago[serialized diagnostics]: add test cases for serialized diagnostics, including a...
Ted Kremenek [Fri, 11 Nov 2011 00:46:43 +0000 (00:46 +0000)]
[serialized diagnostics]: add test cases for serialized diagnostics, including a test case for no issues, multiple issues, and
a single issue.  Along the way, tweak c-index-test -read-diagnostics output so it is easier to tell what diagnostics are
child diagnostics.

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

12 years agoI predict that HeaderSearch will need the ability to generate
Douglas Gregor [Fri, 11 Nov 2011 00:35:06 +0000 (00:35 +0000)]
I predict that HeaderSearch will need the ability to generate
diagnostics in the future. Make it so.

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

12 years ago[libclang] Simplify the indexing API.
Argyrios Kyrtzidis [Fri, 11 Nov 2011 00:23:36 +0000 (00:23 +0000)]
[libclang] Simplify the indexing API.

Cut down the number of callbacks to more generic ones. Clients can check
an enum to find out what kind of declaration it is and they can call functions
to get more specific information than the generic provided info.

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

12 years agoAdd a const version of ObjCClassDecl::getForwardDecl, no functionality change.
Argyrios Kyrtzidis [Fri, 11 Nov 2011 00:23:31 +0000 (00:23 +0000)]
Add a const version of ObjCClassDecl::getForwardDecl, no functionality change.

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

12 years agoMove "Unqualified lookup into dependent bases of class templates" Microsoft specific...
Francois Pichet [Fri, 11 Nov 2011 00:12:11 +0000 (00:12 +0000)]
Move "Unqualified lookup into dependent bases of class templates" Microsoft specific behavior from -fms-extensions to -fms-compatibility.

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

12 years ago[static analyzer] be more specific when running removeDeadBindings. Instead of seein...
Ted Kremenek [Fri, 11 Nov 2011 00:10:55 +0000 (00:10 +0000)]
[static analyzer] be more specific when running removeDeadBindings.  Instead of seeing if the predecessor node was a non-StmtPoint, check if it is specifically a BlockEntrance node.

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

12 years agoAdd top-level driver option '--serialize-diagnostics' for serialize compiler diagnost...
Ted Kremenek [Fri, 11 Nov 2011 00:07:43 +0000 (00:07 +0000)]
Add top-level driver option '--serialize-diagnostics' for serialize compiler diagnostics to a file.

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

12 years agoImplicit casts from rvalue to lvalue are not meaningful. Don't accidentally add
Richard Smith [Thu, 10 Nov 2011 23:32:36 +0000 (23:32 +0000)]
Implicit casts from rvalue to lvalue are not meaningful. Don't accidentally add
them when performing a const conversion on the implicit object argument for a
member operator call on an rvalue.

No change to the testsuite: the test for this change is that the added
assertion does not fire any more.

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

13 years ago[static analyzer]: only call RemoveDeadBindings() when analyzing non-Expr stmts,...
Ted Kremenek [Thu, 10 Nov 2011 23:26:10 +0000 (23:26 +0000)]
[static analyzer]: only call RemoveDeadBindings() when analyzing non-Expr stmts, entering a basic block, or analyzing non-consumed expressions.  This sigificantly speeds up analysis time, and reduces analysis time down to 27% less than before we linearized the CFG.

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

13 years agoAdd invariant.load metadata to loads from selector references. Allows these loads...
Pete Cooper [Thu, 10 Nov 2011 21:45:06 +0000 (21:45 +0000)]
Add invariant.load metadata to loads from selector references.  Allows these loads to later be moved/combined in the optimizer.  Fixes <rdar://problem/6027699>

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

13 years agoAdd missing dependency for shared library build to CMakeLists. Patch by Johannes...
Eli Friedman [Thu, 10 Nov 2011 20:07:09 +0000 (20:07 +0000)]
Add missing dependency for shared library build to CMakeLists.  Patch by Johannes Obermayr.

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

13 years agoRevert r144273. It causes clang self-host build failure.
Devang Patel [Thu, 10 Nov 2011 17:47:39 +0000 (17:47 +0000)]
Revert r144273. It causes clang self-host build failure.

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

13 years agoserialized diagnostics: simplify code.
Benjamin Kramer [Thu, 10 Nov 2011 11:29:20 +0000 (11:29 +0000)]
serialized diagnostics: simplify code.

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

13 years agoWhenever explicitly activating or deactivating a cleanup, we
John McCall [Thu, 10 Nov 2011 10:43:54 +0000 (10:43 +0000)]
Whenever explicitly activating or deactivating a cleanup, we
need to provide a 'dominating IP' which is guaranteed to
dominate the (de)activation point but which cannot be avoided
along any execution path from the (de)activation point to
the push-point of the cleanup.  Using the entry block is
bad mojo.

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

13 years agoinclude/clang/AST/APValue.h: Try to fix *900* of cast-qual warnings by g++.
NAKAMURA Takumi [Thu, 10 Nov 2011 10:08:04 +0000 (10:08 +0000)]
include/clang/AST/APValue.h: Try to fix *900* of cast-qual warnings by g++.

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

13 years agoc-index-test.c: Fix a comment style. /* It is C source. */
NAKAMURA Takumi [Thu, 10 Nov 2011 10:07:57 +0000 (10:07 +0000)]
c-index-test.c: Fix a comment style. /* It is C source. */

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

13 years agoConstant expression evaluation: support for constexpr member functions.
Richard Smith [Thu, 10 Nov 2011 09:31:24 +0000 (09:31 +0000)]
Constant expression evaluation: support for constexpr member functions.

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

13 years agoc-index-test.c: Fix syntax. It is C source.
NAKAMURA Takumi [Thu, 10 Nov 2011 09:30:15 +0000 (09:30 +0000)]
c-index-test.c: Fix syntax. It is C source.

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

13 years agoFix a subtle bug with cleanups: when activating
John McCall [Thu, 10 Nov 2011 09:22:44 +0000 (09:22 +0000)]
Fix a subtle bug with cleanups:  when activating
a previously-inactive cleanup, not only do we need a
flag variable, but we should also force the cleanup to
query the flag variable.  However, we only need to do
this when we're activating in a context that's
conditionally executed;  otherwise, we may safely
assume that the cleanup is dominated by the activation
point.

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

13 years agoPR11148: Fix crash-on-invalid if an invalid member declaration is marked as
Richard Smith [Thu, 10 Nov 2011 09:08:44 +0000 (09:08 +0000)]
PR11148: Fix crash-on-invalid if an invalid member declaration is marked as
defaulted or deleted.

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

13 years agoserialized diagnostics: implement full deserialization of clang diagnostics via the...
Ted Kremenek [Thu, 10 Nov 2011 08:43:12 +0000 (08:43 +0000)]
serialized diagnostics: implement full deserialization of clang diagnostics via the libclang API.

I've tested it on simple cases and it works.  Test cases to follow as well as a few tweaks.

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

13 years agoEnter the cleanups for a block outside the enclosing
John McCall [Thu, 10 Nov 2011 08:15:53 +0000 (08:15 +0000)]
Enter the cleanups for a block outside the enclosing
full-expression.  Naturally they're inactive before we enter
the block literal expression.  This restores the intended
behavior that blocks belong to their enclosing scope.

There's a useful -O0 / compile-time optimization that we're
missing here with activating cleanups following straight-line
code from their inactive beginnings.

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

13 years agoConstant expression evaluation: support for evaluation of structs and unions of
Richard Smith [Thu, 10 Nov 2011 06:34:14 +0000 (06:34 +0000)]
Constant expression evaluation: support for evaluation of structs and unions of
literal types, as well as derived-to-base casts for lvalues and
derived-to-virtual-base casts.

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

13 years agoRemoving unused initialization.
David Blaikie [Thu, 10 Nov 2011 05:42:04 +0000 (05:42 +0000)]
Removing unused initialization.

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

13 years agoThere's no good reason to track temporaries in ExprWithCleanups,
John McCall [Thu, 10 Nov 2011 05:35:25 +0000 (05:35 +0000)]
There's no good reason to track temporaries in ExprWithCleanups,
but it is sometimes useful to track blocks.  Do so.  Also
optimize the storage of these expressions.

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

13 years agoTemporary fix for a performance problem Eli spotted. The APValue representation
Richard Smith [Thu, 10 Nov 2011 03:30:42 +0000 (03:30 +0000)]
Temporary fix for a performance problem Eli spotted. The APValue representation
is currently too inefficient to allow us to use it for array initializers, but
fortunately we usually don't yet need to evaluate such initializers.

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

13 years agoReflow lines, remove else-if after returns, rename variable "TydefContext" to
Nick Lewycky [Thu, 10 Nov 2011 00:34:02 +0000 (00:34 +0000)]
Reflow lines, remove else-if after returns, rename variable "TydefContext" to
"TypedefContext". No functionality change.

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

13 years agoFix some additional x86 intrinsics to use "I" (ICE) markings. Fix *mmintrin.h to...
Eli Friedman [Thu, 10 Nov 2011 00:11:13 +0000 (00:11 +0000)]
Fix some additional x86 intrinsics to use "I" (ICE) markings.  Fix *mmintrin.h to take them into account.

<rdar://problem/10341145>

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

13 years agoFix the signature of __sigsetjmp and sigsetjmp. Patch by Dimitry Andric.
Rafael Espindola [Wed, 9 Nov 2011 22:46:10 +0000 (22:46 +0000)]
Fix the signature of __sigsetjmp and sigsetjmp. Patch by Dimitry Andric.

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

13 years agoRemove unnecessary include.
Devang Patel [Wed, 9 Nov 2011 21:08:24 +0000 (21:08 +0000)]
Remove unnecessary include.

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

13 years agoobjc rewriter: use a more specific name for local variable used
Fariborz Jahanian [Wed, 9 Nov 2011 17:41:43 +0000 (17:41 +0000)]
objc rewriter: use a more specific name for local variable used
in fast enumeration rewrite. // rdar://10415026

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

13 years agoWe don't add ExprWithCleanups to the CFG, and getSVal looks
John McCall [Wed, 9 Nov 2011 17:10:36 +0000 (17:10 +0000)]
We don't add ExprWithCleanups to the CFG, and getSVal looks
through it, so we should look through it for the live-values
analysis as well.

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

13 years agoDefine some built-ins macros on mips32 platform, from Simon Atanasyan!
Douglas Gregor [Wed, 9 Nov 2011 15:17:16 +0000 (15:17 +0000)]
Define some built-ins macros on mips32 platform, from Simon Atanasyan!

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

13 years agoUpdate test.
Benjamin Kramer [Wed, 9 Nov 2011 12:43:30 +0000 (12:43 +0000)]
Update test.

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

13 years agoTry to fix an issue on some hosts where the 'lib' in the builtin include
Chandler Carruth [Wed, 9 Nov 2011 08:26:57 +0000 (08:26 +0000)]
Try to fix an issue on some hosts where the 'lib' in the builtin include
path is actually a multilib.

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

13 years agoFixing 80 col violations (& removing any trailing whitespace on files I was touching...
David Blaikie [Wed, 9 Nov 2011 06:07:30 +0000 (06:07 +0000)]
Fixing 80 col violations (& removing any trailing whitespace on files I was touching anyway)

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

13 years agoFix 80 cols violations & remove trailing whitespace.
David Blaikie [Wed, 9 Nov 2011 05:30:24 +0000 (05:30 +0000)]
Fix 80 cols violations & remove trailing whitespace.

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

13 years agoReflow one line I missed in previous cleanup commit. No functionality change.
Nick Lewycky [Wed, 9 Nov 2011 04:27:23 +0000 (04:27 +0000)]
Reflow one line I missed in previous cleanup commit. No functionality change.

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

13 years agoMinor cleanup, mostly reindenting. Remove one helper function that just called
Nick Lewycky [Wed, 9 Nov 2011 04:25:21 +0000 (04:25 +0000)]
Minor cleanup, mostly reindenting. Remove one helper function that just called
the other helper functions, since we already differentiated the cases it was
testing between. No functionality change.

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

13 years agoFix an issue that Duncan discovered on a specific (no longer current)
Chandler Carruth [Wed, 9 Nov 2011 03:46:20 +0000 (03:46 +0000)]
Fix an issue that Duncan discovered on a specific (no longer current)
version of Ubuntu. It has a very broken multiarch configuration, and so
we need special logic to handle it correctly. Fixing and testing this
uncovered a few other trivial issues with the logic that are fixed as
well.

I added tests to cover this as it is hard to notice if you install
recent versions of the OS.

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

13 years agoEmit the copy and dipose helpers for ARC __strong
John McCall [Wed, 9 Nov 2011 03:17:26 +0000 (03:17 +0000)]
Emit the copy and dipose helpers for ARC __strong
block-typed __block variables using objc_retainBlock
and objc_dispose.  Previously we were using
_Block_object_assign and _Block_object_destroy
with BLOCK_BYREF_CALLER, which causes the runtime
to completely ignore the retain and release.
In most cases this doesn't cause catastrophe
because the retain/release are balanced and
because the block in the variable was copied
upon assignment there.  However, the stack
copy of the variable will be released when
it goes out of scope, which is a problem if
that value was released due to an assignment
to the heap copy.  Similarly, a leak can occur
if the variable is assigned after the copy to
the heap.

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