]> granicus.if.org Git - clang/log
clang
12 years agoMake r145697 actually work.
Hans Wennborg [Fri, 2 Dec 2011 20:32:01 +0000 (20:32 +0000)]
Make r145697 actually work.

Use the canonical type of the typedef to compare with the underlying type.

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

12 years agoMake sure that name lookup in C checks whether a name is hidden.
Douglas Gregor [Fri, 2 Dec 2011 20:08:44 +0000 (20:08 +0000)]
Make sure that name lookup in C checks whether a name is hidden.

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

12 years agoMake conversion specifier warning refer to typedef if possible.
Hans Wennborg [Fri, 2 Dec 2011 19:22:15 +0000 (19:22 +0000)]
Make conversion specifier warning refer to typedef if possible.

For example, the warning for printf("%zu", 42.0);
changes from "conversion specifies type 'unsigned long'" to "conversion
specifies type 'size_t' (aka 'unsigned long')"

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

12 years agoWhen making a module visible, also make any of its exported modules
Douglas Gregor [Fri, 2 Dec 2011 19:11:09 +0000 (19:11 +0000)]
When making a module visible, also make any of its exported modules
visible, allowing one to create modules that import (and then
re-export) other modules.

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

12 years agoImplement (de-)serialization of the set of exported modules in a
Douglas Gregor [Fri, 2 Dec 2011 18:58:38 +0000 (18:58 +0000)]
Implement (de-)serialization of the set of exported modules in a
module map.

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

12 years agoNotify the AST writer (via ASTDeserializationListener) when a
Douglas Gregor [Fri, 2 Dec 2011 17:30:13 +0000 (17:30 +0000)]
Notify the AST writer (via ASTDeserializationListener) when a
(sub)module is read from an AST file. This makes sure that the AST
writer knows how to map all modules to their global IDs.

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

12 years agoImplement name hiding for macro definitions within modules, such that
Douglas Gregor [Fri, 2 Dec 2011 15:45:10 +0000 (15:45 +0000)]
Implement name hiding for macro definitions within modules, such that
only the macro definitions from visible (sub)modules will actually be
visible. This provides the same behavior for macros that r145640
provided for declarations.

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

12 years agoFix bitfield handling for record layout with #pragma pack. <rdar://problem/10494810...
Eli Friedman [Fri, 2 Dec 2011 02:38:48 +0000 (02:38 +0000)]
Fix bitfield handling for record layout with #pragma pack.  <rdar://problem/10494810> and PR9560.

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

12 years agoruntime/Linux: Initial support for tying compiler-rt build into Clang build on
Daniel Dunbar [Fri, 2 Dec 2011 02:31:32 +0000 (02:31 +0000)]
runtime/Linux: Initial support for tying compiler-rt build into Clang build on
Linux.
 - Currently just builds a full library, and only on x86, and only for the
   target arch.

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

12 years agoAdd support for AVX registers to clang inline asm. Add a small testcase
Eric Christopher [Fri, 2 Dec 2011 02:12:16 +0000 (02:12 +0000)]
Add support for AVX registers to clang inline asm. Add a small testcase
and update the Sema testcase with a register that we won't hit for a while
I hope.

Fixes rdar://10510405

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

12 years agoClean up some oddly gratuitous vertical whitespace.
Eric Christopher [Fri, 2 Dec 2011 02:12:12 +0000 (02:12 +0000)]
Clean up some oddly gratuitous vertical whitespace.

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

12 years agoRename function.
Eric Christopher [Fri, 2 Dec 2011 02:12:09 +0000 (02:12 +0000)]
Rename function.

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

12 years agoImplementing parsing and resolution of module export declarations
Douglas Gregor [Fri, 2 Dec 2011 01:47:07 +0000 (01:47 +0000)]
Implementing parsing and resolution of module export declarations
within module maps, which will (eventually) be used to re-export a
module from another module. There are still some pieces missing,
however.

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

