Commit Graph

33977 Commits

Author SHA1 Message Date
John McCall d5c98ae695 Resolve placeholder expressions before trying to deduce
'auto'.  Introduce a convenience method to make this a bit
easier, and use it elsewhere.

llvm-svn: 144605
2011-11-15 01:35:18 +00:00
Devang Patel 9957e8b789 Remove extra ';'.
llvm-svn: 144604
2011-11-15 01:30:40 +00:00
Nick Lewycky 5f2899cbfa The optimizers figured out how to make this store 6.
llvm-svn: 144597
2011-11-15 00:19:16 +00:00
Ted Kremenek ec9b50d961 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.
llvm-svn: 144595
2011-11-14 23:51:37 +00:00
Benjamin Kramer 02faa35477 A space in a diagnostic group is a bead idea.
llvm-svn: 144594
2011-11-14 23:44:04 +00:00
Benjamin Kramer 116d8879e6 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]

llvm-svn: 144591
2011-11-14 23:30:34 +00:00
Matt Beaumont-Gay 8e9aae5999 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.

llvm-svn: 144590
2011-11-14 23:24:52 +00:00
Douglas Gregor 0201a4c2d3 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>.

llvm-svn: 144582
2011-11-14 23:00:43 +00:00
Argyrios Kyrtzidis 86acd72bd2 [libclang] Slight changes to the indexing API and bigger internal changes for it.
llvm-svn: 144577
2011-11-14 22:39:19 +00:00
Douglas Gregor 4123a86fae 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!

