Commit Graph

30046 Commits

Author SHA1 Message Date
Devang Patel 04ab75c9ab Function with internal linkage name do not have mangled name.
llvm-svn: 130736
2011-05-02 22:49:30 +00:00
Devang Patel b7ff0da623 Do not try to get mangled name of block helpers. Apply a stopgap measure to fix SingleSource/UnitTests/block-copied-in-cxxobj compile time crash.
llvm-svn: 130734
2011-05-02 22:37:48 +00:00
Ted Kremenek e9f364f658 Tweak the retain/release checker to not stop tracking retained objects when calling C++ methods. This is a temporary solution to prune false positives until we have a general story using annotations.
llvm-svn: 130726
2011-05-02 21:21:42 +00:00
Eric Christopher d5c45f6738 Add the -mstackrealign option which just communicates the need to
force align the stack to the backend.

Fixes rdar://9289631

llvm-svn: 130725
2011-05-02 21:18:22 +00:00
Daniel Dunbar 8438464b41 Driver/Darwin: Honor --sysroot= when invoking the linker, on Darwin.
llvm-svn: 130723
2011-05-02 21:03:47 +00:00
Chad Rosier f897d3b88b Fixed test case asserts due to checkin of r130710.
llvm-svn: 130720
2011-05-02 20:39:21 +00:00
Devang Patel 2a7c219466 Emit debug info for __destroy_helper_block_ and __copy_helper_block.
llvm-svn: 130719
2011-05-02 20:37:08 +00:00
Eli Friedman 30458b51e3 Skip extra copy from aggregate where it isn't necessary; rdar://problem/8139919 . This shouldn't make much of a difference at -O3, but should substantially reduce the number of generated memcpy's at -O0.
llvm-svn: 130717
2011-05-02 20:24:29 +00:00
Ted Kremenek aa181174e7 Augment retain/release checker to not warn about tracked objects passed as arguments to C++ constructors. This is a stop-gap measure for Objective-C++ code that uses smart pointers to manage reference counts.
llvm-svn: 130711
2011-05-02 19:42:42 +00:00
Chad Rosier 24874a449c When using -std= flag added check to make sure language and standard are compatable
llvm-svn: 130710
2011-05-02 19:24:53 +00:00
Lenny Maiorani 0b510279c6 Implements strncasecmp() checker and simplifies some of the logic around creating substrings if necessary and calling the appropriate StringRef::compare/compare_lower().
llvm-svn: 130708
2011-05-02 19:05:49 +00:00
Chandler Carruth 38a328276c Don't abuse reinterpret cast to do something the API of PointerUnion
provides proper support for. This was caught by
-Wundefined-reinterpret-cast, and I think a reasonable case for it to
warn on.

Also use is<...> instead of dyn_cast<...> when the result isn't needed.

This whole thing should probably switch to using UsuallyTinyPtrVector.

llvm-svn: 130707
2011-05-02 18:54:36 +00:00
Manuel Klimek c638cd21fb Adds a test for the command line parser when a quoted string is not closed by a quote.
llvm-svn: 130704
2011-05-02 18:27:26 +00:00
Argyrios Kyrtzidis 69a2c924b9 Add a warning for when reinterpret_cast leads to undefined behavior, patch by Richard Trieu!
llvm-svn: 130703
2011-05-02 18:21:19 +00:00
Eli Friedman f4258eb484 Switch CallArgList from an std::pair to a new CallArg struct (which will eventually gain more members). Working towards modifying call emission to avoid unnecessary copies.
llvm-svn: 130700
2011-05-02 18:05:27 +00:00
Eli Friedman 43dca6a8d2 Simplify code a bit by using CallArgList::add. No intended functionality change.
llvm-svn: 130699
2011-05-02 17:57:46 +00:00
Rafael Espindola 4cfa7971e9 Disable CFI if not using the integrated assembler. We should probably do this only for
OS X, but it is probably not all that important.

