]> granicus.if.org Git - clang/log
clang
12 years ago[analyzer] Catch the first taint propagation implied buffer overflow.
Anna Zaks [Wed, 16 Nov 2011 19:58:17 +0000 (19:58 +0000)]
[analyzer] Catch the first taint propagation implied buffer overflow.

Change the ArrayBoundCheckerV2 to be more aggressive in reporting buffer overflows
when the offset is tainted. Previously, we did not report bugs when the state was
underconstrained (not enough information about the bound to determine if there is
an overflow) to avoid false positives. However, if we know that the buffer
offset is tainted - comes in from the user space and can be anything, we should
report it as a bug.

+ The very first example of us catching a taint related bug.
This is the only example we can currently handle. More to come...

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

12 years ago[analyzer] Adding generic taint checker.
Anna Zaks [Wed, 16 Nov 2011 19:58:13 +0000 (19:58 +0000)]
[analyzer] Adding generic taint checker.

The checker is responsible for defining attack surface and adding taint to symbols.

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

12 years ago[analyzer] Adding basic building blocks for taint propagation.
Anna Zaks [Wed, 16 Nov 2011 19:58:10 +0000 (19:58 +0000)]
[analyzer] Adding basic building blocks for taint propagation.
TaintTag.h will contain definitions of different taint kinds and their properties.
TaintManager will be responsible for implementing taint specific operations, storing taint.
ProgramState will provide API to add/remove taint.

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

12 years ago[analyzer] Cleanup: Null->0, comments.
Anna Zaks [Wed, 16 Nov 2011 19:58:05 +0000 (19:58 +0000)]
[analyzer] Cleanup: Null->0, comments.

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

12 years ago[analyzer] Cleanup (NULL -> 0, no doxygen in cpp).
Anna Zaks [Wed, 16 Nov 2011 19:58:02 +0000 (19:58 +0000)]
[analyzer] Cleanup (NULL -> 0, no doxygen in cpp).

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

12 years ago[analyzer] Assert if we ever get an over constrained state.
Anna Zaks [Wed, 16 Nov 2011 19:57:59 +0000 (19:57 +0000)]
[analyzer] Assert if we ever get an over constrained state.

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

12 years ago[analyzer] Factor getCalleeName to the checker context.
Anna Zaks [Wed, 16 Nov 2011 19:57:55 +0000 (19:57 +0000)]
[analyzer] Factor getCalleeName to the checker context.
many checkers are trying to get a name of the callee when visiting
a CallExpr, so provide a convenience API.

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

12 years agoStop claiming that Visual Studio 2005 is a viable basis for building
Chandler Carruth [Wed, 16 Nov 2011 19:29:07 +0000 (19:29 +0000)]
Stop claiming that Visual Studio 2005 is a viable basis for building
Clang. It isn't any more, and we're not going to twist the code around
to make it work.

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

12 years agoAdd -f[no-]address-sanitizer flag
Kostya Serebryany [Wed, 16 Nov 2011 17:34:26 +0000 (17:34 +0000)]
Add -f[no-]address-sanitizer flag

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

12 years agoPR11391: Don't try to evaluate the LHS of a _Complex assignment as an rvalue.
Richard Smith [Wed, 16 Nov 2011 17:22:48 +0000 (17:22 +0000)]
PR11391: Don't try to evaluate the LHS of a _Complex assignment as an rvalue.

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

12 years agoWhen building a module from a module map that isn't simply an umbrella
Douglas Gregor [Wed, 16 Nov 2011 17:04:00 +0000 (17:04 +0000)]
When building a module from a module map that isn't simply an umbrella
header, create our own in-memory buffer to parse all of the
appropriate headers, and use that to build the module. This isn't
end-to-end testable yet; that's coming next.

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

12 years agoFixed missing cast and wrong cast kind in delete expression.
Abramo Bagnara [Wed, 16 Nov 2011 15:42:13 +0000 (15:42 +0000)]
Fixed missing cast and wrong cast kind in delete expression.

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

12 years agoSwitch the remaining modules tests over to -emit-module-from-map.
Douglas Gregor [Wed, 16 Nov 2011 15:22:03 +0000 (15:22 +0000)]
Switch the remaining modules tests over to -emit-module-from-map.

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

12 years ago[libclang] Add a comment in lazyCreateDiags to explain why the check and reset of
Argyrios Kyrtzidis [Wed, 16 Nov 2011 08:59:00 +0000 (08:59 +0000)]
[libclang] Add a comment in lazyCreateDiags to explain why the check and reset of
diagnostic set is necessary.

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

12 years ago[libclang] Make clang_annotateTokens use "file-targeted" deserialization and avoid
Argyrios Kyrtzidis [Wed, 16 Nov 2011 08:58:57 +0000 (08:58 +0000)]
[libclang] Make clang_annotateTokens use "file-targeted" deserialization and avoid
unnecessary deserializations.

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

12 years ago[libclang] Make clang_findReferencesInFile use "file-targeted" deserialization and...
Argyrios Kyrtzidis [Wed, 16 Nov 2011 08:58:54 +0000 (08:58 +0000)]
[libclang] Make clang_findReferencesInFile use "file-targeted" deserialization and avoid
unnecessary deserializations.

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

