Commit Graph

3691 Commits

Author SHA1 Message Date
Eli Friedman b1bc368ca7 Address Richard's review comments on r147561 (Evaluate support for address-of-label differences).
llvm-svn: 147631
2012-01-05 23:59:40 +00:00
Douglas Gregor 52261fd2f7 Always allocate an extra 8 bytes for a deserialized declaration, since
some code in Clang expects 8-byte alignment of declarations.

llvm-svn: 147626
2012-01-05 23:49:36 +00:00
Douglas Gregor 64af53c364 When we deserialize a declaration from a module file, allocate extra
storage for the global declaration ID. Declarations that are parsed
(rather than deserialized) are unaffected, so the number of
declarations that pay this cost tends to be relatively small (since
relatively few declarations are ever deserialized).

This replaces a largish DenseMap within the AST reader. It's not
strictly a win in terms of memory use---not every declaration was
added to that DenseMap in the first place---but it's cleaner to have
this information available for every deserialized declaration, so that
future clients can rely on it.

llvm-svn: 147617
2012-01-05 22:27:05 +00:00
Douglas Gregor 72172e9009 When creating declarations that are deserialized from an module file,
go through a central allocation routine
Decl::AllocateDeserializedDecl(). No actual functionality change (yet).

llvm-svn: 147614
2012-01-05 21:55:30 +00:00
John McCall a59dc2f8f0 The value of a const weak variable is not an integer constant.
llvm-svn: 147575
2012-01-05 00:13:19 +00:00
Eli Friedman fd5e54da2d Add an APValue representation for the difference between two address-of-label expressions. Add support to Evaluate and CGExprConstant for generating/handling them. Remove the special-case for such differences in Expr::isConstantInitializer.
With that done, remove a bunch of buggy code from CGExprConstant for handling scalar expressions which is no longer necessary.

Fixes PR11705.

llvm-svn: 147561
2012-01-04 23:13:47 +00:00
Eli Friedman 90dc17510b Get rid of an unnecessary check; the AST for init-lists is the same independent of whether we're in C++11 mode.
llvm-svn: 147503
2012-01-03 23:54:05 +00:00
Douglas Gregor b59643baf6 Test "merging" of typedef types across distinct modules. At present,
the AST reader doesn't actually perform a merge, because name lookup
knows how to merge identical typedefs together.

As part of this, teach C/Objective-C name lookup to return multiple
results in all cases, rather than first digging through the attributes
to see if the value is overloadable. This way, we'll catch ambiguous
lookups in C/Objective-C.

llvm-svn: 147498
2012-01-03 23:26:26 +00:00
Eli Friedman b9c7129012 Support constant evaluation for OpenCL nested vector literals. Patch by Anton Lokhmotov.
llvm-svn: 147496
2012-01-03 23:24:20 +00:00
Douglas Gregor 22d0974b40 Introduce a non-uglified syntax for module imports in Objective-C:
@import identifier [. identifier]* ;

llvm-svn: 147452
2012-01-03 18:04:46 +00:00
Richard Smith dbfd4037fc Add assertion to char32_t that the value is valid, as suggested by Jordy Rose.
Add a test that such characters don't make it through to StringLiteral objects
in error recovery.

llvm-svn: 147438
2012-01-02 18:14:06 +00:00
Douglas Gregor 5dbf4eb66b Diagnose cases where the definition of a particular type is required,
is known (to Clang), but is not visible because the module has not yet
been imported.

llvm-svn: 147436
2012-01-02 17:18:37 +00:00
Rafael Espindola eeb9d9fef6 Small cosmetic cleanups in code I will change anyway.
llvm-svn: 147424
2012-01-02 06:26:22 +00:00
Douglas Gregor cf9f3ea6f9 Fix canonicalization of protocol-qualified types
llvm-svn: 147421
2012-01-02 02:00:30 +00:00
Douglas Gregor 05a1f4d60b Eliminate the ForwardDecl/InitiallyForwardDecl bits from ObjCProtocolDecl. They are no longer needed
llvm-svn: 147419
2012-01-01 22:06:18 +00:00
Douglas Gregor a503bb9ce4 Eliminate redundant, empty function
llvm-svn: 147416
2012-01-01 21:39:12 +00:00
Douglas Gregor f610267581 Eliminate ObjCForwardProtocolDecl, which is redundant now that
ObjCProtocolDecl modules forward declarations properly.

