Commit Graph

4353 Commits

Author SHA1 Message Date
John McCall f3735e01ce Restore the lvalue-to-rvalue conversion patch with a minimal fix.
llvm-svn: 120555
2010-12-01 04:43:34 +00:00
Chris Lattner b85025fedd add some infrastructure that will let us codegen
http://llvm.org/bugs/show_bug.cgi?id=279#c3 better.

No functionality change yet.

llvm-svn: 120530
2010-12-01 02:05:19 +00:00
Chris Lattner 46a7ad7605 get some i32/i8/i1 constants from Builder, which is much less painful than
using ConstantInt::get.

llvm-svn: 120527
2010-12-01 01:47:15 +00:00
John McCall 5a39bd2443 A CGRecordLayout object persists. Since its contained types may
refer to opaque types, they must be held via PATypeHolders.  I'm
not sure why this hasn't blown up before.

llvm-svn: 120491
2010-11-30 23:21:46 +00:00
John McCall bcd38217f3 CGRecordLayoutBuilder does not need to be exported from this module.
llvm-svn: 120489
2010-11-30 23:17:27 +00:00
Fariborz Jahanian 3a4ea9a76c Declaring local static in global block
literal declaration caused crash in CodeGen.
This patch fixes it. pr8707

llvm-svn: 120486
2010-11-30 23:07:14 +00:00
John McCall 4f22c9de48 L-value to r-value conversion is not ready for prime-time.
llvm-svn: 120433
2010-11-30 17:58:55 +00:00
John McCall 824fd1dcff Introduce an r-value to l-value cast kind. I'm not promising anything
about the reliability of this yet.

llvm-svn: 120422
2010-11-30 10:13:06 +00:00
Douglas Gregor 2f53a0bbf2 Harden CGDebugInfo::CreateType() a bit for cases where we couldn't generate type info for its component types
llvm-svn: 120401
2010-11-30 06:38:09 +00:00
Michael J. Spencer 8aaf49959c Merge System into Support.
llvm-svn: 120297
2010-11-29 18:12:39 +00:00
Anders Carlsson acf877be12 Don't store the maximum alignment, we can trivially compute it.
llvm-svn: 120268
2010-11-28 23:06:23 +00:00
Anders Carlsson a459adb2ff More work on laying out virtual bases.
llvm-svn: 120257
2010-11-28 19:18:44 +00:00
Anders Carlsson 3378d870d2 BuildVirtualCall doesn't need to take a reference to a pointer.
llvm-svn: 120252
2010-11-28 17:53:32 +00:00
Anders Carlsson e8ba473ed2 Make the destructor be the 'vtable anchor' of the CGCXXABI class.
llvm-svn: 120251
2010-11-28 17:50:09 +00:00
Anders Carlsson fdee32f8ed Move CGCXXABI functions to CGCXXABI.cpp
llvm-svn: 120250
2010-11-28 17:49:03 +00:00
Anders Carlsson 81f6f3626e Add a CGCXXABI.cpp file.
llvm-svn: 120249
2010-11-28 17:46:52 +00:00
Benjamin Kramer 90b5b68535 Hide a bunch of symbols.
llvm-svn: 120153
2010-11-25 18:29:30 +00:00
Anders Carlsson 1f95ee3016 Begin work on actually laying out virtual bases.
llvm-svn: 120140
2010-11-25 01:59:35 +00:00
Anders Carlsson 7f95cd1817 Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.
llvm-svn: 120133
2010-11-24 23:12:57 +00:00
Anders Carlsson cadbc463e2 Move code off the primary base info iterator. No functionality change.
llvm-svn: 120132
2010-11-24 23:04:03 +00:00
Anders Carlsson 4131f00a1f Add CXXRecordDecl::getIndirectPrimaryBases.
llvm-svn: 120129
2010-11-24 22:50:27 +00:00
Anders Carlsson 72b1968d92 Simplify code.
llvm-svn: 120118
2010-11-24 21:53:50 +00:00
Anders Carlsson 0c75b49dc1 Fix a (probably very old) regression where we weren't using the typedef name for anonymous tag types.
llvm-svn: 120113
2010-11-24 21:05:09 +00:00
Anders Carlsson 0e4dfebe63 Revert r120110. We don't want to call ConvertType from within getCGRecordLayout.
llvm-svn: 120112
2010-11-24 20:22:04 +00:00
Anders Carlsson 449bbc5bde Use ConvertType instead of ConvertTagDeclType, since ConvertType will assign a name to the type.
llvm-svn: 120110
2010-11-24 20:05:21 +00:00
Anders Carlsson 6277615cbb Simplify code.
llvm-svn: 120109
2010-11-24 19:57:04 +00:00
Anders Carlsson c5bcaa373b Fix build.
llvm-svn: 120108
2010-11-24 19:52:29 +00:00
Anders Carlsson 63e0f2050f Make CodeGenTypes::getCGRecordLayout compute the layout lazily if it doesn't exist. This matches ASTContext::getASTRecordLayout and is less confusing.
llvm-svn: 120107
2010-11-24 19:51:04 +00:00
Anders Carlsson 36e2fa8209 CGRecordLayout types are always struct types.
llvm-svn: 120106
2010-11-24 19:37:16 +00:00
John McCall 086a464e24 Switch a lot of call-sites over to using the new value-kind calculations.
llvm-svn: 120084
2010-11-24 05:12:34 +00:00
Anders Carlsson 849ea413c6 Refactor the null-initialization for record types and make it handle bases that aren't i8 arrays.
llvm-svn: 119980
2010-11-22 18:42:14 +00:00
Anders Carlsson 39a6b22023 Remove FIXME; we don't ever want to lay out empty bases.
llvm-svn: 119957
2010-11-22 00:03:08 +00:00
Anders Carlsson a7dd96ce77 Rename BaseLLVMType to NonVirtualBaseLLVMType.
llvm-svn: 119956
2010-11-21 23:59:45 +00:00
Anders Carlsson e64fbe2a6c Add getCGRecordLayout helper function. No functionality change.
llvm-svn: 119955
2010-11-21 23:56:06 +00:00
Francois Pichet df946c3702 Fix warning: enumeration value 'IndirectField' not handled in switch.
llvm-svn: 119924
2010-11-21 06:49:41 +00:00
Fariborz Jahanian 44a41d1c25 Minor cleanup. No change otherwise.
llvm-svn: 119814
2010-11-19 18:17:09 +00:00
Fariborz Jahanian 148d113e55 Fix a bug where write-barriers for assignment through reference
types was not being generated for objc pointers.
// rdar://8681766.

