Commit Graph

34442 Commits

Author SHA1 Message Date
Douglas Gregor
959bb06e96 Module files representing actual modules don't need to know the set of modules they import, since that information isn't actually used. Drop it from the AST file
llvm-svn: 145738
2011-12-03 01:15:29 +00:00
Douglas Gregor
0a8391362e Implement support for precompiled headers, preambles, and serialized
"main" files that import modules. When loading any of these kinds of
AST files, we make the modules that were imported visible into the
translation unit that loaded the PCH file or preamble.

llvm-svn: 145737
2011-12-03 00:59:55 +00:00
Eli Friedman
c1d85b931e Track alignment in AggValueSlot. No functional change in this patch, but I'll be introducing uses of the specified alignment soon.
llvm-svn: 145736
2011-12-03 00:54:26 +00:00
Douglas Gregor
0f2a3607e0 Keep track of all of the import declarations that are parsed or
implicitly generated in a translation unit. Modules will need this
information to identify the actual imports that occurred.

llvm-svn: 145734
2011-12-03 00:30:27 +00:00
Douglas Gregor
bcfc7d0229 When we treat an #include or #import as a module import, create an
implicit ImportDecl in the translation unit to record the presence of
the import.

llvm-svn: 145727
2011-12-02 23:42:12 +00:00
Douglas Gregor
ba34552e79 Introduce a module import declaration, so that we properly represent, e.g.,
__import_module__ std.vector;

in the AST.

llvm-svn: 145725
2011-12-02 23:23:56 +00:00
Nick Lewycky
45ccba64ab Revert r145697 and dependent patch r145702. It added a dependency from
lib/Analysis to lib/Sema which is cyclical.

llvm-svn: 145724
2011-12-02 23:21:43 +00:00
Nick Lewycky
432add5b8f Update for change to LLVM TargetMachine API in r145714.
llvm-svn: 145715
2011-12-02 22:17:00 +00:00
Douglas Gregor
282d70c410 Add missing test header
llvm-svn: 145710
2011-12-02 21:59:41 +00:00
Douglas Gregor
dac7f9a57e Only perform checking of the predefines buffer when loading a
precompiled header. Previously, we were trying to gather predefines
buffers from all kinds of AST files (which doesn't make sense) and
were performing some validation when AST files were loaded as main
files. 

With these tweaks, using PCH files that import modules no longer fails
immediately (due to mismatched predefines buffers). However, module
visibility is lost, so this feature does not yet work.

llvm-svn: 145709
2011-12-02 21:56:05 +00:00
Hans Wennborg
4d99c7a6dd Make r145697 actually work.
Use the canonical type of the typedef to compare with the underlying type.

llvm-svn: 145702
2011-12-02 20:32:01 +00:00
Douglas Gregor
2a5d14898a Make sure that name lookup in C checks whether a name is hidden.
llvm-svn: 145700
2011-12-02 20:08:44 +00:00
Hans Wennborg
70f7213d2c 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')"

llvm-svn: 145697
2011-12-02 19:22:15 +00:00
Douglas Gregor
541392832f 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.

llvm-svn: 145696
2011-12-02 19:11:09 +00:00
Douglas Gregor
24bb923aa8 Implement (de-)serialization of the set of exported modules in a
module map. 

llvm-svn: 145695
2011-12-02 18:58:38 +00:00
Douglas Gregor
e37a85af65 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.

llvm-svn: 145685
2011-12-02 17:30:13 +00:00
Douglas Gregor
7b8e4bc83f 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.

llvm-svn: 145683
2011-12-02 15:45:10 +00:00
Eli Friedman
a91d38a435 Fix bitfield handling for record layout with #pragma pack. <rdar://problem/10494810> and PR9560.
llvm-svn: 145673
2011-12-02 02:38:48 +00:00
Daniel Dunbar
a48d32bc9c 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.

llvm-svn: 145672
2011-12-02 02:31:32 +00:00
Eric Christopher
af6431077c 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

llvm-svn: 145671
2011-12-02 02:12:16 +00:00
Eric Christopher
5037249cc3 Clean up some oddly gratuitous vertical whitespace.
llvm-svn: 145670
2011-12-02 02:12:12 +00:00
Eric Christopher
86e6c07a0c Rename function.
llvm-svn: 145669
2011-12-02 02:12:09 +00:00
Douglas Gregor
2b82c2a59e 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.

llvm-svn: 145665
2011-12-02 01:47:07 +00:00
Ted Kremenek
eb0a6c0a85 Fix test regression introduced by r145656. When seeing a string literal that isn't accepted by 'asm', skip to the enclosing ')'.
llvm-svn: 145662
2011-12-02 01:30:14 +00:00
Ted Kremenek
65cdbf58a7 Diagnose use of wide string literal in 'asm' instead of crashing. Fixes <rdar://problem/10465079>.
llvm-svn: 145656
2011-12-02 00:35:46 +00:00
Richard Smith
d572f82e49 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.