llvm-svn: 147415
2012-01-01 21:23:57 +00:00
Douglas Gregor 32c1757730 Wire up redeclaration chains for Objective-C protocols, so that both
forward declarations and definitions of an Objective-C protocol are
represented within a single chain of ObjCProtocolDecls.

llvm-svn: 147412
2012-01-01 20:30:41 +00:00
Douglas Gregor a715bfff98 Introduce the core infrastructure needed to model redeclaration chains
for Objective-C protocols, including:
  - Using the first declaration as the canonical declaration
  - Using the definition as the primary DeclContext
  - Making sure that all declarations have a pointer to the definition
  data, and that we know which declaration is the definition
  - Serialization support for redeclaration chains and for adding
  definitions to already-serialized declarations.

However, note that we're not taking advantage of much of this code
yet, because we're still re-using ObjCProtocolDecls.

llvm-svn: 147410
2012-01-01 19:51:50 +00:00
Douglas Gregor e6e48b1490 Move the data that corresponds to the definition of a protocol into a
separately-allocated DefinitionData structure. Introduce various
functions that will help with the separation of declarations from
definitions (isThisDeclarationADefinition(), hasDefinition(),
getDefinition()).

llvm-svn: 147408
2012-01-01 19:29:29 +00:00
Douglas Gregor 33b2429bf3 Use declaresSameEntity() when comparing ObjCProtocolDecls, and
getCanonicalDecl() when putting ObjCProtocolDecls into a set. This is
groundwork for making ObjCProtocolDecl redeclarable.

llvm-svn: 147406
2012-01-01 18:09:12 +00:00
Rafael Espindola 0f960a0a5a Consider visibility attributes in namespaces as being explicit. I.e., they
take precedence over command line options. Fixes PR10113.

llvm-svn: 147405
2012-01-01 18:06:40 +00:00
Rafael Espindola 09593a322a Replace a isa+cast with a dyn_cast.
llvm-svn: 147401
2012-01-01 17:48:19 +00:00
Richard Smith 88eb4d3a45 Fix crash when trying to pretty-print unicode or wide string literals.
llvm-svn: 147385
2011-12-30 23:37:31 +00:00
Richard Smith fddd384b73 Unrevert r147271, reverted in r147361.
Also temporarily remove the assumption from IR gen that we can emit IR for every
constant we can fold, since it isn't currently true in C++11, to fix PR11676.

Original comment from r147271:

constexpr: perform zero-initialization prior to / instead of performing a
constructor call when appropriate. Thanks to Eli for spotting this.

llvm-svn: 147384
2011-12-30 21:15:51 +00:00
Rafael Espindola fafe4b7572 Revert r147271. This fixes PR11676.
llvm-svn: 147362
2011-12-30 03:11:50 +00:00
Richard Smith 5fab0c9e1a Small refactoring and simplification of constant evaluation and some of its
clients. No functionality change.

llvm-svn: 147318
2011-12-28 19:48:30 +00:00
Douglas Gregor deafd0b2a4 Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
covers both declarations (@class) and definitions (@interface) of an
Objective-C class.

llvm-svn: 147299
2011-12-27 22:43:10 +00:00
Rafael Espindola 0b79046c5c Fix the visibility of methods of explicit template instantiation definition
when using -fvisibility-inlines-hidden. This matches gcc's behavior and
documentation.

Fixes PR11642.

