Commit Graph

34252 Commits

Author SHA1 Message Date
Eli Friedman f37bd2f2f1 Don't use a varargs convention for calls unprototyped functions where one of the arguments is an AVX vector.
llvm-svn: 145574
2011-12-01 04:53:19 +00:00
Argyrios Kyrtzidis f2d99b0d38 [libclang] Create a diagnostic set to pass at the end of indexing.
llvm-svn: 145557
2011-12-01 02:42:50 +00:00
Douglas Gregor a28bcddef6 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.

llvm-svn: 145555
2011-12-01 02:07:58 +00:00
Douglas Gregor d8fb1e30eb 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>.

llvm-svn: 145552
2011-12-01 01:37:36 +00:00
Argyrios Kyrtzidis 79d0428046 ParmVarDecls have no linkage. Previously we would report that parameters
in type signatures have external linkage.

Fixes rdar://10058317.

llvm-svn: 145551
2011-12-01 01:28:21 +00:00
Douglas Gregor 253eefe0df 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.

llvm-svn: 145549
2011-12-01 00:59:36 +00:00
Ted Kremenek 764d63ad94 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>.

llvm-svn: 145548
2011-12-01 00:59:21 +00:00
Ted Kremenek 85825aebc9 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.

llvm-svn: 145547
2011-12-01 00:59:17 +00:00
Eli Friedman 83a1258342 Fix MSVC class layout for empty classes. Patch by Dmitry Sokolov.
llvm-svn: 145544
2011-12-01 00:37:01 +00:00
Douglas Gregor 1da6f4b435 Another GCC fix
llvm-svn: 145542
2011-11-30 23:48:34 +00:00
Richard Smith b3041feaf7 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.

llvm-svn: 145541
2011-11-30 23:45:35 +00:00
Douglas Gregor ef42154c17 Unbreak build with GCC. Clang is too lame to diagnose this particular ill-formedness
llvm-svn: 145539
2011-11-30 23:29:56 +00:00
Douglas Gregor de3ef502a9 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).

llvm-svn: 145538
2011-11-30 23:21:26 +00:00
Argyrios Kyrtzidis b9e53ed4e2 [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'?

llvm-svn: 145536
2011-11-30 23:18:26 +00:00
Lang Hames d8bcb2b808 Test case for fix committed in r145441.
llvm-svn: 145534
2011-11-30 23:03:25 +00:00
Kostya Serebryany d47685769e make asan work at -O0, clang part. Patch by glider@google.com
llvm-svn: 145531
2011-11-30 22:20:21 +00:00
Ted Kremenek f551f326fc Per an offline conversation with John McCall, have StmtPrinter actually print out the source expression for OpaqueValueExpr.
llvm-svn: 145524
2011-11-30 22:08:08 +00:00
Ted Kremenek 7f770032c7 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.
llvm-svn: 145520
2011-11-30 21:22:09 +00:00
Matt Beaumont-Gay eb44edad6d Don't collide loop variable names (to appease GCC)
llvm-svn: 145515
2011-11-30 19:41:21 +00:00
Douglas Gregor c3312fab71 Note that we'll need to handle __include_macros specially in the module loader
llvm-svn: 145514
2011-11-30 19:39:08 +00:00
Akira Hatanaka 5e9dde3782 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.

llvm-svn: 145509
2011-11-30 19:31:38 +00:00
Benjamin Kramer 9ce686e25f Update CMake build.
llvm-svn: 145506
2011-11-30 18:56:24 +00:00
Douglas Gregor 11729f01f9 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.

llvm-svn: 145502
2011-11-30 18:12:06 +00:00
Douglas Gregor 4401fbee56 Trivial indentation fix for the code I just committed
llvm-svn: 145501
2011-11-30 18:03:26 +00:00
Douglas Gregor 41e115a81a Introduce an opt-in warning indicating when the compiler is treating
an #include/#import as a module import.

llvm-svn: 145500
2011-11-30 18:02:36 +00:00
Douglas Gregor 6902197407 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).

