]> granicus.if.org Git - clang/log
clang
12 years agoSimplify crash cleanup logic in ASTUnit::LoadFromCommandLine() by zeroing out two...
Ted Kremenek [Thu, 17 Nov 2011 23:01:17 +0000 (23:01 +0000)]
Simplify crash cleanup logic in ASTUnit::LoadFromCommandLine() by zeroing out two IntrusiveRefCnt pointers after we have assigned their respective values into fields of ASTUnit.

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

12 years ago[analyzer] Minor tweaks to the ProgramState::isTainted().
Anna Zaks [Thu, 17 Nov 2011 22:59:00 +0000 (22:59 +0000)]
[analyzer] Minor tweaks to the ProgramState::isTainted().

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

12 years ago[analyzer] Add a helper method.
Anna Zaks [Thu, 17 Nov 2011 22:57:01 +0000 (22:57 +0000)]
[analyzer] Add a helper method.
Naming could be improved.. But we should first rename the classes in the SVal hierarchy.

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

12 years agoConstant expression evaluation: add support for evaluation of member pointers
Richard Smith [Thu, 17 Nov 2011 22:56:20 +0000 (22:56 +0000)]
Constant expression evaluation: add support for evaluation of member pointers
and base-to-derived casts, and add proper handling of temporaries.

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

12 years agoWhen making a suggestion regarding which module to load rather than
Douglas Gregor [Thu, 17 Nov 2011 22:44:56 +0000 (22:44 +0000)]
When making a suggestion regarding which module to load rather than
preprocess/parse a header, report back with an actual module (which
may be a submodule) rather than just the name of the module.

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

12 years agoAdd the notion of "framework" modules to module maps. Framework
Douglas Gregor [Thu, 17 Nov 2011 22:09:43 +0000 (22:09 +0000)]
Add the notion of "framework" modules to module maps. Framework
modules (obviously) describe frameworks, and understand the header
layout of frameworks.

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

12 years agoIf we're dealing with an overridden buffer in the AST reader, load the
Douglas Gregor [Thu, 17 Nov 2011 19:08:51 +0000 (19:08 +0000)]
If we're dealing with an overridden buffer in the AST reader, load the
file as a virtual file with the stored modification time and size.

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

12 years agodocs/UsersManual.html: Remove obsolete mingw issue.
NAKAMURA Takumi [Thu, 17 Nov 2011 07:54:13 +0000 (07:54 +0000)]
docs/UsersManual.html: Remove obsolete mingw issue.

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

12 years agotest/Frontend/dependency-gen.c: Relax expressions for Win32 host (mingw msys).
NAKAMURA Takumi [Thu, 17 Nov 2011 07:21:33 +0000 (07:21 +0000)]
test/Frontend/dependency-gen.c: Relax expressions for Win32 host (mingw msys).

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

12 years agoRevert r132539 for now, "My testing shows that function stat has no problem with...
NAKAMURA Takumi [Thu, 17 Nov 2011 06:16:05 +0000 (06:16 +0000)]
Revert r132539 for now, "My testing shows that function stat has no problem with trailing separators. (tested on Windows and Darwin)."