llvm-svn: 147295
2011-12-27 21:15:28 +00:00
Richard Smith 6e52514c5d constexpr: support for evaluation and codegen of typeid constants.
llvm-svn: 147290
2011-12-27 12:18:28 +00:00
Richard Smith 771c4a1775 constexpr: perform zero-initialization prior to / instead of performing a
constructor call when appropriate. Thanks to Eli for spotting this.

llvm-svn: 147271
2011-12-25 20:00:17 +00:00
Benjamin Kramer e56f393249 Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" so this patch is surprisingly small.
Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility.

llvm-svn: 147221
2011-12-23 17:00:35 +00:00
Fariborz Jahanian 87b4ae6cab objective-c: Use class definition AST in several situations when
building related objc ASTs which require a class definition AST.
These were uncovered when testing objc rewriter.

llvm-svn: 147210
2011-12-23 00:31:02 +00:00
Eli Friedman 803acb3ff2 Add support for bitcasts to vector type in Evaluate.
llvm-svn: 147137
2011-12-22 03:51:45 +00:00
Richard Smith cc36f698af PR11614: Mark defaulted special constructors as constexpr if their implicit
definition would satisfy the constexpr requirements.

llvm-svn: 147128
2011-12-22 02:22:31 +00:00
Richard Smith ca2cfbf5ce PR11637: implement special-case constant evaluation for char arrays initialized
by string literals.

llvm-svn: 147120
2011-12-22 01:07:19 +00:00
Matt Beaumont-Gay 4a39e49373 Cast enumerators from different anonymous enums to unsigned, to appease gcc
llvm-svn: 147067
2011-12-21 19:36:37 +00:00
Richard Smith f2b681b4d8 constexpr: diagnostic improvements for invalid lvalue-to-rvalue conversions in
constant expressions.

llvm-svn: 147035
2011-12-21 05:04:46 +00:00
Richard Smith 242ad89a15 C++11 half of r147023: In C++11, additionally eagerly instantiate:
- constexpr function template instantiations
 - variables of reference type
 - constexpr variables

llvm-svn: 147031
2011-12-21 02:55:12 +00:00
Eli Friedman 13ec75ba42 Fix a case where Expr::isConstantInitializer would return true for an expression we can't support. In a slightly amusing twist, the case in question was already in the clang regression tests marked as a valid construct. <rdar://problem/10020074>
llvm-svn: 147026
2011-12-21 00:43:02 +00:00
Douglas Gregor 64d9257e38 When performing layout for an Objective-C class, make sure to dig out
the definition of that class. Fixes PR11613 / <rdar://problem/10604077>.

llvm-svn: 146976
2011-12-20 15:50:13 +00:00
David Blaikie 68e081d606 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
llvm-svn: 146959
2011-12-20 02:48:34 +00:00
Richard Smith 5894a9138c Evaluation support for ExprWithCleanups. We won't evaluate any expression which
actually requires non-trivial cleanups, so no cleanups need to be performed.

llvm-svn: 146916
2011-12-19 22:12:41 +00:00
Richard Smith d0b111c3dd Improve r146813 (for PR11595) to give an appropriate diagnostic.
llvm-svn: 146915
2011-12-19 22:01:37 +00:00
Richard Smith d0b4dd656d constexpr handling improvements. Produce detailed diagnostics when a 'constexpr'
variable is initialized by a non-constant expression, and pass in the variable
being declared so that earlier-initialized fields' values can be used.

Rearrange VarDecl init evaluation to make this possible, and in so doing fix a
long-standing issue in our C++ constant expression handling, where we would
mishandle cases like:

  extern const int a;
  const int n = a;
  const int a = 5;
  int arr[n];

Here, n is not initialized by a constant expression, so can't be used in an ICE,
even though the initialization expression would be an ICE if it appeared later
in the TU. This requires computing whether the initializer is an ICE eagerly,
and saving that information in PCH files.

llvm-svn: 146856
2011-12-19 06:19:21 +00:00
Richard Smith 0b973d091a PR11604: don't allow floating-literal-to-integer casts in ICEs if the (truncated)
floating literal value does not fit into the destination type. Such casts have
undefined behavior at translation time; treating them as non-ICE matches the
behavior of modern gcc versions.