llvm-svn: 130697
2011-05-02 17:43:32 +00:00
Fariborz Jahanian eb39741c0b More rule enforcement of zero bitfields for ms_struct.
llvm-svn: 130696
2011-05-02 17:20:56 +00:00
NAKAMURA Takumi c3a8529269 lib/Frontend/InitHeaderSearch.cpp: Tweak AddPath() to accept "/foo/bar" (not "X:\foo\bar") with -isysroot. test/PCH/reloc.c can pass.
FIXME: We should consider better isysroot scheme on Win32 hosts.
llvm-svn: 130683
2011-05-02 04:50:10 +00:00
NAKAMURA Takumi bb9ffbdc89 test/CodeGenCXX/vtable-debug-info.cpp: It does not crash on mingw.
FIXME: It would crash with -integrated-as. Implement -g on MCCOFF.
llvm-svn: 130682
2011-05-02 04:50:00 +00:00
NAKAMURA Takumi 0760218bca test/CodeGenCXX/debug-info-namespace.cpp: Add explicit -fverbose-asm to cc1 to let cygming pass.
This test seeks a verbose comment in output. By default, "-integrated-as" sets verbose-asm. Cygming is not ready for -integrated-as yet.

llvm-svn: 130681
2011-05-02 04:49:53 +00:00
Nick Lewycky d3c2df8d2b Remove redeclaration of Invalid. The code that set this to true was updating an
Invalid that was never read from again, causing non-type-template-parms to be
marked valid when in fact they weren't.

This was caught by GCC 4.6's -Wunused-but-set-variable warning.

llvm-svn: 130680
2011-05-02 01:48:46 +00:00
Nick Lewycky fc49f72b58 Remove unused variable spotted by GCC.
Devang, can we remove this call entirely? If I try that, "make check" passes
but the call has a side-effect of ensuring that the block's context exists in
the debug info. getContextDescriptor() is used in a void context for that side-
effect elsewhere in this file. Please take a look!

llvm-svn: 130679
2011-05-02 01:41:48 +00:00
Nick Lewycky 82e478009f Remove unused variable, but keep function call with side-effect.
llvm-svn: 130678
2011-05-02 01:07:19 +00:00
Chandler Carruth 61a8dacd00 I updated this constructor's interface, and didn't have to fix any
callers. Shockingly enough, *there are none*!

llvm-svn: 130677
2011-05-02 01:06:57 +00:00
Nick Lewycky cf8714ee7b Remove dead variable caught by GCC.
llvm-svn: 130676
2011-05-02 01:06:15 +00:00
Chandler Carruth 1d352ec6d9 Nuke stale code for separately importing the qualifer -- it's just part
of the QualifierLoc, and that's all we need to import now.

llvm-svn: 130675
2011-05-02 01:01:54 +00:00
Nick Lewycky 1c60a0bc98 Remove dead variable, flagged by gcc's -Wunused-but-set-variable.
llvm-svn: 130674
2011-05-02 00:46:56 +00:00
Nick Lewycky b4175cad29 Remove dead variable flagged by gcc's -Wunused-but-set-variable. No
functionality change.

llvm-svn: 130673
2011-05-02 00:41:17 +00:00
Nick Lewycky 18a1ee7f51 Remove a dead variable flagged by gcc's -Wunused-but-set-variable. No
functionality change.

llvm-svn: 130672
2011-05-02 00:40:24 +00:00
John McCall 824908373e Revise the representation of parameter scope data so that the
scope depth overlaps with the ObjCDeclQualifier, dropping
memory usage back to previous levels.

llvm-svn: 130671
2011-05-02 00:30:12 +00:00
Chandler Carruth 8d26bb0899 Add an optional field attached to a DeclRefExpr which points back to the
Decl actually found via name lookup & overload resolution when that Decl
is different from the ValueDecl which is actually referenced by the
expression.