12 years agoFix test regression introduced by r145656. When seeing a string literal that isn...
Ted Kremenek [Fri, 2 Dec 2011 01:30:14 +0000 (01:30 +0000)]
Fix test regression introduced by r145656.  When seeing a string literal that isn't accepted by 'asm', skip to the enclosing ')'.

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

12 years agoDiagnose use of wide string literal in 'asm' instead of crashing. Fixes <rdar:/...
Ted Kremenek [Fri, 2 Dec 2011 00:35:46 +0000 (00:35 +0000)]
Diagnose use of wide string literal in 'asm' instead of crashing.  Fixes <rdar://problem/10465079>.

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

12 years agoFix wrong-code bug when a const automatic variable of struct type has both a
Richard Smith [Fri, 2 Dec 2011 00:30:33 +0000 (00:30 +0000)]
Fix wrong-code bug when a const automatic variable of struct type has both a
mutable member and a constant initializer. We'd previously promoted such
variables to global constants, resulting in nasal demons if the mutable member
was modified.

This is only a temporary fix. The subtle interplay between isConstantInitializer
and CGExprConstant is very bug-prone; there are some other issues in this area
which I will be addressing in subsequent, more major reworking of this code.

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

12 years ago[asan] update docs to allow, but discourage, -O0
Kostya Serebryany [Fri, 2 Dec 2011 00:24:42 +0000 (00:24 +0000)]
[asan] update docs to allow, but discourage, -O0

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

12 years agoWhen we're passing a vector with an illegal type through memory on x86-64, use byval...
Eli Friedman [Fri, 2 Dec 2011 00:11:43 +0000 (00:11 +0000)]
When we're passing a vector with an illegal type through memory on x86-64, use byval so we're sure the backend does the right thing.  Fixes va_arg with illegal vectors and an obscure ABI mismatch with __m64 vectors.

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

12 years agoDriver/Darwin: Add ASAN runtime library link support.
Daniel Dunbar [Thu, 1 Dec 2011 23:40:18 +0000 (23:40 +0000)]
Driver/Darwin: Add ASAN runtime library link support.

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

12 years agoImplement name hiding for declarations deserialized from a non-visible
Douglas Gregor [Thu, 1 Dec 2011 22:20:10 +0000 (22:20 +0000)]
Implement name hiding for declarations deserialized from a non-visible
module. When that module becomes visible, so do those declarations.

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

12 years agoFix -forwardingTargetForSelector: (GNUstep runtime) which was broken for the
David Chisnall [Thu, 1 Dec 2011 18:40:09 +0000 (18:40 +0000)]
Fix -forwardingTargetForSelector: (GNUstep runtime) which was broken for the
old dispatch mechanism when I introduced the new one.

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

12 years agoAdd support for AMD's bulldozer.
Benjamin Kramer [Thu, 1 Dec 2011 18:23:59 +0000 (18:23 +0000)]
Add support for AMD's bulldozer.

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

12 years agoIntroduce the notion of name visibility into modules. For a given
Douglas Gregor [Thu, 1 Dec 2011 17:11:21 +0000 (17:11 +0000)]
Introduce the notion of name visibility into modules. For a given
(sub)module, all of the names may be hidden, just the macro names may
be exposed (for example, after the preprocessor has seen the import of
the module but the parser has not), or all of the names may be
exposed. Importing a module makes its names, and the names in any of
its non-explicit submodules, visible to name lookup (transitively).

This commit only introduces the notion of name visible and marks
modules and submodules as visible when they are imported. The actual
name-hiding logic in the AST reader will follow (along with test cases).

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

12 years ago[analyzer] Make KeychainAPI checker less aggressive. radar://10508828
Anna Zaks [Thu, 1 Dec 2011 16:41:58 +0000 (16:41 +0000)]
[analyzer] Make KeychainAPI checker less aggressive. radar://10508828

We trigger an error if free is called after a possibly failed allocation. Do not trigger the error if we know that the buffer is not null.

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

12 years agoWhen typo-correction an Objective-C superclass name, don't
Douglas Gregor [Thu, 1 Dec 2011 15:37:53 +0000 (15:37 +0000)]
When typo-correction an Objective-C superclass name, don't
typo-correct to ourselves.

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

