Граф коммитов

5417 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor ad90e96fb7 PCH support for CompoundAssignOperator and ConditionalOperator
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 22:40:36 +00:00
Douglas Gregor cb2ca73c1d PCH support for ImaginaryLiteral and ArraySubscriptExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 22:19:53 +00:00
Mike Stump c2f4c34ed8 Fixup codegen for copy/dispose for block literals. Radar 6791245
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 22:11:36 +00:00
Daniel Dunbar 03f5ad9a77 Defer generation of tentative definitions.
- PR3980.

 - <rdar://problem/6762287> [irgen] crash when generating tentative
   definition of incomplete structure

 - This also avoids creating common definitions for things which are
   later overwritten.

 - XFAIL'ed external-defs.c, it isn't completing types properly yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 22:08:45 +00:00
Douglas Gregor 6d47396712 PCH support for ExtQualType
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 22:00:08 +00:00
Fariborz Jahanian c8d2e77288 Fix decl type merges when they have
__string/__weak attributes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69229 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 21:54:48 +00:00
Devang Patel 963dfbde17 Set DebugInfo at the beginning of GenerateBlockFunction().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69228 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 21:51:44 +00:00
Anders Carlsson ca29ad9fea When declaring a variable that has a constructor and a direct initializer, for example:
struct X {
  X(int, int);
};

X x(10, 10);

we model that as

X x = X(10, 10); 

inserting a temporary object expr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 21:48:18 +00:00
Daniel Dunbar dbb4f21125 Add warning when a tentative array definition is assumed to have one element.
- Also, fixed one to actually be one (instead of zero). :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 21:35:27 +00:00
Douglas Gregor 68a2eb0cc7 PCH support for declaration attributes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 21:30:51 +00:00
Anders Carlsson 59d8e0ff38 Actually generate code for the simple constructors we know we can generate code for.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69222 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 21:02:13 +00:00
Daniel Dunbar 7595fb1418 Don't use \01 in symbol name if unnecessary.
- This was particularly bad since I fixed one instance of this name
   and not another, meaning we got an LLVM module with the same
   effective name in two different globals!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69205 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 19:52:32 +00:00