This can be used by AST consumers to correctly attribute references to
the spelling location of a using declaration, and otherwise gain insight
into the name resolution performed by Clang.

The public interface to DRE is kept as narrow as possible: we provide
a getFoundDecl() which always returns a NamedDecl, either the ValueDecl
referenced or the new, more precise NamedDecl if present. This way AST
clients can code against getFoundDecl without know when exactly the AST
has a split representation.

For an example of the data this provides consider:
% cat x.cc
namespace N1 {
  struct S {};
  void f(const S&);
}
void test(N1::S s) {
  f(s);
  using N1::f;
  f(s);
}

% ./bin/clang -fsyntax-only -Xclang -ast-dump x.cc
[...]
void test(N1::S s) (CompoundStmt 0x5b02010 <x.cc:5:20, line:9:1>
  (CallExpr 0x5b01df0 <line:6:3, col:6> 'void'
    (ImplicitCastExpr 0x5b01dd8 <col:3> 'void (*)(const struct N1::S &)' <FunctionToPointerDecay>
      (DeclRefExpr 0x5b01d80 <col:3> 'void (const struct N1::S &)' lvalue Function 0x5b01a20 'f' 'void (const struct N1::S &)'))
    (ImplicitCastExpr 0x5b01e20 <col:5> 'const struct N1::S' lvalue <NoOp>
      (DeclRefExpr 0x5b01d58 <col:5> 'N1::S':'struct N1::S' lvalue ParmVar 0x5b01b60 's' 'N1::S':'struct N1::S')))
  (DeclStmt 0x5b01ee0 <line:7:3, col:14>
    0x5b01e40 "UsingN1::;")
  (CallExpr 0x5b01fc8 <line:8:3, col:6> 'void'
    (ImplicitCastExpr 0x5b01fb0 <col:3> 'void (*)(const struct N1::S &)' <FunctionToPointerDecay>
      (DeclRefExpr 0x5b01f80 <col:3> 'void (const struct N1::S &)' lvalue Function 0x5b01a20 'f' 'void (const struct N1::S &)' (UsingShadow 0x5b01ea0 'f')))
    (ImplicitCastExpr 0x5b01ff8 <col:5> 'const struct N1::S' lvalue <NoOp>
      (DeclRefExpr 0x5b01f58 <col:5> 'N1::S':'struct N1::S' lvalue ParmVar 0x5b01b60 's' 'N1::S':'struct N1::S'))))

Now we can tell that the second call is 'using' (no pun intended) the using
declaration, and *which* using declaration it sees. Without this, we can
mistake calls that go through using declarations for ADL calls, and have no way
to attribute names looked up with using declarations to the appropriate
UsingDecl.

llvm-svn: 130670
2011-05-01 23:48:14 +00:00
John McCall 8fb0d9d24a Store a parameter index and function prototype depth in every
parameter node and use this to correctly mangle parameter
references in function template signatures.

A follow-up patch will improve the storage usage of these
fields;  here I've just done the lazy thing.

llvm-svn: 130669
2011-05-01 22:35:37 +00:00
Chandler Carruth bbf65b0501 Remove the NameQualifier struct, which was just a wrapper around
NestedNameSpecifierLoc. It predates when we had such an object.

Reference the NNSLoc directly in DREs, and embed it directly into the
MemberNameQualifier struct.

llvm-svn: 130668
2011-05-01 22:14:37 +00:00
Chandler Carruth e68f261dea Several cosmetic changes, no functionality changed.
Mostly trailing whitespace so that me editor nuking it doesn't muddy the
waters of subsequent commits that do change functionality.

Also nukes a stray statement that was harmless but redundant that
I introduced in r130666.

llvm-svn: 130667
2011-05-01 21:55:21 +00:00
Chandler Carruth 0e439960b8 Move the state bits in DeclRefExpr out of the pointer union and into
a bitfield in the base class. DREs weren't using any bits here past the
normal Expr bits, so we have plenty of room. This makes the common case
of getting a Decl out of a DRE no longer need to do any masking etc.

