NAKAMURA Takumi
770142e49f
include/clang*/Makefile: Tweak installation to work with CLANG_SRCDIR.
...
llvm-svn: 145800
2011-12-05 06:13:20 +00:00
David Blaikie
15a430a368
Support decltype in nested-name-specifiers.
...
llvm-svn: 145785
2011-12-04 05:04:18 +00:00
Fariborz Jahanian
5c12ca8a25
Move block return type inference diagnostic to a common place where
...
Function or array lvalue conversions happens.
llvm-svn: 145782
2011-12-03 23:53:56 +00:00
Douglas Gregor
fb9968d6f1
Fix mangling substitutions for address-space-qualified class
...
types. Patch from Dmitri Rubinstein!
llvm-svn: 145776
2011-12-03 18:24:43 +00:00
Douglas Gregor
dca70af22f
Implement support for the __is_final type trait, to determine whether
...
a class is marked 'final', from Alberto Ganesh Barbati! Fixes
PR11462.
llvm-svn: 145775
2011-12-03 18:14:24 +00:00
Fariborz Jahanian
dd5eb9df0c
If block literal return type is not specified, return type of the block is
...
inferred from return types. All the return statements have to agree about the type.
// rdar://10466373
llvm-svn: 145774
2011-12-03 17:47:53 +00:00
Francois Pichet
9c39113fdb
In Microsoft mode, don't perform typo correction in a template member function dependent context because it interferes with the "lookup into dependent bases of class templates" feature.
...
Basically typo correction will try to offer a correction instead of looking into type dependent base classes.
I found this problem while parsing Microsoft ATL code with clang.
llvm-svn: 145772
2011-12-03 15:55:29 +00:00
Sebastian Redl
df88864273
Implement overload resolution for reference-typed parameters supplied with initializer lists.
...
llvm-svn: 145769
2011-12-03 14:54:30 +00:00
Eli Friedman
a0544d6fdf
Switch LValue so that it exposes alignment in CharUnits. (No functional change.)
...
llvm-svn: 145753
2011-12-03 04:14:32 +00:00
Argyrios Kyrtzidis
b2b0795c9f
[PCH] Make sure that the SourceExpr of a OpaqueValueExpr is always initialized
...
when deserialized, fixing random crashes in libclang.
Also simplifies how OpaqueValueExprs are [de]serialized.
The reader/writer automatically retains pointer equality of sub-statements (when a
statement node is referenced in multiple nodes), so no need to manually handle it.
llvm-svn: 145752
2011-12-03 03:49:52 +00:00
Argyrios Kyrtzidis
0042b6f925
[libclang] Fix infinite loop when doing visitation of an OpaqueValueExpr.
...
llvm-svn: 145751
2011-12-03 03:49:47 +00:00
Argyrios Kyrtzidis
0fd8fae0a6
[libclang] Allow indexing/get-cursor/etc. for the exception variable in a C++ catch.
...
llvm-svn: 145750
2011-12-03 03:49:44 +00:00
Eli Friedman
2869b5afe3
Add a utility to get a RValue for a given LValue for an aggregate; switch a few places over to it.
...
llvm-svn: 145747
2011-12-03 03:08:40 +00:00
Eli Friedman
38cd36dbdb
Switch the Alignment argument on AggValueSlot over to CharUnits, per John's review comment.
...
llvm-svn: 145741
2011-12-03 02:13:40 +00:00
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