It caused PR10331. MSVCRT stat() cannot strip trailing '/'. (can '\')

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

12 years agoInclude named unions in union member init checking
David Blaikie [Thu, 17 Nov 2011 06:01:57 +0000 (06:01 +0000)]
Include named unions in union member init checking

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

12 years agoIn Microsoft mode, make "Unqualified lookup into dependent bases of class templates...
Francois Pichet [Thu, 17 Nov 2011 03:44:24 +0000 (03:44 +0000)]
In Microsoft mode, make "Unqualified lookup into dependent bases of class templates" works  inside default argument instantiation.

This is a little bit tricky because during default argument instantiation the CurContext points to a CXXMethodDecl but we can't use the keyword this or have an implicit member call generated.

This fixes 2 errors when parsing MFC code with clang.

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

12 years agoActually free memory for the module maps
Douglas Gregor [Thu, 17 Nov 2011 02:05:44 +0000 (02:05 +0000)]
Actually free memory for the module maps

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

12 years agoTry to appease the failing buildbot where I can't reproduce the problem
Douglas Gregor [Thu, 17 Nov 2011 01:44:33 +0000 (01:44 +0000)]
Try to appease the failing buildbot where I can't reproduce the problem

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

12 years agoWhen we're loading a framework header, first try to turn the framework
Douglas Gregor [Thu, 17 Nov 2011 01:41:17 +0000 (01:41 +0000)]
When we're loading a framework header, first try to turn the framework
into a module. This module can either be loaded from a module map in
the framework directory (which isn't quite working yet) or inferred
from an umbrella header (which does work, and replaces the existing
hack).

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

12 years ago[analysis] Constify CheckerContext.
Anna Zaks [Thu, 17 Nov 2011 01:09:19 +0000 (01:09 +0000)]
[analysis] Constify CheckerContext.

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

12 years ago[analyzer] Put CheckerConext::getCalleeName out of line.
Anna Zaks [Thu, 17 Nov 2011 01:09:15 +0000 (01:09 +0000)]
[analyzer] Put CheckerConext::getCalleeName out of line.

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

12 years agoclang/Darwin: Use the compiler-rt provided profile library.
Daniel Dunbar [Thu, 17 Nov 2011 00:36:57 +0000 (00:36 +0000)]
clang/Darwin: Use the compiler-rt provided profile library.

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

12 years agotests/Driver/darwin-ld.c: Get rid of the "splatter" test case. We have enough
Daniel Dunbar [Thu, 17 Nov 2011 00:36:53 +0000 (00:36 +0000)]
tests/Driver/darwin-ld.c: Get rid of the "splatter" test case. We have enough
other coverage that actually properly checks features such that this test is not
really adding value anymore.

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

12 years agoAdd missing header for modules test.
Douglas Gregor [Wed, 16 Nov 2011 23:41:39 +0000 (23:41 +0000)]
Add missing header for modules test.

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

12 years agobuild/make/compiler-rt: Don't attempt to build compiler-rt runtime libraries
Daniel Dunbar [Wed, 16 Nov 2011 23:22:07 +0000 (23:22 +0000)]
build/make/compiler-rt: Don't attempt to build compiler-rt runtime libraries
when cross compiling under the current organization.
 - See verbose comment for explanation, justification, and how to fix.

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

12 years agoA module with an umbrella header assumes that all of the headers in
Douglas Gregor [Wed, 16 Nov 2011 23:02:25 +0000 (23:02 +0000)]
A module with an umbrella header assumes that all of the headers in
the umbrella header's directory and its subdirectories are part of the
module (that's why it's an umbrella). Make sure that these headers are
considered to be part of the module for lookup purposes.

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

12 years agoAdded missing ImplicitCastExpr around conversion operator call.
Abramo Bagnara [Wed, 16 Nov 2011 22:46:05 +0000 (22:46 +0000)]
Added missing ImplicitCastExpr around conversion operator call.

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

12 years agoFix Neon builtin pointer argument checking for "sret" builtins.
Bob Wilson [Wed, 16 Nov 2011 21:32:23 +0000 (21:32 +0000)]
Fix Neon builtin pointer argument checking for "sret" builtins.

The code for checking Neon builtin pointer argument types was assuming that
there would only be one pointer argument.  But, for vld2-4 builtins, the first
argument is a special sret pointer where the result will be stored.  So,
instead of scanning all the arguments to find a pointer, have TableGen figure
out the index of the pointer argument that needs checking.  That's better than
scanning all the arguments regardless.  <rdar://problem/10448804>

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

12 years agoFixed crash with initializer lists and unnamed bitfields in the RegionStore
Jim Goodnow II [Wed, 16 Nov 2011 20:29:27 +0000 (20:29 +0000)]
Fixed crash with initializer lists and unnamed bitfields in the RegionStore
Manager. Added test to ensure proper binding of initialized values.
This patch fixes PR11249.

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

12 years agoImplement (de-)serialization of the buffer contents for an overridden
Douglas Gregor [Wed, 16 Nov 2011 20:05:18 +0000 (20:05 +0000)]
Implement (de-)serialization of the buffer contents for an overridden
file in the source manager. This allows us to properly create and use
modules described by module map files without umbrella headers (or
with incompletely umbrella headers). More generally, we can actually
build a PCH file that makes use of  file -> buffer remappings, which
could be useful in libclang in the future.

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

12 years agoUpdate CMake build.
Benjamin Kramer [Wed, 16 Nov 2011 20:05:08 +0000 (20:05 +0000)]
Update CMake build.

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

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