llvm-svn: 146842
2011-12-18 02:33:09 +00:00
Eli Friedman 79281d1df9 Add a missing check before trying to evaluate a temporary. PR11595.
llvm-svn: 146813
2011-12-17 02:24:21 +00:00
Douglas Gregor 812523570e Make sure we're always setting the previous declaration of an ObjCInterfaceDecl
llvm-svn: 146763
2011-12-16 22:37:11 +00:00
Eli Friedman 375f09f5bf Add missing flush call. This is an attempt to fix a broken Windows buildbot.
llvm-svn: 146760
2011-12-16 22:12:23 +00:00
Richard Smith f6f003af6a C++11 constexpr: Add note stacks containing backtraces if constant evaluation
fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit
argument to driver and frontend, to control the maximum number of notes so
produced (default 10). Fix APValue printing to be able to pretty-print all
APValue types, and move the testing for this functionality from a unittest to
a -verify test now that it's visible in clang's output.

llvm-svn: 146749
2011-12-16 19:06:07 +00:00
Douglas Gregor 7671e53b66 If there is a definition of an ObjCInterfaceDecl, make it the Decl returned from the corresponding ObjCInterfaceType
llvm-svn: 146740
2011-12-16 16:34:57 +00:00
Douglas Gregor ab1ec82e04 Fix chaining of ObjCInterfaceDecl redeclarations
llvm-svn: 146722
2011-12-16 03:12:41 +00:00
Douglas Gregor dc9166c8e1 Keep track of all declarations of an Objective-C class (both forward
declarations and definitions) as ObjCInterfaceDecls within the same
redeclaration chain. This new representation matches what we do for
C/C++ variables/functions/classes/templates/etc., and makes it
possible to answer the query "where are all of the declarations of
this class?"

llvm-svn: 146679
2011-12-15 20:29:51 +00:00
Douglas Gregor a323c4c3cd Extend ObjCInterfaceDecl::DefinitionData to contain a pointer to the
definition, and implement ObjCInterfaceDecl::getDefinition()
efficiently based on that.

llvm-svn: 146669
2011-12-15 18:17:27 +00:00
Douglas Gregor 66b310c653 Introduce the core infrastructure needed to model a complete
redeclaration chain for Objective-C classes, including:
  - Using the first declaration as the canonical declaration.
  - Using the definition as the primary DeclContext
  - Making sure that all declarations have a pointer to the definition
  data, and the definition knows that it is the definition.
  - Serialization support for when a definition gets added to a
  declaration that comes from an AST file.

However, note that we're not taking advantage of much of this code
yet, because we're still re-using ObjCInterfaceDecls.

llvm-svn: 146667
2011-12-15 18:03:09 +00:00
Douglas Gregor c0ac7d688e Move the definition-specific data of ObjCInterfaceDecl into a
separately-allocated DefinitionData structure, which we manage the
same way as CXXRecordDecl::DefinitionData. This prepares the way for
making ObjCInterfaceDecls redeclarable, to more accurately model
forward declarations of Objective-C classes and eliminate the mutation
of ObjCInterfaceDecl that causes us serious trouble in the AST reader.

Note that ObjCInterfaceDecl's accessors are fairly robust against
being applied to forward declarations, because Clang (and Sema in
particular) doesn't perform RequireCompleteType/hasDefinition() checks
everywhere it has to. Each of these overly-robust cases is marked with
a FIXME, which we can tackle over time.

llvm-svn: 146644
2011-12-15 05:27:12 +00:00
Douglas Gregor 0b144e160a Replace all comparisons between ObjCInterfaceDecl pointers with calls
to declaresSameEntity(), as a baby step toward tracking forward
declarations of Objective-C classes precisely. Part of
<rdar://problem/10583531>.