12 years agoAdd Microsoft mangling of constructors and destructors. Patch by Dmitry!
Michael J. Spencer [Thu, 1 Dec 2011 09:55:00 +0000 (09:55 +0000)]
Add Microsoft mangling of constructors and destructors. Patch by Dmitry!

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

12 years agoChange the Microsoft __interface keyword to be an alias for struct (not class) since...
Francois Pichet [Thu, 1 Dec 2011 08:30:47 +0000 (08:30 +0000)]
Change the Microsoft __interface keyword to be an alias for struct (not class) since members are public by default.

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

12 years agoFix typo.
Ted Kremenek [Thu, 1 Dec 2011 07:39:23 +0000 (07:39 +0000)]
Fix typo.

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

12 years ago[analyzer] Refactor checkers to use helper function for getting callee Decl and name.
Anna Zaks [Thu, 1 Dec 2011 05:57:37 +0000 (05:57 +0000)]
[analyzer] Refactor checkers to use helper function for getting callee Decl and name.

We are getting name of the called function or it's declaration in a few checkers. Refactor them to use the helper function in the CheckerContext.

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

12 years agoWhen analyzing a C++ method (without a specific caller), assume 'this' is non-null...
Ted Kremenek [Thu, 1 Dec 2011 05:29:42 +0000 (05:29 +0000)]
When analyzing a C++ method (without a specific caller), assume 'this' is non-null.  Fixes <rdar://problem/10508787>.

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

12 years agoDon't use a varargs convention for calls unprototyped functions where one of the...
Eli Friedman [Thu, 1 Dec 2011 04:53:19 +0000 (04:53 +0000)]
Don't use a varargs convention for calls unprototyped functions where one of the arguments is an AVX vector.

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

12 years ago[libclang] Create a diagnostic set to pass at the end of indexing.
Argyrios Kyrtzidis [Thu, 1 Dec 2011 02:42:50 +0000 (02:42 +0000)]
[libclang] Create a diagnostic set to pass at the end of indexing.

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

12 years agoInfer the submodule ID for a given declaration based on the location
Douglas Gregor [Thu, 1 Dec 2011 02:07:58 +0000 (02:07 +0000)]
Infer the submodule ID for a given declaration based on the location
of that declaration, and encode the submodule ID in each declaration
stored in an AST file.

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

12 years agoWhen sending a message to a receiver that has "unknown any" type,
Douglas Gregor [Thu, 1 Dec 2011 01:37:36 +0000 (01:37 +0000)]
When sending a message to a receiver that has "unknown any" type,
force the unknown any type to "id" so that the message send can be
completed without requiring a case. Fixes <rdar://problem/10506646>.

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

12 years agoParmVarDecls have no linkage. Previously we would report that parameters
Argyrios Kyrtzidis [Thu, 1 Dec 2011 01:28:21 +0000 (01:28 +0000)]
ParmVarDecls have no linkage. Previously we would report that parameters
in type signatures have external linkage.

Fixes rdar://10058317.

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

12 years agoSwitch the ID numbers used for submodule IDs in the AST reader over to
Douglas Gregor [Thu, 1 Dec 2011 00:59:36 +0000 (00:59 +0000)]
Switch the ID numbers used for submodule IDs in the AST reader over to
a standard global/local scheme, so that submodule definitions will
eventually be able to refer to submodules in other top-level
modules. We'll need this functionality soonish.

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

12 years agoSpecially whitelist the selector 'addOperationWithBlock:' for the retain-cycle checki...
Ted Kremenek [Thu, 1 Dec 2011 00:59:21 +0000 (00:59 +0000)]
Specially whitelist the selector 'addOperationWithBlock:' for the retain-cycle checking in -Warc-retain-cycles.  This commonly
is hit by users using NSOperationQueue.  Fixes <rdar://problem/10465721>.

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