Also, while here, clean up code to use the accessor methods rather than
directly poking these bits, and provide a nice comment for DREs that
includes the information previously attached to the bits going into the
pointer union.

No functionality changed here, but DREs should be a tad faster now.

llvm-svn: 130666
2011-05-01 21:29:53 +00:00
Chandler Carruth 56b579a373 Switch getAs to castAs (didn't know about this before!) and simplify
some code.

llvm-svn: 130665
2011-05-01 21:29:41 +00:00
Chandler Carruth a62d8a50e2 Remove a stale comment, it no longer applied after my cleanups.
Also fix several misspellings in my comments. I cannot spell, and cannot
even be trusted to ask my editor how to spell apparently.

llvm-svn: 130662
2011-05-01 19:18:02 +00:00
Abramo Bagnara 4d42399d46 Fixed source range for extern linkage specification without braces.
llvm-svn: 130660
2011-05-01 16:25:54 +00:00
Rafael Espindola 9af3d4b193 Add r130624 back now that ELF has been fixed to work with -fno-dwarf2-cfi-asm.
llvm-svn: 130659
2011-05-01 15:45:27 +00:00
Chandler Carruth 73aa8f7027 Based on the new information in the AST provided by r130628, write
3 lines of code and improve a bunch of information in the libclang view
of the code.

Updates the two tests that exercise this with the new data, checking
that each new source location actually points back to the declared
template parameter.

llvm-svn: 130656
2011-05-01 09:53:37 +00:00
Chandler Carruth af85886563 Move several more type traits' implementations into the AST. A few were
already present in the AST, and I added the ones that weren't.

llvm-svn: 130655
2011-05-01 09:29:58 +00:00
Chandler Carruth 7ba7bd388b Switch __is_scalar to use the isScalarType predicate rather than
duplicating its logic.

llvm-svn: 130654
2011-05-01 09:29:55 +00:00
Chandler Carruth c5276e584e Have the array type traits build an expression with type 'size_t'
instead of 'int'.

The Embarcadero spec says 'unsigned int', not 'int'. That's what
'size_t' is on Windows, but for Clang using a 'size_t' that can be
larger than int seems more appropriate.

llvm-svn: 130653
2011-05-01 08:48:21 +00:00
Chandler Carruth f57eba3b20 Remove an inapplicable and completely out of place comment. The type is in fact 'bool'.
llvm-svn: 130652
2011-05-01 08:48:19 +00:00
Chandler Carruth 0d1a54f8e1 Remove more dead code for emitting diagnostics. The callers of these
functions already precluded dependent types from reaching them.

Also change one of the callers to not error when a trait is applied to
a dependent type. This is a perfectly reasonable pattern, and both Unary
and Binary type traits already support dependent types (by populating
the AST with a nonce value).

Remove the actual diagnostic, since these aren't errors.

llvm-svn: 130651
2011-05-01 08:41:10 +00:00
Argyrios Kyrtzidis d8970dde43 Improve traversing of BlockExprs in RecursiveASTVisitor.
llvm-svn: 130650
2011-05-01 08:06:46 +00:00
Chandler Carruth 9cf632cc35 Simplify the flow of some of the array type trait code.
Completely remove a switch which selected between the same two types.

llvm-svn: 130649
2011-05-01 07:49:26 +00:00
Chandler Carruth 20b9bc8638 Convert the expression trait evaluation to a static function and
a switch with any default case. This both warns when an enumerator is
missing and asserts if a value sneaks through despite the warning.

While in there fix a bunch of coding style issues with this code.

llvm-svn: 130648
2011-05-01 07:44:20 +00:00
Chandler Carruth b42fb19e9b Remove the default case from the unary type trait evaluation function,
adding an unreachable annotation. Remarkably this one was already
enumarting every trait.

llvm-svn: 130647
2011-05-01 07:44:17 +00:00
Chandler Carruth e46eaf3460 Remove a few more bogus returns when the switch covers all the
enumerators.

Also remove a default that led to llvm_unreachable to make another
switch warn if any enumerators fail to be covered.

llvm-svn: 130646
2011-05-01 07:23:23 +00:00
Chandler Carruth 8e2d6f4b31 Remove another default and a *completely* bogus return from a switch
over type traits.

Add the missing trait from this switch that Clang's warning uncovered.

llvm-svn: 130645
2011-05-01 07:23:20 +00:00
Chandler Carruth 8b0cf1d4d3 Mark that this function ends in a covering switch statement with every
case returning a value.

Silences a GCC warning.

llvm-svn: 130644
2011-05-01 07:23:17 +00:00
Chandler Carruth f2f5652d3d Remove the type traits UTT_IsLvalueExpr and UTT_IsRvalueExpr.
As might be surmised from their names, these aren't type traits, they're
expression traits. Amazingly enough, they're expression traits that we
have, and fully implement. These "type" traits are even parsed from the
same tokens as the expression traits. Luckily, the parser only tried the
expression trait parsing for these tokens, so this was all just a pile
of dead code.

llvm-svn: 130643
2011-05-01 07:23:14 +00:00
Alexis Hunt 61bc173784 Fully implement delegating constructors!
As far as I know, this implementation is complete but might be missing a
few optimizations. Exceptions and virtual bases are handled correctly.

Because I'm an optimist, the web page has appropriately been updated. If
I'm wrong, feel free to downgrade its support categories.

llvm-svn: 130642
2011-05-01 07:04:31 +00:00
Chandler Carruth 8e172c6054 More cleanup of the type traits implementation.
1) Moved the completeness checking routine above the evaluation routine
   so the reader sees that we do in fact check for complete types when
   necessary.