12 years agoMatch LLVM API change.
Evan Cheng [Wed, 16 Nov 2011 08:38:55 +0000 (08:38 +0000)]
Match LLVM API change.

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

12 years agoFix PR11385: A pointer constant expression which has been cast via an integer is
Richard Smith [Wed, 16 Nov 2011 07:18:12 +0000 (07:18 +0000)]
Fix PR11385: A pointer constant expression which has been cast via an integer is
not safely derived. Don't allow lvalue-to-rvalue conversions on the result of
dereferencing such a pointer.

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

12 years agoMigrate a few more modules tests over to -emit-module-from-map.
Douglas Gregor [Wed, 16 Nov 2011 05:16:30 +0000 (05:16 +0000)]
Migrate a few more modules tests over to -emit-module-from-map.

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

12 years agoTeach ccc-analyzer about -fobjc-arc.
Ted Kremenek [Wed, 16 Nov 2011 05:14:42 +0000 (05:14 +0000)]
Teach ccc-analyzer about -fobjc-arc.

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

12 years ago[libclang] Fix crash on invalid code. Fixes rdar://10451854
Argyrios Kyrtzidis [Wed, 16 Nov 2011 02:35:10 +0000 (02:35 +0000)]
[libclang] Fix crash on invalid code. Fixes rdar://10451854

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

12 years ago[libclang] Indexing API: fill the objc category info for a category implementation and
Argyrios Kyrtzidis [Wed, 16 Nov 2011 02:35:05 +0000 (02:35 +0000)]
[libclang] Indexing API: fill the objc category info for a category implementation and
do not crash if no client container is registered for a declaration context.

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

12 years ago[libclang] Indexing API: make sure we do not try to index local declarations.
Argyrios Kyrtzidis [Wed, 16 Nov 2011 02:35:01 +0000 (02:35 +0000)]
[libclang] Indexing API: make sure we do not try to index local declarations.

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

12 years ago[libclang] Indexing API: if the CXIndexOpt_OneRefPerFile option is set, only report...
Argyrios Kyrtzidis [Wed, 16 Nov 2011 02:34:59 +0000 (02:34 +0000)]
[libclang] Indexing API: if the CXIndexOpt_OneRefPerFile option is set, only report one reference
per file.

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

12 years ago[libclang] In lazyCreateDiags, recreate the diagnostic set if the number of diagnostics
Argyrios Kyrtzidis [Wed, 16 Nov 2011 02:34:55 +0000 (02:34 +0000)]
[libclang] In lazyCreateDiags, recreate the diagnostic set if the number of diagnostics
in the ASTUnit changed.

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

12 years agoFix test on Release builds.
Eli Friedman [Wed, 16 Nov 2011 02:19:03 +0000 (02:19 +0000)]
Fix test on Release builds.

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

12 years agoFix a bunch of really nasty bugs in how we compute alignment for reference lvalues...
Eli Friedman [Wed, 16 Nov 2011 00:42:57 +0000 (00:42 +0000)]
Fix a bunch of really nasty bugs in how we compute alignment for reference lvalues.  PR11376.

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

12 years agoSwitch some more of the modules tests over to "-emit-module-from-map",
Douglas Gregor [Wed, 16 Nov 2011 00:21:54 +0000 (00:21 +0000)]
Switch some more of the modules tests over to "-emit-module-from-map",
and remove stray fprintf.

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

12 years agoAdd support for building a module from a module map to the -cc1
Douglas Gregor [Wed, 16 Nov 2011 00:09:06 +0000 (00:09 +0000)]
Add support for building a module from a module map to the -cc1
interface. This is currently limited to modules with umbrella
headers.

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

12 years agoIn Microsoft mode, make "Unqualified lookup into dependent bases of class templates...
Francois Pichet [Tue, 15 Nov 2011 23:33:34 +0000 (23:33 +0000)]
In Microsoft mode, make "Unqualified lookup into dependent bases of class templates" works  inside static functions.

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

12 years agoRevert r144703. It was a dumb idea anyway; will add the new bits more
Douglas Gregor [Tue, 15 Nov 2011 22:58:25 +0000 (22:58 +0000)]
Revert r144703. It was a dumb idea anyway; will add the new bits more
incrementally with a new frontend action.

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

12 years agoCompute whether a class is trivial correctly for template classes with an explicitly...
Eli Friedman [Tue, 15 Nov 2011 22:39:08 +0000 (22:39 +0000)]
Compute whether a class is trivial correctly for template classes with an explicitly deleted or defaulted special member.  PR11387.

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

12 years agoSplit GenerateModuleAction into its own action, which will start
Douglas Gregor [Tue, 15 Nov 2011 21:49:36 +0000 (21:49 +0000)]
Split GenerateModuleAction into its own action, which will start
differing from GeneratePCHAction fairly soon.

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

12 years agoFixed plausible overloads location.
Abramo Bagnara [Tue, 15 Nov 2011 21:43:28 +0000 (21:43 +0000)]
Fixed plausible overloads location.

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