12 years agoFurther tweak -Wurneachable-code and templates by allowing the warning to run on
Ted Kremenek [Thu, 1 Dec 2011 00:59:17 +0000 (00:59 +0000)]
Further tweak -Wurneachable-code and templates by allowing the warning to run on
explicit template specializations (which represent actual functions somebody wrote).

Along the way, refactor some other code which similarly cares about whether or
not they are looking at a template instantiation.

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

12 years agoFix MSVC class layout for empty classes. Patch by Dmitry Sokolov.
Eli Friedman [Thu, 1 Dec 2011 00:37:01 +0000 (00:37 +0000)]
Fix MSVC class layout for empty classes.  Patch by Dmitry Sokolov.

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

12 years agoAnother GCC fix
Douglas Gregor [Wed, 30 Nov 2011 23:48:34 +0000 (23:48 +0000)]
Another GCC fix

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

12 years agoRevert most of r145372 for now. Lookahead beyond the ';' in a function
Richard Smith [Wed, 30 Nov 2011 23:45:35 +0000 (23:45 +0000)]
Revert most of r145372 for now. Lookahead beyond the ';' in a function
declaration tickles a bug in the way we handle visibility pragmas.

The improvement to error recovery for template function definitions declared
with the 'typedef' specifier in r145372 is unrelated and not reverted here.

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

12 years agoUnbreak build with GCC. Clang is too lame to diagnose this particular ill-formedness
Douglas Gregor [Wed, 30 Nov 2011 23:29:56 +0000 (23:29 +0000)]
Unbreak build with GCC. Clang is too lame to diagnose this particular ill-formedness

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

12 years agoPromote ModuleMap::Module to a namespace-scope class in the Basic
Douglas Gregor [Wed, 30 Nov 2011 23:21:26 +0000 (23:21 +0000)]
Promote ModuleMap::Module to a namespace-scope class in the Basic
library, since modules cut across all of the libraries. Rename
serialization::Module to serialization::ModuleFile to side-step the
annoying naming conflict. Prune a bunch of ModuleMap.h includes that
are no longer needed (most files only needed the Module type).

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

12 years ago[PCH] In ASTReader::FinishedDeserializing, after we do PassInterestingDeclsToConsumer
Argyrios Kyrtzidis [Wed, 30 Nov 2011 23:18:26 +0000 (23:18 +0000)]
[PCH] In ASTReader::FinishedDeserializing, after we do PassInterestingDeclsToConsumer
we may end up having added more pending stuff to do, so go in a loop until everything
is cleared out.

This fixes the error in rdar://10278815 which has a certain David Lynch-esque quality..

  error: unknown type name 'BOOL'; did you mean 'BOOL'?

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

12 years agoTest case for fix committed in r145441.
Lang Hames [Wed, 30 Nov 2011 23:03:25 +0000 (23:03 +0000)]
Test case for fix committed in r145441.

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

12 years agomake asan work at -O0, clang part. Patch by glider@google.com
Kostya Serebryany [Wed, 30 Nov 2011 22:20:21 +0000 (22:20 +0000)]
make asan work at -O0, clang part. Patch by glider@google.com

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

12 years agoPer an offline conversation with John McCall, have StmtPrinter actually print out...
Ted Kremenek [Wed, 30 Nov 2011 22:08:08 +0000 (22:08 +0000)]
Per an offline conversation with John McCall, have StmtPrinter actually print out the source expression for OpaqueValueExpr.

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

12 years agoDon't run -Wunreachable-code on template instantiations. Different instantiations...
Ted Kremenek [Wed, 30 Nov 2011 21:22:09 +0000 (21:22 +0000)]
Don't run -Wunreachable-code on template instantiations.  Different instantiations may produce different unreachable code results, and it is very difficult for us to prove that ALL instantiations of a template have specific unreachable code.  If we come up with a better solution, then we can revisit this, but this approach will at least greatly reduce the noise of this warning for code that makes use of templates.

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

12 years agoDon't collide loop variable names (to appease GCC)
Matt Beaumont-Gay [Wed, 30 Nov 2011 19:41:21 +0000 (19:41 +0000)]
Don't collide loop variable names (to appease GCC)

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