2) Remove the FIXME comment about not doing this.
3) Make the arguments to the evaluate function agree in order with those
   to the completeness checking function.
4) Completely specify the enumerators for the completeness checking
   function rather than relying on a default.
5) Remove a check for the Borland language to only require complete
   types in a few places. Borland's own documentation doesn't agree with
   this: some of the previously unspecified traits *do* require
   a complete type, some don't.
6) Correctly split the traits which do not require complete types from
   those that do, clarifying comments and citations to the standard or
   other documentation where relevant.

llvm-svn: 130641
2011-05-01 06:51:22 +00:00
Chandler Carruth d2479eaaed Order the type traits according to the standard's listing of unary type
traits where possible. For the rest, group them and add some
documentation regarding their origins.

No functionality change intended.

llvm-svn: 130639
2011-05-01 06:11:07 +00:00
Chandler Carruth 100f3a97f4 Begin cleaning up type trait expression implementations and settling on
a single pattern for implementing each.

llvm-svn: 130638
2011-05-01 06:11:03 +00:00
Francois Pichet af538d9ee6 Add a triple to this test, otherwise it fails under MSVC because wchar_t is unsigned with the i686-pc-win32 triple.
llvm-svn: 130636
2011-05-01 04:32:34 +00:00
John McCall ca87290f36 Improve the documentation for the two ObjCDeclQualifiers so that I
stop considering whether I can compress them. :)

llvm-svn: 130633
2011-05-01 03:04:29 +00:00
John McCall beaa11cac6 Compress some bits. Only matters for MSVC, or if we ever
devirtualize Decl (because bits can't get laid out in base
classes if the base is POD).

llvm-svn: 130632
2011-05-01 02:13:58 +00:00
Chandler Carruth dde65ea89a Switch the interface name for both TemplateTypeParmType and
SubstTemplateTypeParmType to be 'getIdentifier' instead of 'getName' as
it returns an identifier. This makes them more consistent with the
NamedDecl interface.

Also, switch back to using this interface to acquire the indentifier in
TypePrinter.cpp. I missed this in r130628.