llvm-svn: 146618
2011-12-15 00:29:59 +00:00
Douglas Gregor 40d009ff0c Eliminate the vistigial ObjCClassDecl::ObjCClassRef, and inline its
members into ObjCClassDecl, saving ourselves one pointer per forward
declaration.

llvm-svn: 146564
2011-12-14 17:12:03 +00:00
Abramo Bagnara d541a4c70d Added an assertion about overflow in sizeof evaluation. This does not solve the underlying structural issue that is waiting for a proper solution.
llvm-svn: 146482
2011-12-13 11:23:52 +00:00
Richard Smith 357362d00b Add checks and diagnostics for many of the cases which C++11 considers to not
be constant expressions.

llvm-svn: 146479
2011-12-13 06:39:58 +00:00
Fariborz Jahanian 0586df4a00 Fixes a bug in calculation of field offsets of ms_struct
fields by just following what comment says.
// rdar://10513599

llvm-svn: 146414
2011-12-12 21:16:36 +00:00
Richard Smith ff07af12df Clean up diagnostic wording for disallowed casts in C++11 constant expressions.
llvm-svn: 146395
2011-12-12 19:10:03 +00:00
Richard Smith 6d6ecc34f8 Implement C++11 constant expression cast restrictions.
llvm-svn: 146371
2011-12-12 12:46:16 +00:00
Richard Smith 187ef01404 Fix some not-yet-used diagnostic code in a template, which gcc spotted and clang
did not!

llvm-svn: 146366
2011-12-12 09:41:58 +00:00
Richard Smith 92b1ce0a80 Prepare constant expression infrastructure for the generation of richer
diagnostics. No functionality change.

llvm-svn: 146365
2011-12-12 09:28:41 +00:00
Richard Smith 036e2bd07a Add a fast path to the constant evaluator for integer literals. This speeds up
compilation of some translation units of SPEC's 445.gobmk by ~4%, and does not
seem to cause a measurable slowdown in other cases.

llvm-svn: 146306
2011-12-10 01:10:13 +00:00
Fariborz Jahanian 88d510da9d Add ability to supply additional message to availability macros,
// rdar://10095131

llvm-svn: 146304
2011-12-10 00:28:41 +00:00
Richard Smith f57d8cb131 C++11 constant expressions: Don't use CheckICE in C++11; instead, determine
whether an expression is a (core) constant expression as a side-effect of
evaluation. This takes us from accepting far too few expressions as ICEs to
accepting slightly too many -- fixes for the remaining cases are coming next.

The diagnostics produced when an expression is found to be non-constant are
currently quite poor (with generic wording but reasonable source locations),
and will be improved in subsequent commits.

llvm-svn: 146289
2011-12-09 22:58:01 +00:00
Richard Smith 941aae0e9d Teach isConstantInitializer that numeric literals are constants, rather than
having it evaluate them. No change in functionality, but a speed up of about 5%
on some translation units in SPEC 445.gobmk.

llvm-svn: 146248
2011-12-09 06:47:34 +00:00
Argyrios Kyrtzidis fac35c0a9b In ExprEvaluatorBase::VisitOpaqueValueExpr() add a sanity check to avoid
infinite recursion due to bad OpaqueValueExpr.

llvm-svn: 146237
2011-12-09 02:44:48 +00:00
Richard Smith 10c7c9090e Replace the implementation of __builtin_constant_p (which was based on the GCC
documentation) with one based on what GCC's __builtin_constant_p is actually
intended to do (discovered by asking a friendly GCC developer).

In particular, an expression which folds to a pointer is now only considered to
be a "constant" by this builtin if it refers to the first character in a string
literal.

This fixes a rather subtle wrong-code issue when building with glibc. Given:

const char cs[4] = "abcd";
int f(const char *p) { return strncmp(p, cs, 4); }

... the macro magic for strncmp produces a (potentially crashing) call to
strlen(cs), because it expands to an expression starting with:

  __builtin_constant_p(cs) && strlen(cs) < 4 ? /* ... */