llvm-svn: 145654
2011-12-02 00:30:33 +00:00
Kostya Serebryany
3aac38e90f [asan] update docs to allow, but discourage, -O0
llvm-svn: 145653
2011-12-02 00:24:42 +00:00
Eli Friedman
bfd5addf4c 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.
llvm-svn: 145652
2011-12-02 00:11:43 +00:00
Daniel Dunbar
1d6469fcb1 Driver/Darwin: Add ASAN runtime library link support.
llvm-svn: 145651
2011-12-01 23:40:18 +00:00
Douglas Gregor
cf68c58afe Implement name hiding for declarations deserialized from a non-visible
module. When that module becomes visible, so do those declarations.

llvm-svn: 145640
2011-12-01 22:20:10 +00:00
David Chisnall
6aec31a5cf Fix -forwardingTargetForSelector: (GNUstep runtime) which was broken for the
old dispatch mechanism when I introduced the new one.

llvm-svn: 145609
2011-12-01 18:40:09 +00:00
Benjamin Kramer
6bd51593ca Add support for AMD's bulldozer.
llvm-svn: 145606
2011-12-01 18:23:59 +00:00
Douglas Gregor
ff2be53f8f 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).

llvm-svn: 145586
2011-12-01 17:11:21 +00:00
Anna Zaks
719051e1c6 [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.

llvm-svn: 145584
2011-12-01 16:41:58 +00:00
Douglas Gregor
11bb308457 When typo-correction an Objective-C superclass name, don't
typo-correct to ourselves.

llvm-svn: 145583
2011-12-01 15:37:53 +00:00
Michael J. Spencer
0567b8ec58 Add Microsoft mangling of constructors and destructors. Patch by Dmitry!
llvm-svn: 145581
2011-12-01 09:55:00 +00:00
Francois Pichet
d3b986df5d Change the Microsoft __interface keyword to be an alias for struct (not class) since members are public by default.
llvm-svn: 145580
2011-12-01 08:30:47 +00:00
Ted Kremenek
dc6fb77d35 Fix typo.
llvm-svn: 145577
2011-12-01 07:39:23 +00:00
Anna Zaks
c6aa531a8f [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. 

llvm-svn: 145576
2011-12-01 05:57:37 +00:00
Ted Kremenek
24fc93a940 When analyzing a C++ method (without a specific caller), assume 'this' is non-null. Fixes <rdar://problem/10508787>.
llvm-svn: 145575
2011-12-01 05:29:42 +00:00
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
Douglas Gregor
6dc57927ea Start refactoring to use module maps when rebuilding a module
on-the-fly. No functionality change.

llvm-svn: 145414
2011-11-29 18:31:39 +00:00
Argyrios Kyrtzidis
85b4a37d59 Initialize NumWarningsInPreamble in ASTUnit's constructor, for safety.
llvm-svn: 145412
2011-11-29 18:18:33 +00:00
Douglas Gregor
d28d1b8dc0 Expose the printing of module maps as part of the ModuleMap::Module
interface. No functionality change.

llvm-svn: 145411
2011-11-29 18:17:59 +00:00
Benjamin Kramer
3df1a2dd59 The cheap version of getName() is sufficient here.
llvm-svn: 145399
2011-11-29 14:46:55 +00:00
Benjamin Kramer
7f107eeea5 Preserve constness.
llvm-svn: 145397
2011-11-29 12:31:20 +00:00
Benjamin Kramer
696894a35b Silence GCC warnings, RefCountedBase is meant to be default-initialized here.
llvm-svn: 145396
2011-11-29 11:31:35 +00:00
Richard Smith
53711607a0 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.

llvm-svn: 145395
2011-11-29 09:09:06 +00:00
Argyrios Kyrtzidis
004685bdf7 Fix leaking of LexedMethod objects created for caching objc method definitions tokens
for late parsing.

llvm-svn: 145394
2011-11-29 08:14:54 +00:00
Argyrios Kyrtzidis
6e210232ab [libclang] Fix leak in clang_indexSourceFile_Impl
llvm-svn: 145393
2011-11-29 08:14:50 +00:00
NAKAMURA Takumi
64404a3b2c [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.

llvm-svn: 145389
2011-11-29 07:47:04 +00:00
Argyrios Kyrtzidis
c36d6a1696 [libclang] Make the test portable.
llvm-svn: 145377
2011-11-29 05:48:01 +00:00
Richard Smith
675ea99a2a 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 '{'.

llvm-svn: 145372
2011-11-29 05:27:40 +00:00
Argyrios Kyrtzidis
1ddb97ec86 [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.

llvm-svn: 145369
2011-11-29 03:14:11 +00:00
Peter Collingbourne
a35dcd2310 Add Clang release notes for OpenCL C support.
llvm-svn: 145360
2011-11-29 02:03:07 +00:00
Peter Collingbourne
33d838c499 Fix URL typo.
llvm-svn: 145359
2011-11-29 02:03:03 +00:00
Fariborz Jahanian
a45495a9f2 objc: warn if NSObject attribute appears other than in a typedef.
// rdar://10453342

llvm-svn: 145358
2011-11-29 01:48:40 +00:00
Ted Kremenek
6cdff0a82b Fix serialized diagnostics to handle FixIts that only remove text. Fixes <rdar://problem/10473903>.
llvm-svn: 145339
2011-11-29 00:30:52 +00:00
Chandler Carruth
d196a1e637 Fix a spelling error pointed out by Sebastien, and tidy up the
formatting here a bit... mostly to my preferred bikeshed-blue.

llvm-svn: 145337
2011-11-29 00:24:20 +00:00
Chandler Carruth
9a39b455aa 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. =]

llvm-svn: 145336
2011-11-29 00:24:18 +00:00
Chandler Carruth
cb9f4c7fde 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.

llvm-svn: 145335
2011-11-29 00:15:26 +00:00
Chandler Carruth
30befa0f7a And sink the GNU runtime bit into this section as a stub.
llvm-svn: 145334
2011-11-29 00:15:25 +00:00
Chandler Carruth
1ef751f4a5 Flesh out the Objective-C section a bit. This may well need some love
from the Objective-C experts, but the basic stuff is there now.

llvm-svn: 145333
2011-11-29 00:15:23 +00:00
Bill Wendling
bcefeae5c1 The _setjmp builtin library function should have the "returns twice"
attribute. This prevents the stack slot allocator from coming along and using a
stack which it thinks is available but isn't.
<rdar://problem/10492556>

llvm-svn: 145332
2011-11-29 00:10:10 +00:00
Eli Friedman
b0692cb858 Add a couple more GCC versions to C++ search paths for MinGW. Patch by Ruben Van Boxem.
(We should probably start doing some sort of autodetection like we do on Linux at some point.)

llvm-svn: 145326
2011-11-28 23:58:55 +00:00
Rafael Espindola
e11c5f2d63 CFI is mentioned on the LLVM releases as the clang bits are relatively small.
llvm-svn: 145325
2011-11-28 23:58:04 +00:00
Eli Friedman
4a4932c29b A couple driver fixes for PPC Linux. Patches by Michael Kostylev. PR11444/PR11445.
llvm-svn: 145321
2011-11-28 23:46:52 +00:00
Francois Pichet
2a69e24291 Update release notes with 2 features now supported in -fms-extensions mode.
I think that's enough for my release notes.

llvm-svn: 145320
2011-11-28 23:46:15 +00:00
Richard Smith
0e8f5c7e9b Release notes: add link to ISO C++ 2011 standard from the C++11 section.
llvm-svn: 145317
2011-11-28 23:35:03 +00:00
Francois Pichet
44cb7b6354 Update release notes with information on MSVC mode.
llvm-svn: 145315
2011-11-28 23:30:46 +00:00
Tanya Lattner
71f1b2dcd4 Correct the code generation for function arguments of vec3 types on x86_64 when they are greater than 128 bits. This was incorrectly coercing things like long3 into a double2.
Add test case.

llvm-svn: 145312
2011-11-28 23:18:11 +00:00
Richard Smith
a7c7e2bb84 Release notes: fix up formatting of diagnostic example.
llvm-svn: 145311
2011-11-28 23:16:15 +00:00
Douglas Gregor
ca295457e5 When attempting to load a module that is not in the module cache,
return the module itself (in the module map) rather than returning the
umbrella header used to build the module. While doing this, make sure
that we're inferring modules for frameworks to build that module.

llvm-svn: 145310
2011-11-28 23:16:06 +00:00
Chandler Carruth
67f5d88869 Extract a Windows section in the release notes. Hopefully this is more
accurate than my original notes were based on IRC conversations. Windows
folks, please edit as needed to make this closer to the truth if I've
still got it wrong.

llvm-svn: 145309
2011-11-28 23:11:27 +00:00
Chandler Carruth
2d4fc0c329 Create a stub for Nick to hack on, nuking another of my rough notes.
llvm-svn: 145308
2011-11-28 23:02:13 +00:00
Chandler Carruth
17ca53c12c Pull the uninitialized values rewrite into the diagnostics section, and
add a bit to that section about the many bug-finding warnings that Clang
has grown since 2.9 as this is one of the more visible new additions.

llvm-svn: 145307
2011-11-28 22:54:33 +00:00
Chandler Carruth
6111e359e0 Remove some features that don't really seem major enough or widely used
enough to merit space in the release notes.

llvm-svn: 145306
2011-11-28 22:54:31 +00:00
Richard Smith
66fced550e Add a release notes section for C1X language features supported by clang 3.0.
llvm-svn: 145305
2011-11-28 22:48:25 +00:00
Chandler Carruth
2679f3cb12 Pull out the libclang section and try to clean it up some. This one
feels a bit spartan currently.

llvm-svn: 145302
2011-11-28 22:43:32 +00:00
Argyrios Kyrtzidis
a3ec8e82c8 [libclang] Protect against the declaration's SourceRange being invalid
before passing to RangeCompare.

Though no idea how this can occur with the decls returned from
findFileRegionDecls().

llvm-svn: 145301
2011-11-28 22:38:07 +00:00
Chandler Carruth
124d8ff0da We now have text (or comment stubs for others) for these...
llvm-svn: 145299
2011-11-28 22:36:40 +00:00
Chandler Carruth
7252e7a949 Expand and clean up the diagnostics section.
llvm-svn: 145298
2011-11-28 22:34:59 +00:00
Kostya Serebryany
1283ccf273 fix html markup
llvm-svn: 145297
2011-11-28 22:34:10 +00:00
Daniel Dunbar
787032b88e Fix some possible gcc-4.2 may be used uninitialized warnings.
llvm-svn: 145293
2011-11-28 22:19:36 +00:00
Chandler Carruth
270e4511a7 Create a more organized (but still commented out as not very useful)
stub for OpenCL work. I can't really dig enough out of the commit log
messages other than to tell that a lot of work went into this in the 2.9
-> 3.0 timeframe. I'll let the folks touching it decide if it merits
a spot in the release notes and provide the appropriate details if so.

llvm-svn: 145291
2011-11-28 22:17:58 +00:00
Benjamin Kramer
c7ccd616b1 Add missing equals.
llvm-svn: 145290
2011-11-28 22:17:09 +00:00
Chandler Carruth
b843b0be6b Create a 3.1 notes section in a comment so that the next batch are a bit
easier. Move the CUDA bits and the C1X/C++11 atomics stuff there. We
haven't exposed a __has_feature for the atomic builtins, so none of this
is available yet...

llvm-svn: 145288
2011-11-28 22:12:44 +00:00
Chandler Carruth
c869fb3be9 Peter says this shouldn't make it to the relnotes, it's too immature at
this stage.

llvm-svn: 145286
2011-11-28 22:06:59 +00:00
Chandler Carruth
c8b093de54 Flesh out and pretty-up the driver section. This could probably use some
more love w.r.t. platforms other than Linux?

llvm-svn: 145285
2011-11-28 21:56:30 +00:00
Chandler Carruth
8ecf3c970b Add a brief mention of the warning flag name updates associated with the
C++11 standard.

llvm-svn: 145284
2011-11-28 21:55:34 +00:00
Chandler Carruth
f99d03b489 Tidy up, wrap lines, and use <code> tags more consistently.
llvm-svn: 145283
2011-11-28 21:47:51 +00:00
Anna Zaks
c086f0f91b Cleanup the Release Notes for the static analyzer:
The performance improvement was committed after the 3.0 branch.
Constructors/destructors are handled by the CFG, but we do not do anything
special for them in the analyzer yet.

Since we do not have an open source release qualification for the analyzer,
we are not investing into creating the proper release notes for it.

llvm-svn: 145281
2011-11-28 21:31:55 +00:00
Kostya Serebryany
9751d340db First version of AddressSanitizer docs; documentation for __has_feature(address_sanitizer)
llvm-svn: 145276
2011-11-28 20:51:02 +00:00
Anna Zaks
ff029b6953 [analyzer] Add more simple taint tests.
llvm-svn: 145275
2011-11-28 20:43:40 +00:00
Anna Zaks
951d205aec [analyzer] Minor cleanup of SValBuilder: Comments + code reuse.
llvm-svn: 145274
2011-11-28 20:43:37 +00:00
Rafael Espindola
49118520de Fix comment.
llvm-svn: 145271
2011-11-28 20:05:27 +00:00
Douglas Gregor
7db3e95b0d When synthesizing an implicitly-defined copy or move constructor, or
when computing the exception specification of a copy or move constructor,
ignore non-static data member initializers. Fixes PR11418 /
<rdar://problem/10478642>.

llvm-svn: 145269
2011-11-28 20:03:15 +00:00
Richard Smith
7a5898c3fe Add a release notes section on new C++11 language features, and flesh it out.
llvm-svn: 145268
2011-11-28 20:02:05 +00:00
Fariborz Jahanian
80b831c1a9 Remove code made redundant by my previous patch.
llvm-svn: 145266
2011-11-28 19:56:36 +00:00
Fariborz Jahanian
25d09c2209 pinpoint name/location of deprecated/unavailable enumerator
whose enum has been made deprecated/unavailable in the warning.
// rdar://10201690

llvm-svn: 145264
2011-11-28 19:45:58 +00:00
Chandler Carruth
48f8f9fdb1 Add a proper blurb for the PPCallbacks features.
llvm-svn: 145261
2011-11-28 19:17:25 +00:00
Chandler Carruth
9252724a04 This doesn't really seem worthy of a relnote... Shout if you disagree!
llvm-svn: 145259
2011-11-28 19:11:25 +00:00
Chandler Carruth
61a0421cf4 Fill in a section for the instantiation -> expansion rename. Not great,
but better.

llvm-svn: 145258
2011-11-28 19:06:34 +00:00
Chandler Carruth
34dfcc5570 Add proper text for the Diagnostic API changes.
llvm-svn: 145257
2011-11-28 18:55:47 +00:00
Fariborz Jahanian
22b405c7aa objc: turn warning for property type mismatch in
primary and its continuation class into error.
// rdar://10142679

llvm-svn: 145255
2011-11-28 18:38:27 +00:00
Douglas Gregor
08dbbbb338 Add a release note for Objective-C related result types
llvm-svn: 145252
2011-11-28 17:51:39 +00:00
Douglas Gregor
6cfe81e603 Note that code completion now works better for in-class member functions
llvm-svn: 145251
2011-11-28 17:50:36 +00:00
Douglas Gregor
7372248a98 When checking a call to a builtin atomic operation, be sure to
consider the _<width> variants as well, which we'll see if we're
performing the type checking in a template instantiation where the
call expression itself was originally not type-dependent. Fixes
PR11411.

llvm-svn: 145248
2011-11-28 16:30:08 +00:00
Chandler Carruth
e2031bbcb8 And that completes my sweep through commits for things that might be
worth noting in the release notes. These remain raw notes. I'll be
re-writing them into nice prose first thing tomorrow, with help from
others. A couple of notes for any reading the commits:

If you don't see something that should be mentioned, feel free to add
a note (or even a nicely written section) about it! I haven't really
done the static analyzer justice here as I don't really know what the
significant changes are other than mile-high stuff like watching it grow
C++ support and a more robust CFG. I also worry I've missed important
stuff in the Objective-C world.

If you see something that isn't worth mentioning, just delete it. I know
there are several things like this. I plan to prune the list down as
I flesh things out.

If you're name or email is on a bullet, I'll likely be sending you an
email asking for any input on that subject. For many of these I can fill
in something generic, and I'll just want you to give it a once-over.
However, if you have time, feel free to just write the blurb yourself
and drop it in, or drop it in an email to me.

Finally, *WOW* has a lot happened in Clang... I shouldn't have dreaded
(and put off) this so much, it was kind of awesome to go back and watch
the evolution. Anyways, these should be in a reasonable draft state
early tomorrow.

llvm-svn: 145247
2011-11-28 13:02:29 +00:00
Chandler Carruth
3fc02a2fd9 Finished with August's commits, and actually added a clearly missing
section on libclang.

llvm-svn: 145246
2011-11-28 12:24:23 +00:00
Chandler Carruth
2191916305 July's notes..
llvm-svn: 145245
2011-11-28 12:24:21 +00:00
Nicola Gigante
13b6a2ae04 Removed useless ImplicitCast nodes in explicit cstyle and static casts
llvm-svn: 145244
2011-11-28 12:21:57 +00:00
Chandler Carruth
e70b005a6d July was a bit quiet to... except for ARC. ;]
llvm-svn: 145242
2011-11-28 11:27:33 +00:00
Chandler Carruth
955ba6c076 June was a quiet month... I can't imagine why... ;]
llvm-svn: 145241
2011-11-28 10:57:14 +00:00
Chandler Carruth
a393202377 Notes through another month... a *really* busy month, but mostly bug
fixing.

llvm-svn: 145237
2011-11-28 09:43:30 +00:00
Chandler Carruth
7c8e5ff578 Add the first month's commit notes.
llvm-svn: 145236
2011-11-28 08:41:06 +00:00
Bob Wilson
bd0fbe86c5 Install c-index-test and clang-c/Index.h as internal files. rdar://10217046
Specify that these files should be installed to the optional internal
install location as specified by configure's --with-internal-prefix.
If that option is not used, they'll be installed to the default prefix
as before.

llvm-svn: 145235
2011-11-28 08:03:54 +00:00
Chandler Carruth
629c3552bb Begin sketching out the Clang release notes. The plan is to link to
these more detailed notes from the primary LLVM release notes for Clang.
This gives us a nice place to flesh out in plenty of detail the major
changes that have happened in Clang land since 2.9.

I've outlined a very rough structure based on the LLVM release notes
structure and what seems like useful divisions in the Clang landscape
(e.g., language-specific stuff is relevant to a narrower audience).

I'll be first converting my brain-dump-ish notes from the commit logs,
and then cleaning here. Suggestions on structure welcome. Typo
corrections, spelling fixes (oh how I'll need them), all welcome; just
commit away.

llvm-svn: 145233
2011-11-28 07:16:19 +00:00
NAKAMURA Takumi
cd9c3d6647 test/lit.cfg: Enhance getRegisteredTargets() to retrieve +Asserts.
- s/getRegisteredTargets/get_llc_props/g
  - get_llc_props() returns dict {"set_of_targets", "enable_assertions"}
  - Enable the feature "asserts".
    test/Driver/darwin-verify-debug.c had expected it.

llvm-svn: 145231
2011-11-28 05:09:42 +00:00
Argyrios Kyrtzidis
b11f5a4cbb [libclang] Indexing API: If the client requested to get a CXTranslationUnit after
indexing, honor all the TU options.

llvm-svn: 145229
2011-11-28 04:56:00 +00:00
Argyrios Kyrtzidis
67aa7db0a4 [libclang] Indexing API: Capture diagnostics during indexing.
llvm-svn: 145228
2011-11-28 04:55:55 +00:00
Peter Collingbourne
eec0a2aa87 Another silly workaround for MSVC.
llvm-svn: 145227
2011-11-28 04:29:10 +00:00
Argyrios Kyrtzidis
eca1f36a54 [arcmt] Integrate GC __weak into property attributes even when we don't have
the implementation.

llvm-svn: 145224
2011-11-28 02:04:36 +00:00
Peter Collingbourne
fc38dfe499 Sigh, another workaround for MSVC.
llvm-svn: 145211
2011-11-28 00:41:08 +00:00
Argyrios Kyrtzidis
3fc3dcd80f [arcmt] Don't add __weak if there is already a GC __weak and make sure to clear
__weak from a readonly property.

llvm-svn: 145210
2011-11-28 00:23:12 +00:00
Peter Collingbourne
1424b308c3 Work around a gcc4.2 bug.
llvm-svn: 145209
2011-11-28 00:18:21 +00:00
Peter Collingbourne
fbef4c8657 In Sema::MaybeBindToTemporary, create a CXXBindTemporaryExpr for an
array of objects with non-trivial destructors.  PR11365.

llvm-svn: 145203
2011-11-27 22:09:28 +00:00
Peter Collingbourne
702b2841a4 When destroying temporaries, instead of a custom cleanup use the
generic pushDestroy function.

This would reduce the number of useful declarations in
CGTemporaries.cpp to one.  Since CodeGenFunction::EmitCXXTemporary
does not deserve its own file, move it to CGCleanup.cpp and delete
CGTemporaries.cpp.

llvm-svn: 145202
2011-11-27 22:09:22 +00:00
Rafael Espindola
a6416a7c73 Make our handling of MMX x SSE closer to what gcc does:
* Enabling sse enables mmx.
* Disabling (-mno-mmx) mmx, doesn't disable sse (we got this right already).
* The order in not important. -msse -mno-mmx is the same as -mno-mmx -msse.

llvm-svn: 145194
2011-11-27 20:00:43 +00:00
Rafael Espindola
32d8a275b9 Add inreg attributes to reference arguments.
llvm-svn: 145189
2011-11-27 18:35:39 +00:00
Sebastian Redl
29526f09ce Reference initialization with initializer lists.
This supports single-element initializer lists for references according to DR1288, as well as creating temporaries and binding to them for other initializer lists.

llvm-svn: 145186
2011-11-27 16:50:07 +00:00
Rafael Espindola
0618d14edf Error on non x86 architectures.
llvm-svn: 145185
2011-11-27 15:21:33 +00:00
Rafael Espindola
fd03d0b733 Fix file name in comments.
llvm-svn: 145184
2011-11-27 15:13:54 +00:00
Bob Wilson
800b2b42ed Use libcxx makefile's do-installhdrs target. <rdar://problem/10397739>
llvm-svn: 145168
2011-11-27 06:13:25 +00:00
Rafael Espindola
d086573a4d Add the minimum implementation of cpuid.h. This works on "modern" intel cpus
and on clang, which seams to handled "=b" correctly even when ebx is the
PIC register.

llvm-svn: 145149
2011-11-26 20:53:19 +00:00
Nicola Gigante
c8edb0f657 Test commit
llvm-svn: 145147
2011-11-26 16:20:01 +00:00
Abramo Bagnara
edf99fff49 Fixed lexical declaration context when instantiating a friend / out-of-line class template member.
llvm-svn: 145146
2011-11-26 13:33:46 +00:00
Rafael Espindola
04268df8ed Set __OPTIMIZE_SIZE__ on -Os and -Oz. This matches gcc's behaviour on both OS X
and linux.

llvm-svn: 145142
2011-11-26 06:21:20 +00:00
Francois Pichet
de232cb166 In Microsoft mode, make "Unqualified lookup into dependent bases of class templates" works inside a friend function definition at class scope.
Basically we have to look into the parent *lexical* DeclContext for friend functions at class scope. That's because calling GetParent() return the namespace or file DeclContext.

This fixes all remaining cases of "Unqualified lookup into dependent bases of class templates" when parsing MFC code with clang.

llvm-svn: 145127
2011-11-25 01:10:54 +00:00
David Blaikie
4f1f9e6b2e Fix typo (becuase->because), PR11427
llvm-svn: 145117
2011-11-24 00:37:54 +00:00
Matt Beaumont-Gay
63be19122e Wordsmith the -Warray-bounds diagnostic text a bit
llvm-svn: 145116
2011-11-24 00:27:38 +00:00
Richard Trieu
caff247882 Add feature to diagnostics that will provide more information on function
pointer mismatch.  Cases covered are: initialization, assignment, and function
arguments.  Additional text will give the extra information about the nature
of the mismatch: different classes for member functions, wrong number of
parameters, different parameter type, different return type, and function
qualifier mismatch.

llvm-svn: 145114
2011-11-23 22:32:32 +00:00
Argyrios Kyrtzidis
a72450057b [PCH] Check for isTopLevelDeclInObjCContainer when picking abbreviations.
llvm-svn: 145110
2011-11-23 21:11:23 +00:00
Argyrios Kyrtzidis
8ad3bab505 [libclang] Fix operations (token annotation, getting cursor, etc.) with a file region
inside an objc container that "contains" other file-level declarations.

When getting the array of file-level declarations that overlap with a file region,
we failed to report that the region overlaps with an objc container, if
the container had other file-level declarations declared lexically inside it.

Fix this by marking such declarations as "isTopLevelDeclInObjCContainer" in the AST
and handling them appropriately.

llvm-svn: 145109
2011-11-23 20:27:36 +00:00
Argyrios Kyrtzidis
e4d082827d Remove an assertion that is not valid if we cancel parsing.
llvm-svn: 145108
2011-11-23 20:27:29 +00:00
Argyrios Kyrtzidis
41fc05cad8 [libclang] Indexing API: Fix issues, mostly C++ related.
llvm-svn: 145107
2011-11-23 20:27:26 +00:00
James Molloy
c445be4b4b AAPCS compliance - 32-bit wchar_t should be unsigned for both aapcs and aapcs-linux.
Original behaviour of defining wchar_t as signed int has been kept for apcs-gnu as I don't have any spec for this to validate against.

llvm-svn: 145102
2011-11-23 13:35:08 +00:00
Richard Smith
514f7e9cb9 Don't check alignment, it's irrelevant to this test.
llvm-svn: 145093
2011-11-23 02:12:00 +00:00
Richard Smith
2d988f0f05 Use static storage duration for file-scope compound literals, even when they
appear in non-constant initializers in C++.

llvm-svn: 145087
2011-11-22 22:48:32 +00:00
Benjamin Kramer
900f1defdd Remove assert from hot code path and add a clarifying comment.
The assert wasn't adding much value but slowed down Release+Asserts builds.

llvm-svn: 145082
2011-11-22 20:39:31 +00:00
Matt Beaumont-Gay
31fcb9f291 Provide better source info for template specializations with non-type arguments.
This fixes a crasher in tools like Include-What-You-Use which examine such
arguments. Patch from Dean Sturtevant at Google!

llvm-svn: 145077
2011-11-22 20:00:10 +00:00