llvm-svn: 130629
2011-05-01 01:05:51 +00:00
Chandler Carruth 0883632acb Re-applies the patch first applied way back in r106099, with
accompanying fixes to make it work today.

The core of this patch is to provide a link from a TemplateTypeParmType
back to the TemplateTypeParmDecl node which declared it. This in turn
provides much more precise information about the type, where it came
from, and how it functions for AST consumers.

To make the patch work almost a year after its first attempt, it needed
serialization support, and it now retains the old getName() interface.
Finally, it requires us to not attempt to instantiate the type in an
unsupported friend decl -- specifically those coming from template
friend decls but which refer to a specific type through a dependent
name.

A cleaner representation of the last item would be to build
FriendTemplateDecl nodes for these, storing their template parameters
etc, and to perform proper instantation of them like any other template
declaration. They can still be flagged as unsupported for the purpose of
access checking, etc.

This passed an asserts-enabled bootstrap for me, and the reduced test
case mentioned in the original review thread no longer causes issues,
likely fixed at somewhere amidst the 24k revisions that have elapsed.

llvm-svn: 130628
2011-05-01 00:51:33 +00:00
Rafael Espindola 37981e6099 Revert the previous patch while I figure out how to make llvm-gcc
less agressive about disabling cfi on linux :-(

llvm-svn: 130627
2011-04-30 23:07:10 +00:00
Rafael Espindola 1f6936b6c7 Update for cfi.
llvm-svn: 130624
2011-04-30 22:30:24 +00:00
Benjamin Kramer ed5ca78dc5 Remove unused function.
llvm-svn: 130622
2011-04-30 19:55:59 +00:00
Benjamin Kramer e63dbc373a Remove noisy semicolons.
llvm-svn: 130621
2011-04-30 19:55:55 +00:00
Eli Friedman 786d087ebd PR9792: Make sure to use the right definition of wchar_t when the default
wchar_t is an unsigned type.

llvm-svn: 130620
2011-04-30 19:24:24 +00:00
Eli Friedman fe0739dffb Some small improvements to the builtin (-ffreestanding) stdint.h; in
particular, make sure to handle WCHAR_MIN correctly.

llvm-svn: 130618
2011-04-30 19:02:59 +00:00
Rafael Espindola 6a10ed51c0 Pass -fno-dwarf2-cfi-asm and use FileCheck.
llvm-svn: 130617
2011-04-30 18:47:32 +00:00
Rafael Espindola e264187cf2 Implement -fno-dwarf2-cfi-asm.
llvm-svn: 130616
2011-04-30 18:35:43 +00:00
Douglas Gregor 85894a8f85 When comparing parameters of reference-to-qualified type during
partial ordering of function templates, use a simple superset
relationship rather than the convertibility-implying
isMoreQualifiedThan/compatibilyIncludes relationship. Fixes partial
ordering between references and address-space-qualified references.

llvm-svn: 130612
2011-04-30 17:07:52 +00:00
Ken Dyck d9c83e6cdf Replace a literal 8 with Context->getCharWidth() in
SynthesizeByrefCopyDestroyHelper(). No change in functionality intended.

llvm-svn: 130608
2011-04-30 16:08:27 +00:00
Chandler Carruth 61f4cbf38a Make type-traits reflect that Clang's vectors act like scalar types.
llvm-svn: 130606
2011-04-30 10:46:26 +00:00
Chandler Carruth 7623757cd0 Switch the type-trait like APIs on the AST to only check for incomplete
types after looking through arrays. Arrays with an unknown bound seem to
be specifically allowed in the library type traits in C++0x, and GCC's
builtin __is_trivial returns 'true' for the type 'int[]'. Now Clang
agrees with GCC about __is_trivial here.

Also hardens these methods against dependent types by just returning false.

llvm-svn: 130605
2011-04-30 10:31:50 +00:00
Chandler Carruth b077620c02 Extract a function to impose the completeness requirement on unary type
trait arguments. Reflow the logic to use early exit instead of a complex
condition expression. Switch to a switch for acting on different type
traits and add a bunch of the recently implemented type traits here.
This fixes one of the regressions with the new __is_standard_layout
trait to again require a complete type. It also fixes some latent bugs
in other traits that never did impose this despite the standard
requiring it. However, all these bugs were hidden for non-borland
systems where the default is to require a complete type.

It's unclear to me what the best approach here is: providing an explicit
lists for the ones requiring complete types only w/ Borland and using
a default for the rest, or forcing this switch to enumerate the traits
and make it clear which way each one goes.

I'm still working on cleaning up the tests so that they actually catch
this, a much more comprehensive update to the tests will come once I've
worked through the bugs I'm finding via inspection.

llvm-svn: 130604
2011-04-30 10:07:32 +00:00
Chandler Carruth 583edf8843 Rename the last '[hH]asStandardLayout' entites to '[iI]sStandardLayout'
based on Doug's preferences when we discussed this in IRC. This brings
the wording more in line with the standard.

llvm-svn: 130603
2011-04-30 10:07:30 +00:00
Chandler Carruth c1ce4f58e6 Hoist all of the type-specific trait logic for __is_standard_layout into
a Type method isStandardLayoutType, to keep our user API matching the
type trait builtins as closely as possible. Also, implement it in terms
of other Type APIs rather than in terms of other type traits. This
models the implementation on that of isLiteralType and isTrivialType.
There remain some common problems with these traits still, so this is
a bit of a WIP. However, we can now fix all of these traits at the same
time and in a consistent manner.

llvm-svn: 130602
2011-04-30 09:17:49 +00:00
Chandler Carruth b196374f53 Completely re-implement the core logic behind the __is_standard_layout
type trait. The previous implementation suffered from several problems:

1) It implemented all of the logic in RecordType by walking over every
   base and field in a CXXRecordDecl and validating the constraints of
   the standard. This made for very straightforward code, but is
   extremely inefficient. It also is conceptually wrong, the logic tied
   to the C++ definition of standard-layout classes should be in
   CXXRecordDecl, not RecordType.