12 years agoAdd a -cc1-level option -fmodule-name=<name>, which will be used when
Douglas Gregor [Tue, 15 Nov 2011 19:35:01 +0000 (19:35 +0000)]
Add a -cc1-level option -fmodule-name=<name>, which will be used when
building modules.

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

12 years agoRemove one group'ed warning.
Fariborz Jahanian [Tue, 15 Nov 2011 19:25:38 +0000 (19:25 +0000)]
Remove one group'ed warning.

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

12 years agoAdd -Wmismatched-method-attributes flag for when attributes in method definition and
Fariborz Jahanian [Tue, 15 Nov 2011 19:13:36 +0000 (19:13 +0000)]
Add -Wmismatched-method-attributes flag for when attributes in method definition and
their decl. do not match. // rdar://10448471

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

12 years agoTypo.
Chad Rosier [Tue, 15 Nov 2011 19:03:03 +0000 (19:03 +0000)]
Typo.

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

12 years agoFix a regression from 143657. The second pass of the warning options should only...
Chad Rosier [Tue, 15 Nov 2011 18:57:32 +0000 (18:57 +0000)]
Fix a regression from 143657.  The second pass of the warning options should only be emitting
warnings/errors for unknown warning options.  getDiagnosticsInGroup returns false if the
diagnostics is found and true otherwise.  Thus, if we're reporting and we have a valid
diagnostic, we were actually setting the flag and causing mayhem.
rdar://10444207

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

12 years agoTeach the CFG builder how to properly destroy temporaries who
Douglas Gregor [Tue, 15 Nov 2011 15:29:30 +0000 (15:29 +0000)]
Teach the CFG builder how to properly destroy temporaries who
lifetimes have been extended via reference binding. The type of the
reference and the type of the temporary are not necessarily the same,
which could cause a crash. Fixes <rdar://problem/10398199>.

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

12 years agoValidate DiagGroup names in TableGen, they're used as command line arguments so we...
Benjamin Kramer [Tue, 15 Nov 2011 12:54:53 +0000 (12:54 +0000)]
Validate DiagGroup names in TableGen, they're used as command line arguments so we don't want shell meta chars in there.

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

12 years agoWarning option typo correction: When two options have the same edit_distance don...
Benjamin Kramer [Tue, 15 Nov 2011 12:26:39 +0000 (12:26 +0000)]
Warning option typo correction: When two options have the same edit_distance don't display either.

Also add a maximum edit distance threshold, so we don't correct "-Wx" to "-W#pragma-messages".

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

12 years agoFixed a cut&paste error introduced in r141336.
Abramo Bagnara [Tue, 15 Nov 2011 11:25:38 +0000 (11:25 +0000)]
Fixed a cut&paste error introduced in r141336.

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

12 years ago[PCH] When serializing an PseudoObjectExpr or AtomicExpr, the serialization code...
Argyrios Kyrtzidis [Tue, 15 Nov 2011 06:20:27 +0000 (06:20 +0000)]
[PCH] When serializing an PseudoObjectExpr or AtomicExpr, the serialization code must be set
otherwise it will crash with asserts on or it will be written as null pointer.

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

12 years ago[libclang] Indexing API: Pass an implicit ObjCInterfaceDecl (@implementation without...
Argyrios Kyrtzidis [Tue, 15 Nov 2011 06:20:24 +0000 (06:20 +0000)]
[libclang] Indexing API: Pass an implicit ObjCInterfaceDecl (@implementation without @interface)
in a separate indexing callback than its implementation.

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

12 years agoUse Decl's isImplicit field to indicate whether an ObjCInterfaceDecl is 'ImplicitInte...
Argyrios Kyrtzidis [Tue, 15 Nov 2011 06:20:21 +0000 (06:20 +0000)]
Use Decl's isImplicit field to indicate whether an ObjCInterfaceDecl is 'ImplicitInterfaceDecl',
no need to store it in another field.

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

12 years ago[libclang] Introduce a new function to apply the indexing callbacks on an existing
Argyrios Kyrtzidis [Tue, 15 Nov 2011 06:20:16 +0000 (06:20 +0000)]
[libclang] Introduce a new function to apply the indexing callbacks on an existing
CXTranslationUnit, mainly to be used for indexing a PCH.

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

12 years agoFix crash in calling convention code expanding an struct with a complex member.
Eli Friedman [Tue, 15 Nov 2011 02:46:03 +0000 (02:46 +0000)]
Fix crash in calling convention code expanding an struct with a complex member.

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

12 years agoResolve placeholder expressions before trying to deduce
John McCall [Tue, 15 Nov 2011 01:35:18 +0000 (01:35 +0000)]
Resolve placeholder expressions before trying to deduce
'auto'.  Introduce a convenience method to make this a bit
easier, and use it elsewhere.

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

12 years agoRemove extra ';'.
Devang Patel [Tue, 15 Nov 2011 01:30:40 +0000 (01:30 +0000)]
Remove extra ';'.

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

12 years agoThe optimizers figured out how to make this store 6.
Nick Lewycky [Tue, 15 Nov 2011 00:19:16 +0000 (00:19 +0000)]
The optimizers figured out how to make this store 6.

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

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