12 years agoNote that we'll need to handle __include_macros specially in the module loader
Douglas Gregor [Wed, 30 Nov 2011 19:39:08 +0000 (19:39 +0000)]
Note that we'll need to handle __include_macros specially in the module loader

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

12 years agoGet the -march argument based on the target MIPS architecture or cpu and pass
Akira Hatanaka [Wed, 30 Nov 2011 19:31:38 +0000 (19:31 +0000)]
Get the -march argument based on the target MIPS architecture or cpu and pass
it to GNU assembler. In addition, change function getMipsArchFromCPU() so that
it can be reused in ConstructJob().

Patch by Simon Atanasyan.

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

12 years agoUpdate CMake build.
Benjamin Kramer [Wed, 30 Nov 2011 18:56:24 +0000 (18:56 +0000)]
Update CMake build.

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

12 years agoMove the module auto-import logic after the logic that allows a
Douglas Gregor [Wed, 30 Nov 2011 18:12:06 +0000 (18:12 +0000)]
Move the module auto-import logic after the logic that allows a
callback client to suggest an alternative search path and after we
complain when the included file can't be found. The former can't be
tested in isolation, the latter doesn't actually matter (because we
won't make a module suggestion if no header is available). However,
the flow is better this way.

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

12 years agoTrivial indentation fix for the code I just committed
Douglas Gregor [Wed, 30 Nov 2011 18:03:26 +0000 (18:03 +0000)]
Trivial indentation fix for the code I just committed

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

12 years agoIntroduce an opt-in warning indicating when the compiler is treating
Douglas Gregor [Wed, 30 Nov 2011 18:02:36 +0000 (18:02 +0000)]
Introduce an opt-in warning indicating when the compiler is treating
an #include/#import as a module import.

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

12 years agoImplement (de-)serialization of the description of a module and its
Douglas Gregor [Wed, 30 Nov 2011 17:33:56 +0000 (17:33 +0000)]
Implement (de-)serialization of the description of a module and its
submodules. This information will eventually be used for name hiding
when dealing with submodules. For now, we only use it to ensure that
the module "key" returned when loading a module will always be a
module (rather than occasionally being a FileEntry).

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

12 years ago[analyzer] Add checker callback documentation.
Anna Zaks [Wed, 30 Nov 2011 17:12:52 +0000 (17:12 +0000)]
[analyzer] Add checker callback documentation.

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

12 years agoUse raw_ostream::indent.
Benjamin Kramer [Wed, 30 Nov 2011 15:07:30 +0000 (15:07 +0000)]
Use raw_ostream::indent.

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

12 years agoSwitch the module map printer over to
Douglas Gregor [Wed, 30 Nov 2011 15:00:49 +0000 (15:00 +0000)]
Switch the module map printer over to
raw_ostream::write_escaped. Thanks, Benjamin!

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

12 years agoAdd preprocessor-only test for submodule imports
Douglas Gregor [Wed, 30 Nov 2011 14:57:39 +0000 (14:57 +0000)]
Add preprocessor-only test for submodule imports

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

12 years agoFix the instantiation of pseudo-object expressions. This is a
John McCall [Wed, 30 Nov 2011 04:42:31 +0000 (04:42 +0000)]
Fix the instantiation of pseudo-object expressions.  This is a
really bad way to go about this, but I'm not sure there's a better
choice without substantial changes to TreeTransform --- most
notably, preserving implicit semantic nodes instead of discarding
and rebuilding them.

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

12 years agoWhen writing a module file, pass the module through to the AST
Douglas Gregor [Wed, 30 Nov 2011 04:39:39 +0000 (04:39 +0000)]
When writing a module file, pass the module through to the AST
writer. No functionality change.

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

12 years agoTeach the preprocessor how to handle module import declarations that
Douglas Gregor [Wed, 30 Nov 2011 04:26:53 +0000 (04:26 +0000)]
Teach the preprocessor how to handle module import declarations that
involve submodules (e.g., importing std.vector), rather than always
importing the top-level module.

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