Under the secret true meaning of __builtin_constant_p, this is guaranteed to be
safe!

llvm-svn: 146236
2011-12-09 02:04:48 +00:00
Argyrios Kyrtzidis 4996f5fba2 Save category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!
llvm-svn: 146213
2011-12-09 00:31:40 +00:00
Richard Smith 42d3af9d95 When folding the size of a global scope VLA to a constant, require the array
bound to not have side effects(!). Add constant-folding support for expressions
of void type, to ensure that we can still fold ((void)0, 1) as an array bound.

llvm-svn: 146000
2011-12-07 00:43:50 +00:00
Richard Smith 161f09abd7 Move vector bitcast handling in constant expressions from the expression
evaluator into constant initializer handling / IRGen. The practical consequence
of this is that the bitcast now lives in the constant's definition, rather than
in its uses.

The code in the constant expression evaluator was producing vectors of the wrong
type and size (and possibly of the wrong value for a big-endian int-to-vector
bitcast). We were getting away with this only because we don't yet support
constant-folding of any expressions which inspect vector values.

llvm-svn: 145981
2011-12-06 22:44:34 +00:00
Lang Hames d42bb47782 Make isWeakDecl available as a method on ValueDecl.
llvm-svn: 145845
2011-12-05 20:16:26 +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
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
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
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
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
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
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
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
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
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
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
Richard Smith 9a56882e53 Add driver arguments -ftemplate-depth=N and -fconstexpr-depth=N, with the same
semantics and defaults as the corresponding g++ arguments. The historical g++
argument -ftemplate-depth-N is kept for compatibility, but modern g++ versions
no longer document that option.

Add -cc1 argument -fconstexpr-depth N to implement the corresponding
functionality.

The -ftemplate-depth=N part of this fixes PR9890.

llvm-svn: 145045
2011-11-21 19:36:32 +00:00
Douglas Gregor 49ccfaa938 Add support for pretty-printing attributes, from Richard Membarth!
llvm-svn: 145002
2011-11-19 19:22:57 +00:00
Argyrios Kyrtzidis 841dd8861a Change ASTConsumer::HandleTopLevelDecl to return true for the parser to continue
parsing or false to abort parsing.

llvm-svn: 144943
2011-11-18 00:26:59 +00:00
Sean Callanan 651982790a Added a clause to the ASTImporter allowing it to
import TranslationUnitDecls.

llvm-svn: 144934
2011-11-17 23:20:56 +00:00
Richard Smith 027bf11eb3 Constant expression evaluation: add support for evaluation of member pointers
and base-to-derived casts, and add proper handling of temporaries.

llvm-svn: 144926
2011-11-17 22:56:20 +00:00
Richard Smith 10f4d06b81 PR11391: Don't try to evaluate the LHS of a _Complex assignment as an rvalue.
llvm-svn: 144799
2011-11-16 17:22:48 +00:00
Richard Smith cf74da76db Fix PR11385: A pointer constant expression which has been cast via an integer is
not safely derived. Don't allow lvalue-to-rvalue conversions on the result of
dereferencing such a pointer.

llvm-svn: 144783
2011-11-16 07:18:12 +00:00
Argyrios Kyrtzidis ae8e792fe2 Use Decl's isImplicit field to indicate whether an ObjCInterfaceDecl is 'ImplicitInterfaceDecl',
no need to store it in another field.

llvm-svn: 144624
2011-11-15 06:20:21 +00:00
Ted Kremenek 1fcdaa9c05 ARC: make assignment to 'self' within class methods illegal. Fixes <rdar://problem/10416568>.
llvm-svn: 144572
2011-11-14 21:59:25 +00:00
Richard Trieu 5d1aff049e Change the checks in the type aka printing. A confusing case where the string
of the first type is the same as the aka string of the second type, but both
types are different.  Update the logic to print an aka for the first type to
show that they are different.

llvm-svn: 144558
2011-11-14 19:39:25 +00:00