Steve Naroff cd9c51433c Fix <rdar://problem/6786597> varargs not supported for Blocks under clang.
Teach Sema::SemaBuiltinVAStart() about blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69201 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 19:33:47 +00:00
Fariborz Jahanian 50c314cb04 Patch to remove a bogus warning which pointed to underlying AST
gen. issue for property in continuation class declared readwrite 
but which did not generate the declaration for the setter. Fix also
removed a FIXME and resulted in code cleanup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69200 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 19:19:03 +00:00
Daniel Dunbar f59c1a6d27 Fix alignment on obj_msgrefs to match llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 19:04:46 +00:00
Daniel Dunbar 33af70f0f0 Add test case for superrefs section (and make spacing consistent).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 19:03:14 +00:00
Chris Lattner fe526d2be9 fix some out of bounds array access problems, which manifest particularly
spectacularly when built for x86-64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 18:48:23 +00:00
Douglas Gregor 6a2bfb2ead PCH support for the string literal of a FileScopeAsmDecl.
Some minor cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69196 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 18:43:11 +00:00
Douglas Gregor f60e991869 For source location entries that describe instantiations, encode the
token length in the PCH file rather than trying (and failing) to
reconstruct it be getting the spelling token's length.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 18:05:10 +00:00
Douglas Gregor 1f0d0133b0 PCH support for MemberExpr and CallExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 17:43:59 +00:00
Steve Naroff 3bf4497962 Fixup http://llvm.org/viewvc/llvm-project?rev=69165&view=rev (based on feedback from Eli).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 17:31:31 +00:00
Chris Lattner d2aa7c90e7 move {'s
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69179 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 17:13:42 +00:00
Steve Naroff 1b6823d48d Revert previous patch (will commit a fix soon).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69178 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 16:58:41 +00:00
Chris Lattner 8a941e0c71 Make diagnostic class explicit in the diag record instead of
implicit from its parenting.  Now that diag mapping is 
explicit, eliminate the fatal and extwarn classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69177 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 16:56:26 +00:00
Chris Lattner 4ac072aceb Tblgen now passes the default mapping explicitly, instead of having it
be tied to the diag class.  This requires an LLVM tree update.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 16:44:12 +00:00
Douglas Gregor 673ecd6a4a PCH support for string literals
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 16:35:07 +00:00
Daniel Dunbar c35d71f1e0 Driver: Add --help-hidden
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69171 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 16:34:29 +00:00
Fariborz Jahanian 93ae2c780e __objc_superrefs belongs to __DATA segment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69170 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 16:31:36 +00:00
Douglas Gregor 0b0b77fa29 PCH support for UnaryOperator, SizeOfAlignOfExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69169 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 15:58:59 +00:00
Anders Carlsson 95d4e5d2f8 Start attempting to generate code for C++ ctors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69168 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 15:55:24 +00:00
Steve Naroff ee3899e1ca Fix <rdar://problem/6789707> "warning: 'extern' variable has an initializer" not correct for __private_extern__.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69167 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 15:20:03 +00:00
Steve Naroff b25ddfb155 Fix <rdar://problem/6791490> [clang10 regression] [sema] invalid illegal jump diagnostic.
caused by: <rdar://problem/6252084> [sema] jumps into Obj-C exception blocks should be disallowed.

Sema::RecursiveCalcLabelScopes() and Sema::RecursiveCalcJumpScopes() need to pop the ScopeStack within the statement iteration loop (was outside the loop).

Eli, please review (thanks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 14:38:36 +00:00
Chris Lattner 27ceb9d77d Rejigger how -pedantic and -pedantic-errors work and their interaction
with other diagnostic mapping.  In the new scheme, -Wfoo or -Wno-foo or 
-Werror=foo all override the -pedantic options, and __extension__ 
robustly silences all extension diagnostics in their scope.

An added bonus of this change is that MAP_DEFAULT goes away, meaning that
per-diagnostic mapping information can now be stored in 2 bits, doubling
the density of the Diagnostic::DiagMapping array.  This also 
substantially simplifies Diagnostic::getDiagnosticLevel.

OTOH, this temporarily introduces some "macro intensive" code in 
Diagnostic.cpp.  This will be addressed in a later patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69154 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 07:01:18 +00:00
Douglas Gregor ffb4b6e299 Implement support for designated initializers that refer to members of
anonymous structs or unions. Fixes PR3778.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 06:41:24 +00:00
Anders Carlsson 3ac86b59b0 Add support for mangling C++ constructors. Review appreciated (I'm looking at you, Doug)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 05:36:58 +00:00
Douglas Gregor 7119971843 Switch designated-initializer checking from using designator iterators
to using designator indices. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 04:56:10 +00:00
Douglas Gregor 62e445c4df Don't tip-to around BitstreamReader::JumpToBit jumping to the end of the stream. LLVM has been updated to allow this
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69146 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 04:54:29 +00:00
Anders Carlsson 68a359cac7 Add CGCXX.h with ctor/dtor type enumerations. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69137 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 04:36:55 +00:00
Anders Carlsson d7c62b1929 Simplify CodeGenFunction::GenerateCode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 04:10:19 +00:00
Daniel Dunbar 0bf2199b79 Tweaks to Objective-C metadata (32 & 64-bit) to match llvm-gcc.
- Set alignment on property lists.
 - 32-bit:
   o Set section on property lists.
   o Fix section name for category class methods.
   o Fix symbol name for property lists.
   o Fix section name for class method.
   o Set alignment and section on class extension structure.
   o Set alignment on a number of things: instance variables, methods,
   method descriptions, the symbols structure.
 - 64-bit:
   o Fix section flags for protocol list.

I doubt most of these were problems in practice, but it is nice to
match llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 02:56:18 +00:00
Daniel Dunbar 70d3c92820 Driver: For clang, accept -fsigned-bitfields and reject
-funsigned-bitfields for now (clang defaults to -fsigned-bitfields).
 - <rdar://problem/6790309> ER: Support
   -fsigned-bitfields/-funsigned-bitfields


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69131 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 02:37:43 +00:00
Douglas Gregor db600c330a PCH support for CStyleCastExpr and BinaryOperator expression kinds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 00:25:59 +00:00
Daniel Dunbar 44e35f7b2b Improve "assignment to cast" diagnostic.
- Strip off extra parens when looking for casts.
 - Change the location info to point at the cast (instead of the
   assignment).

For example, on
  
  int *b;
  #define a ((void*) b)
  void f0() {
    a = 10;
  }
  
we now emit:
  
  /tmp/t.c:4:3: error: assignment to cast is illegal, lvalue casts are not supported
    a = 10;
    ^ ~
  /tmp/t.c:2:12: note: instantiated from:
  #define a ((void*) b)
            ~^~~~~~~~~~
  
instead of:
  
  /tmp/t.c:4:5: error: expression is not assignable
    a = 10;
    ~ ^


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69114 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 00:08:05 +00:00
Douglas Gregor c04db4feef PCH support for ParenExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69106 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 23:59:37 +00:00
Douglas Gregor 087fd53680 Add PCH support for ImplicitCastExprs. This is the first expression
kind PCH handles that has an expression as an operand, so most of this
work is in the infrastructure to rebuild expression trees from the
serialized representation. We now store expressions in post-order
(e.g., Reverse Polish Notation), so that we can easily rebuild the
appropriate expression tree.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 23:32:43 +00:00
Daniel Dunbar 5717daef56 Strip paren expressions when trying to diagnose "cast as lvalue"
extension.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69100 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 23:26:44 +00:00
Chris Lattner 2c78b873f4 Change Lexer::MeasureTokenLength to take a LangOptions reference.
This allows it to accurately measure tokens, so that we get:

t.cpp:8:13: error: unknown type name 'X'
static foo::X  P;
       ~~~~~^

instead of the woefully inferior:

t.cpp:8:13: error: unknown type name 'X'
static foo::X  P;
       ~~~~ ^

Most of this is just plumbing to push the reference around.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 23:22:57 +00:00
Fariborz Jahanian 12bac2566e Diagnose properties which have no implementations;
either unimplemented setter/getter or no
implementation directive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 23:15:21 +00:00
Daniel Dunbar b90bb0099e Set alignment on __cstring metadata variables to 1 (matching
llvm-gcc).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69097 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 23:14:47 +00:00
Daniel Dunbar dd1319879f Avoid use of magic \01 prefix when unneeded.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69093 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 22:44:26 +00:00