llvm-svn: 119751
2010-11-18 22:39:16 +00:00
Argyrios Kyrtzidis d004064864 Refactoring of Diagnostic class.
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class.
-DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units.
-The rest of the state in Diagnostic object is considered related and tied to one translation unit.
-Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a
   SourceLocation instead of a FullSourceLoc.
-Reflect the changes to various interfaces.

llvm-svn: 119730
2010-11-18 20:06:41 +00:00
John McCall 7decc9e4ea Calculate the value kind of an expression when it's created and
store it on the expression node.  Also store an "object kind",
which distinguishes ordinary "addressed" l-values (like
variable references and pointer dereferences) and bitfield,
@property, and vector-component l-values.

Currently we're not using these for much, but I aim to switch
pretty much everything calculating l-valueness over to them.
For now they shouldn't necessarily be trusted.

llvm-svn: 119685
2010-11-18 06:31:45 +00:00
Anton Yartsev 3f8f2886c1 comparison of AltiVec vectors now gives bool result (fix for 7533)
llvm-svn: 119678
2010-11-18 03:19:30 +00:00
Chris Lattner 11feaf5921 When forming the !srcloc mdnode for an inline asm, add the SourceLocations
of all the lines of the inline asm.  With the refactoring and enhancement
of the backend, we can now reports errors on the correct source line when
an asm contains multiple lines of text.  For something like this:

void foo() {
  asm("push %rax\n"
      ".code32\n");
}

we used to get this: (note that the line 4 in t.c isn't helpful)

t.c:4:7: error: warning: ignoring directive for now
  asm("push %rax\n"
      ^
<inline asm>:2:1: note: instantiated into assembly here
.code32
^

now we get:

t.c:5:8: error: warning: ignoring directive for now
      ".code32\n"
       ^
<inline asm>:2:1: note: instantiated into assembly here
.code32
^

Note that we're pointing to line 5 properly now.  This implements
rdar://7839391 - inline asm errors should point to the right line in the asm
and makes the error message in PR8595 much less confusing.

llvm-svn: 119489
2010-11-17 08:25:26 +00:00
Chris Lattner 068f2ab10f adjust for llvm mainline, yay type safety
llvm-svn: 119487
2010-11-17 08:13:04 +00:00
Chris Lattner 776a30ddfc factor some code out to a helper function, no functionality change.
llvm-svn: 119464
2010-11-17 05:58:54 +00:00
Fariborz Jahanian a00076cda5 Fixes synthesis of type for the object which holds info.
about a __block cxx object.

llvm-svn: 119411
2010-11-17 00:21:28 +00:00
John McCall 5b26f65b3d Reset the lifetime-managed flag between emission of the agg conditional
branches.  Fixes PR8623.

llvm-svn: 119408
2010-11-17 00:07:33 +00:00
John McCall 4f29b49de1 Support compound complex operations as l-values in C++. Add a test
case based on CodeGen/volatile-1.c which tests the current C++
semantics, and note the many, many places we fall short of them.

llvm-svn: 119402
2010-11-16 23:07:28 +00:00
Fariborz Jahanian a3e54bd33e Implements __block API for c++ objects. There is still
issue with runtime which I am discussing it with Blaine.
This is wip (so no test yet).

llvm-svn: 119368
2010-11-16 19:29:39 +00:00
John McCall 07bb19667a Simplify some complex emission and implement correct semantics for
assignment to volatiles in C.  This in effect reverts some of mjs's
work in and around r72572.  Basically, the C++ standard is quite
clear, except that it lies about volatile behavior approximating
C's, whereas the C standard is almost actively misleading.

llvm-svn: 119344
2010-11-16 10:08:07 +00:00
John McCall 3eba6e67ec Now that we have reliable cast kinds, simplify scalar cast IR gen.
llvm-svn: 119332
2010-11-16 06:21:14 +00:00
John McCall d50a27111c Kill CK_Unknown and flesh out the documentation for the existing CastKinds.
llvm-svn: 119331
2010-11-16 05:46:29 +00:00