2) To address the performance problems with #1, a cache bit was added to
   CXXRecordDecl, and at the completion of every C++ class, the
   RecordType was queried to determine if it was a standard layout
   class, and that state was cached. Two things went very very wrong
   with this. First, the caching version of the query *was never
   called*. Even within the recursive steps of the walk over all fields
   and bases the caching variant was not called, making each query
   a full *recursive* walk. Second, despite the cache not being used, it
   was computed for every class declared, even when the trait was never
   used in the program. This probably significantly regressed compile
   time performance for edge-case files.
3) An ASTContext was required merely to query the type trait because
   querying it performed the actual computations.
4) The caching bit wasn't managed correctly (uninitialized).

The new implementation follows the system for all the other traits on
C++ classes by encoding all the state needed in the definition data and
building up the trait incrementally as each base and member are added to
the definition of the class.

The idiosyncracies of the specification of standard-layout classes
requires more state than I would like; currently 5 bits. I could
eliminate one of the bits easily at the expense of both clarity and
resilience of the code. I might be able to eliminate one of the other
bits by computing its state in terms of other state bits in the
definition. I've already done that in one place where there was a fairly
simple way to achieve it.

It's possible some of the bits could be moved out of the definition data
and into some other structure which isn't serialized if the serialized
bloat is a problem. That would preclude serialization of a partial class
declaration, but that's likely already precluded.

Comments on any of these issues welcome.