12 years agoWhen loading a module that involves submodules (e.g., std.vector),
Douglas Gregor [Wed, 30 Nov 2011 04:03:44 +0000 (04:03 +0000)]
When loading a module that involves submodules (e.g., std.vector),
check whether the named submodules themselves are actually
valid, and drill down to the named submodule (although we don't do
anything with it yet). Perform typo correction on the submodule names
when possible.

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

12 years agoAdd bigger method type encodings to protocol objects. <rdar://problem/10492418>
Bob Wilson [Wed, 30 Nov 2011 01:57:58 +0000 (01:57 +0000)]
Add bigger method type encodings to protocol objects.  <rdar://problem/10492418>

The new metadata are method @encode strings with additional data.

1. Each Objective-C object is marked with its class name and protocol names.
The same is done for property @encode already.

2. Each block object is marked with its function prototype's @encoding. For
example, a method parameter that is a block object that itself returns void
and takes an int would look like:
    @?<v@?i>

These new method @encode strings are stored in a single array pointed to by structs protocol_t and objc_protocol_ext.

Patch provided by Greg Parker!

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

12 years agowhen -faddress-sanitizer is present, add required flags to the linker command (linux...
Kostya Serebryany [Wed, 30 Nov 2011 01:39:16 +0000 (01:39 +0000)]
when -faddress-sanitizer is present, add required flags to the linker command (linux-only)

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

12 years agoSwitch the module-loading interfaces and parser from a simple
Douglas Gregor [Wed, 30 Nov 2011 00:36:36 +0000 (00:36 +0000)]
Switch the module-loading interfaces and parser from a simple
top-level module name to a module path (e.g., std.vector). We're still
missing a number of pieces for this actually to do something.

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

12 years agoMake sure that forward declarations are marked as such in the debug info
Eric Christopher [Tue, 29 Nov 2011 23:57:40 +0000 (23:57 +0000)]
Make sure that forward declarations are marked as such in the debug info
for the structure type.

rdar://10499337

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

12 years ago[libclang] Do the ConcurrencyCheck at the beginning of clang_findReferencesInFile.
Argyrios Kyrtzidis [Tue, 29 Nov 2011 23:21:50 +0000 (23:21 +0000)]
[libclang] Do the ConcurrencyCheck at the beginning of clang_findReferencesInFile.

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

12 years agoChange processor names. Patch by Simon Atanasyan.
Akira Hatanaka [Tue, 29 Nov 2011 23:09:24 +0000 (23:09 +0000)]
Change processor names. Patch by Simon Atanasyan.

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

12 years agoRevert r145244. It causes us to create broken ASTs with missing type information
Richard Smith [Tue, 29 Nov 2011 22:48:16 +0000 (22:48 +0000)]
Revert r145244. It causes us to create broken ASTs with missing type information
for some cast expressions.

Original commit message:

Removed useless ImplicitCast nodes in explicit cstyle and static casts

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

12 years agoSuppress -Warray-bounds for classes (not just structs) where the last field is
Matt Beaumont-Gay [Tue, 29 Nov 2011 22:43:53 +0000 (22:43 +0000)]
Suppress -Warray-bounds for classes (not just structs) where the last field is
a 1-length character array.

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

12 years agoEliminate the -emit-module option, which emitted a module by parsing a
Douglas Gregor [Tue, 29 Nov 2011 22:42:06 +0000 (22:42 +0000)]
Eliminate the -emit-module option, which emitted a module by parsing a
source file (e.g., a header). Immediately steal this useful option
name for building modules from a module map file.

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

12 years agoTest isa<FunctionDecl> to exclude objective-C methods. This ensures the following...
Lang Hames [Tue, 29 Nov 2011 22:37:13 +0000 (22:37 +0000)]
Test isa<FunctionDecl> to exclude objective-C methods. This ensures the following cast will never fail.

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

12 years agoEscape strings when printing module maps, for silly operating systems
Douglas Gregor [Tue, 29 Nov 2011 22:27:12 +0000 (22:27 +0000)]
Escape strings when printing module maps, for silly operating systems
that use \ as a separator.

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

12 years agoSwitch on-demand module building over to use module maps, always. When
Douglas Gregor [Tue, 29 Nov 2011 21:59:16 +0000 (21:59 +0000)]
Switch on-demand module building over to use module maps, always. When
we infer the module map, we'll just print the module map to a
temporary file and generate the module using that.

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

12 years agoRelax RegionStore to allow loads from CodeTextRegions. Apparently you can actually...
Ted Kremenek [Tue, 29 Nov 2011 19:39:29 +0000 (19:39 +0000)]
Relax RegionStore to allow loads from CodeTextRegions.  Apparently you can actually write code that does this.  This seems worthy of a checker, but the StoreManager should handle the memory abstraction without crashing.  Fixes PR 11450.

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

12 years agoMerge branch 'yo-dawg-i-herd-u-like-arrays'
Matt Beaumont-Gay [Tue, 29 Nov 2011 19:27:11 +0000 (19:27 +0000)]
Merge branch 'yo-dawg-i-herd-u-like-arrays'

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

12 years agoPlace "use @dynamic or provide a method implementation" warnings under a -W flag.
Ted Kremenek [Tue, 29 Nov 2011 19:18:47 +0000 (19:18 +0000)]
Place "use @dynamic or provide a method implementation" warnings under a -W flag.

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

12 years agoTeach the module import mechanism how to rebuild modules expressed via
Douglas Gregor [Tue, 29 Nov 2011 19:06:37 +0000 (19:06 +0000)]
Teach the module import mechanism how to rebuild modules expressed via
module map, rather than assuming that there is an umbrella
header. This allows us to automatically build umbrella-less modules.

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

12 years agoStart refactoring to use module maps when rebuilding a module
Douglas Gregor [Tue, 29 Nov 2011 18:31:39 +0000 (18:31 +0000)]
Start refactoring to use module maps when rebuilding a module
on-the-fly. No functionality change.

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

12 years agoInitialize NumWarningsInPreamble in ASTUnit's constructor, for safety.
Argyrios Kyrtzidis [Tue, 29 Nov 2011 18:18:33 +0000 (18:18 +0000)]
Initialize NumWarningsInPreamble in ASTUnit's constructor, for safety.

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

12 years agoExpose the printing of module maps as part of the ModuleMap::Module
Douglas Gregor [Tue, 29 Nov 2011 18:17:59 +0000 (18:17 +0000)]
Expose the printing of module maps as part of the ModuleMap::Module
interface. No functionality change.

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

12 years agoThe cheap version of getName() is sufficient here.
Benjamin Kramer [Tue, 29 Nov 2011 14:46:55 +0000 (14:46 +0000)]
The cheap version of getName() is sufficient here.

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

12 years agoPreserve constness.
Benjamin Kramer [Tue, 29 Nov 2011 12:31:20 +0000 (12:31 +0000)]
Preserve constness.

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

12 years agoSilence GCC warnings, RefCountedBase is meant to be default-initialized here.
Benjamin Kramer [Tue, 29 Nov 2011 11:31:35 +0000 (11:31 +0000)]
Silence GCC warnings, RefCountedBase is meant to be default-initialized here.

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

12 years agoAdd fix-it to remove 'typedef' from function template definitions. Such a token
Richard Smith [Tue, 29 Nov 2011 09:09:06 +0000 (09:09 +0000)]
Add fix-it to remove 'typedef' from function template definitions. Such a token
was probably meant to be 'typename', which we will have already suggested if it
is appropriate.

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

12 years agoFix leaking of LexedMethod objects created for caching objc method definitions tokens
Argyrios Kyrtzidis [Tue, 29 Nov 2011 08:14:54 +0000 (08:14 +0000)]
Fix leaking of LexedMethod objects created for caching objc method definitions tokens
for late parsing.

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

12 years ago[libclang] Fix leak in clang_indexSourceFile_Impl
Argyrios Kyrtzidis [Tue, 29 Nov 2011 08:14:50 +0000 (08:14 +0000)]
[libclang] Fix leak in clang_indexSourceFile_Impl

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

12 years ago[Win32] Catch exceptions (eg. segfault) on waiting for invoked clang from the driver.
NAKAMURA Takumi [Tue, 29 Nov 2011 07:47:04 +0000 (07:47 +0000)]
[Win32] Catch exceptions (eg. segfault) on waiting for invoked clang from the driver.

clang/lib/Driver/Driver.cpp: Don't pass through negative exit status, or parent would be confused.

llvm::sys::Program::Wait(): Suppose 0x8000XXXX and 0xC000XXXX as abnormal exit code and pass it as negative value.

Win32 Exception Handler: Exit with ExceptionCode on an unhandle exception.

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

12 years ago[libclang] Make the test portable.
Argyrios Kyrtzidis [Tue, 29 Nov 2011 05:48:01 +0000 (05:48 +0000)]
[libclang] Make the test portable.

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

12 years agoPR10101: Recover better from a common copy-paste error: if a function
Richard Smith [Tue, 29 Nov 2011 05:27:40 +0000 (05:27 +0000)]
PR10101: Recover better from a common copy-paste error: if a function
declaration at namespace scope is followed by a semicolon and an open-brace
(or in C++, a 'try', ':' or '='), then the error is probably a function
definition with a spurious ';', rather than a mysterious '{'.

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

12 years ago[libclang] Make clang_findReferencesInFile also work on macros (find all expansions...
Argyrios Kyrtzidis [Tue, 29 Nov 2011 03:14:11 +0000 (03:14 +0000)]
[libclang] Make clang_findReferencesInFile also work on macros (find all expansions/definition
of a macro in a file).

As a bonus, also make searching for declarations more efficient by ignoring
preprocessing entities when we know that we are looking for a declaration.

Fixes rdar://10427411.

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

12 years agoAdd Clang release notes for OpenCL C support.
Peter Collingbourne [Tue, 29 Nov 2011 02:03:07 +0000 (02:03 +0000)]
Add Clang release notes for OpenCL C support.

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

12 years agoFix URL typo.
Peter Collingbourne [Tue, 29 Nov 2011 02:03:03 +0000 (02:03 +0000)]
Fix URL typo.

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

12 years agoobjc: warn if NSObject attribute appears other than in a typedef.
Fariborz Jahanian [Tue, 29 Nov 2011 01:48:40 +0000 (01:48 +0000)]
objc: warn if NSObject attribute appears other than in a typedef.
// rdar://10453342

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

12 years agoFix serialized diagnostics to handle FixIts that only remove text. Fixes <rdar:...
Ted Kremenek [Tue, 29 Nov 2011 00:30:52 +0000 (00:30 +0000)]
Fix serialized diagnostics to handle FixIts that only remove text.  Fixes <rdar://problem/10473903>.

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

12 years agoFix a spelling error pointed out by Sebastien, and tidy up the
Chandler Carruth [Tue, 29 Nov 2011 00:24:20 +0000 (00:24 +0000)]
Fix a spelling error pointed out by Sebastien, and tidy up the
formatting here a bit... mostly to my preferred bikeshed-blue.

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

12 years agoRemove the last of my notes. I don't think these really need to be in
Chandler Carruth [Tue, 29 Nov 2011 00:24:18 +0000 (00:24 +0000)]
Remove the last of my notes. I don't think these really need to be in
the release notes despite their awesomeness. If we had a thorough
discussion of the performance of Clang in 2.9 vs. 3.0, the first would
be more relevant, but we don't. The serialization stuff hopefully isn't
terribly visible to end users.

Objections to these omissions are of course welcome. =]

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

12 years agoLast major chunk of features. This covers a couple of language
Chandler Carruth [Tue, 29 Nov 2011 00:15:26 +0000 (00:15 +0000)]
Last major chunk of features. This covers a couple of language
extensions and one infrastructure feature addition that has a direct
impact on other projects which use Clang.

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