llvm-svn: 145497
2011-11-30 17:33:56 +00:00
Anna Zaks 92297f9dcc [analyzer] Add checker callback documentation.
llvm-svn: 145495
2011-11-30 17:12:52 +00:00
Benjamin Kramer 382eaadaa5 Use raw_ostream::indent.
llvm-svn: 145492
2011-11-30 15:07:30 +00:00
Douglas Gregor 4f3fa713bf Switch the module map printer over to
raw_ostream::write_escaped. Thanks, Benjamin!

llvm-svn: 145491
2011-11-30 15:00:49 +00:00
Douglas Gregor 36b7f115e4 Add preprocessor-only test for submodule imports
llvm-svn: 145490
2011-11-30 14:57:39 +00:00
John McCall e929082806 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.

llvm-svn: 145480
2011-11-30 04:42:31 +00:00
Douglas Gregor f7a700fd01 When writing a module file, pass the module through to the AST
writer. No functionality change.

llvm-svn: 145479
2011-11-30 04:39:39 +00:00
Douglas Gregor 1805b8a42f 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.

llvm-svn: 145478
2011-11-30 04:26:53 +00:00
Douglas Gregor 5196bc6b39 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.

llvm-svn: 145477
2011-11-30 04:03:44 +00:00
Bob Wilson 5f4e3a780f 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!

llvm-svn: 145469
2011-11-30 01:57:58 +00:00
Kostya Serebryany 7bca6c24ec when -faddress-sanitizer is present, add required flags to the linker command (linux-only)
llvm-svn: 145467
2011-11-30 01:39:16 +00:00
Douglas Gregor 71944203de 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.

llvm-svn: 145462
2011-11-30 00:36:36 +00:00
Eric Christopher 607fb70750 Make sure that forward declarations are marked as such in the debug info
for the structure type.

rdar://10499337

llvm-svn: 145461
2011-11-29 23:57:40 +00:00
Argyrios Kyrtzidis ebbb20628a [libclang] Do the ConcurrencyCheck at the beginning of clang_findReferencesInFile.
llvm-svn: 145455
2011-11-29 23:21:50 +00:00
Akira Hatanaka a21f5dab3c Change processor names. Patch by Simon Atanasyan.
llvm-svn: 145453
2011-11-29 23:09:24 +00:00
Richard Smith 507840dbff 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

llvm-svn: 145447
2011-11-29 22:48:16 +00:00
Matt Beaumont-Gay c93b489138 Suppress -Warray-bounds for classes (not just structs) where the last field is
a 1-length character array.

llvm-svn: 145445
2011-11-29 22:43:53 +00:00
Douglas Gregor 70db54f18d 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.

llvm-svn: 145444
2011-11-29 22:42:06 +00:00
Lang Hames c8c3b403c5 Test isa<FunctionDecl> to exclude objective-C methods. This ensures the following cast will never fail.
llvm-svn: 145441
2011-11-29 22:37:13 +00:00
Douglas Gregor fe96ee0307 Escape strings when printing module maps, for silly operating systems
that use \ as a separator.

llvm-svn: 145439
2011-11-29 22:27:12 +00:00
Douglas Gregor f545f67de3 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.

llvm-svn: 145436
2011-11-29 21:59:16 +00:00
Ted Kremenek cfe4ff9725 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.
llvm-svn: 145424
2011-11-29 19:39:29 +00:00
Matt Beaumont-Gay b2339826e6 Merge branch 'yo-dawg-i-herd-u-like-arrays'
llvm-svn: 145421
2011-11-29 19:27:11 +00:00
Ted Kremenek 7623347f83 Place "use @dynamic or provide a method implementation" warnings under a -W flag.
llvm-svn: 145418
2011-11-29 19:18:47 +00:00
Douglas Gregor 514b636ada 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. 

llvm-svn: 145415
2011-11-29 19:06:37 +00:00