llvm-svn: 130601
2011-04-30 09:17:45 +00:00
Benjamin Kramer 08635fcc83 Initialize HasStandardLayout.
llvm-svn: 130600
2011-04-30 08:55:35 +00:00
Ted Kremenek 8067746554 Move the SelfInit checker to the 'cocoa.experimental' package.
llvm-svn: 130598
2011-04-30 06:46:45 +00:00
Daniel Dunbar 2f31fb99ef Driver/Darwin: Don't link -lgcc_s.1 when compiling as iOS for the simulator,
that library has never been in the SDK. Fortunately, it shouldn't be necessary,
since that library was also removed in 10.6.

llvm-svn: 130595
2011-04-30 04:25:16 +00:00
Daniel Dunbar 72ceb92aa3 Driver/Darwin: When using -mios-simulator-version-min, explicitly pass this on
to the linker.
 - Only do this explicitly with the argument for now, the linker will need to
   explicitly add support for this.

llvm-svn: 130594
2011-04-30 04:22:58 +00:00
Daniel Dunbar a9cbb6b9d5 Driver/Darwin: Reject invalid arch combinations with
-mios-simulator-version-min.

llvm-svn: 130593
2011-04-30 04:20:40 +00:00
Daniel Dunbar b1189434dd Driver/Darwin: Change Darwin toolchain to explicitly track is-ios-sim bit, and
update -mios-simulator-version-min to set it.

llvm-svn: 130592
2011-04-30 04:18:16 +00:00
Daniel Dunbar 9aaeb6400b Driver/Darwin: Sketch initial support for a -mios-simulator-version-min= flag
and associated deployment target environment variable.

llvm-svn: 130591
2011-04-30 04:15:58 +00:00
Rafael Espindola 26cdfa71ef Update API.
llvm-svn: 130588
2011-04-30 03:46:18 +00:00
Nico Weber 1f41ab05f5 Fix gcc 'warning: multi-line comment'.
llvm-svn: 130583
2011-04-30 03:13:21 +00:00
Nico Weber e8fdcac02c Add lib/Tooling to the Makefile build.
llvm-svn: 130581
2011-04-30 03:09:18 +00:00
Nico Weber 1bb8e09c37 Add a Makefile to examples/Tooling for people who do not use cmake.
llvm-svn: 130577
2011-04-30 03:03:12 +00:00
Nico Weber 347339f790 Fix Makefile build of examples/clang-interpreter.
llvm-svn: 130576
2011-04-30 02:52:27 +00:00
Argyrios Kyrtzidis c8c7945a40 Add a couple of assertions to make sure the bitfields can fit the value assigned to them. No functionality change.
llvm-svn: 130573
2011-04-30 02:28:27 +00:00
Chad Rosier b9a8525bab Documentation for -Oz; Updated synopsis and item.
llvm-svn: 130570
2011-04-30 02:04:10 +00:00
Chad Rosier bc8d7c27d9 Add documentation for -Oz flag.
llvm-svn: 130569
2011-04-30 01:40:58 +00:00
Chad Rosier 3909e037ab Removed redundant case statements
llvm-svn: 130564
2011-04-30 00:03:48 +00:00
Devang Patel a3e3fded0a Tie constructor defintion with its declaration using AT_specification.
llvm-svn: 130561
2011-04-29 23:42:32 +00:00
Ted Kremenek e8e565ab81 Adjust test/Analysis/retain-release.m to also test the retain/release checker in Objective-C++ mode.
llvm-svn: 130559
2011-04-29 23:15:53 +00:00
Bob Wilson 9a5f84facb Add -Oz option and use it to set the inline threshold to 25.
Radar 9333566.  Patch by Chad Rosier!

llvm-svn: 130554
2011-04-29 22:49:50 +00:00
Fariborz Jahanian 52a8cca56f removes a meaningless comment.
llvm-svn: 130550
2011-04-29 22:11:28 +00:00
Fariborz Jahanian 99514b9168 block variables on lhs need be ir-gen'ed after the
rhs when its 'forwarding' pointer may be modified 
in rhs evaluation as result of call to Block_copy.
// rdar://9309454

llvm-svn: 130545
2011-04-29 21:53:21 +00:00