llvm-svn: 144573
2011-11-14 22:10:01 +00:00
Ted Kremenek 1fcdaa9c05 ARC: make assignment to 'self' within class methods illegal. Fixes <rdar://problem/10416568>.
llvm-svn: 144572
2011-11-14 21:59:25 +00:00
Ted Kremenek 8e7fbcc3e4 [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.

llvm-svn: 144571
2011-11-14 21:59:21 +00:00
Ted Kremenek 731607fab2 [analyzer;Regionstore] handle loads from StringLiteral elements for StringLiterals representing wide strings. Fixes PR 11294.
llvm-svn: 144563
2011-11-14 20:05:54 +00:00
John McCall 16de4d20e0 In ARC, don't reclaim objects of Class type.
llvm-svn: 144561
2011-11-14 19:53:16 +00:00
Richard Trieu 5d1aff049e 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.

llvm-svn: 144558
2011-11-14 19:39:25 +00:00
Ted Kremenek b39fcfaa19 [analyzer] teach AnalysisDeclContext::getSelfDecl() about blocks that capture the 'self' variable of the enclosing ObjC method decl. Fixes <rdar://problem/10380300>.
llvm-svn: 144556
2011-11-14 19:36:08 +00:00
Eric Christopher 04832b9210 Fixup comment.
llvm-svn: 144548
2011-11-14 18:55:02 +00:00
Argyrios Kyrtzidis 7d268c3b8b [PCH] Load the chained objc categories only after recursive loading is finished
otherwise we may crash.

llvm-svn: 144524
2011-11-14 07:07:59 +00:00
Nico Weber d60b72f696 Fix a regression in wide character codegen. See PR11369.
llvm-svn: 144521
2011-11-14 05:17:37 +00:00
Argyrios Kyrtzidis 846e61a363 [PCH] Do not crash if a class extension in a chained PCH introduces/redeclares a property.
llvm-svn: 144520
2011-11-14 04:52:29 +00:00
Argyrios Kyrtzidis 09c1b3d858 [PCH] In ASTWriter::WriteChainedObjCCategories use getDeclID since the decls
should have been already emitted.

llvm-svn: 144519
2011-11-14 04:52:24 +00:00
Argyrios Kyrtzidis 70480496c8 [libclang] Move the check for errors in c-index-test before the TU gets disposed.
llvm-svn: 144514
2011-11-13 23:39:14 +00:00
Argyrios Kyrtzidis f5ab0345fc [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.

llvm-svn: 144510
2011-11-13 22:08:39 +00:00
Argyrios Kyrtzidis e74e8222ee [libclang] for c-index-test, check for CINDEXTEST_FAILONERROR when doing -test-load-source-reparse
llvm-svn: 144509
2011-11-13 22:08:33 +00:00
Argyrios Kyrtzidis 95dfc12cd6 Don't crash when a duplicate interface/protocol is inside an extern "C" context.
llvm-svn: 144508
2011-11-13 22:08:30 +00:00
Rafael Espindola 6cfa82bc5f Fix the signature of the getcontext builtin. Patch by Dimitry Andric.
llvm-svn: 144505
2011-11-13 21:51:09 +00:00
Benjamin Kramer 1871ed3d79 Silence unused variable warning.
llvm-svn: 144500
2011-11-13 16:52:09 +00:00
Peter Collingbourne fcc764d140 When reference binding array rvalues, such as those created by compound
literals of array type, materialise a temporary.

llvm-svn: 144483
2011-11-13 00:51:30 +00:00
Richard Smith ce40ad677e 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.

llvm-svn: 144468
2011-11-12 22:28:03 +00:00
Argyrios Kyrtzidis f9d0f4744e [PCH] Fix the test.
llvm-svn: 144467
2011-11-12 21:07:54 +00:00
Argyrios Kyrtzidis 0ca3a8b6ef Add a method in ASTMutationListener for the last use of Decl's [is/set]ChangedSinceDeserialization
and remove them.

llvm-svn: 144466
2011-11-12 21:07:52 +00:00
Argyrios Kyrtzidis b97a4025ff [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.

llvm-svn: 144465
2011-11-12 21:07:46 +00:00
David Blaikie 256ee1963d Remove unnecessary 'else's after 'return's.
llvm-svn: 144464
2011-11-12 20:54:14 +00:00
Eli Friedman 47133bed4a Add missing casts to AST.
llvm-svn: 144455
2011-11-12 03:56:23 +00:00
Argyrios Kyrtzidis 3e429e7cc4 [libclang] Further simplify the indexing API.
That stuff can be added later on if we need them.
Also add some const goodness.

llvm-svn: 144446
2011-11-12 02:16:30 +00:00
Douglas Gregor 0daa607f55 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.

llvm-svn: 144436
2011-11-12 00:24:49 +00:00
Douglas Gregor 80b6904baf 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.

llvm-svn: 144435
2011-11-12 00:22:19 +00:00
Douglas Gregor af28ec80a3 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.

llvm-svn: 144433
2011-11-12 00:05:07 +00:00
Eli Friedman b29c8d55b9 Make test compatible with ARM hosts.
llvm-svn: 144428
2011-11-11 23:36:04 +00:00
Douglas Gregor 88bdfb0ed9 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.

llvm-svn: 144424
2011-11-11 23:20:24 +00:00
Douglas Gregor 910c37c85e Fix some typos, grammar errors, etc. in cursor kind descriptions
llvm-svn: 144412
2011-11-11 22:35:18 +00:00
Douglas Gregor ab0c8a849a 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.

llvm-svn: 144410
2011-11-11 22:18:48 +00:00
Douglas Gregor 5257fc63e7 Resolve the header files named in module map "header" and "umbrella"
declarations to actual files.

llvm-svn: 144408
2011-11-11 21:55:48 +00:00
Richard Smith 617940f166 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.

llvm-svn: 144404
2011-11-11 19:29:23 +00:00
Douglas Gregor 3c267f7aa9 Rename SPECIAL_TYPE_jmp_buf and SPECIAL_TYPE_sigjmp_buf to follow the
convention of SPECIAL_TYPE*.

llvm-svn: 144403
2011-11-11 19:13:12 +00:00
Douglas Gregor 718292f260 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.

llvm-svn: 144402
2011-11-11 19:10:28 +00:00
Sean Callanan 45e1328f3f When importing an ObjCInterfaceDecl, ensure that
superclass information is imported before validating
it.  This fixes spurious "incompatible superclasses"
errors in LLDB.

llvm-svn: 144393
2011-11-11 17:39:52 +00:00
Ted Kremenek 70394cf76c 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).
llvm-svn: 144389
2011-11-11 15:19:48 +00:00
Benjamin Kramer b9af5f6eff Silence compiler warning.
llvm-svn: 144386
2011-11-11 14:13:03 +00:00
Richard Smith 6804be5a2e Constant expression evalation: const_cast support.
llvm-svn: 144382
2011-11-11 08:28:03 +00:00