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

54 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 707ea283f5 Code gen for compound assignment of complex
types using property syntax to access setter/getters.
(also radar 7351147).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 18:43:00 +00:00
Fariborz Jahanian dfb1eb208e Patch to implement code gen. use of compound assignent on
properties of complex type. Radar 7351147.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 18:08:50 +00:00
Duncan Sands f177d9d6c2 Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy.  Requested by Chris!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96224 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 16:14:01 +00:00
Chris Lattner dd36d32873 refactor pre/postinc logic into CGF and require the caller to pass in the
lvalue to poke, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93075 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 21:40:03 +00:00
Eli Friedman 8e274bd14b Minor optimization; emit proper unsupported messages for a couple of cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-25 06:17:05 +00:00
Benjamin Kramer 56a44f7db0 Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 19:51:45 +00:00
Benjamin Kramer 85b4521e34 Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90044 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-28 19:45:26 +00:00
John McCall 183700f494 Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely.  Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 23:43:11 +00:00
Mike Stump db52dcdae7 Reflow comments and some minor whitespace fixups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 13:00:44 +00:00
Fariborz Jahanian 09105f52b1 Using "ObjCImplicitSetterGetterRefExpr" instead of "ObjCImplctSetterGetterRefExpr".
A field rename and more comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 17:02:02 +00:00
Daniel Dunbar 7765934ad7 Switch to SmallString::str from SmallString::c_str.
- Several FIXMEs due to non-Twinification of IRBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79455 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 20:04:03 +00:00
Fariborz Jahanian 154440e6a8 Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79365 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 20:50:23 +00:00
Owen Anderson c9c88b4159 Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77722 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:28:54 +00:00
Mike Stump b3589f44c5 Canonicalize else spacing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77629 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 22:28:39 +00:00
Owen Anderson bc0a2226c7 Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 21:00:51 +00:00
Daniel Dunbar 0d9c54cc62 Switch to using llvm::Value::getName()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 08:32:30 +00:00
Owen Anderson 4a28d5deeb Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 23:12:58 +00:00
Owen Anderson a1cf15f468 Update for LLVM API change, and contextify a bunch of related stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 23:10:40 +00:00
Owen Anderson 69243825cb Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 04:10:07 +00:00
Chris Lattner 87415d2d45 Update clang for the add ->add/fadd split. Likewise for sub and mul.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73604 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 06:36:24 +00:00
Daniel Dunbar 42f963dec2 Support complex properties, ivars and message expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-10 04:38:50 +00:00
Anders Carlsson 4b76b4fa1a Implement VisitCXXExprWithTemporaries for complex expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72653 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-31 00:12:05 +00:00
Mike Stump 7f79f9be59 Fixup the rest of the trivial cases of the codegen of volatile. If
any body can spot codegen bugs with volatile, or knows of any in the
bug database, let me know.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-29 15:46:01 +00:00
Anders Carlsson e9f2f45fe9 Functions that return references can be rvalues as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72457 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-27 03:37:57 +00:00
Eli Friedman ab3a852ae7 Change compound assignment operators to keep track of both the promoted
LHS type and the computation result type; this encodes information into 
the AST which is otherwise non-obvious.  Fix Sema to always come up with the 
right answer for both of these types.  Fix IRGen and the analyzer to 
account for these changes.  This fixes PR2601.  The approach is inspired 
by PR2601 comment 2.

Note that this changes real *= complex in CodeGen from a silent 
miscompilation to an explicit error.

I'm not really sure that the analyzer changes are correct, or how to 
test them... someone more familiar with the analyzer should check those 
changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28 01:22:36 +00:00
Eli Friedman c110c54581 Some minor fixes for complex IRGen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-23 04:08:46 +00:00
Eli Friedman 7976932a1c Minor cleanup for choose expressions: add a helper that returns the
chosen sub-expression, rather than just evaluating the condition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66018 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 05:52:32 +00:00
Chris Lattner 1e4db7c468 rip out __builtin_overload
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 22:14:55 +00:00
Daniel Dunbar 0785570af3 Use EmitVAListRef instead of EmitLValue directly to handle array decay
case on x86_64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64333 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 22:25:55 +00:00
Daniel Dunbar 4e484b8134 Support va_arg on _Complex.
gcc compat test suite results (Darwin x86-32 & -64):
--
# of expected passes		1110
# of unexpected failures	74
# of unresolved testcases	168
# of unsupported tests		2


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 03:03:30 +00:00
Douglas Gregor 3498bdb9e9 Introduce a new expression node, ImplicitValueInitExpr, that
represents an implicit value-initialization of a subobject of a
particular type. This replaces the (ab)use of CXXZeroValueInitExpr
within initializer lists for the "holes" that occur due to the use of
C99 designated initializers.

The new test case is currently XFAIL'd, because CodeGen's
ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be
taught to value-initialize when it sees ImplicitValueInitExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63317 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 17:44:32 +00:00
Daniel Dunbar 56f0d16c11 Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63281 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 06:44:03 +00:00
Daniel Dunbar e12d8e3210 Comment fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 18:02:34 +00:00
Daniel Dunbar 9615ecb44f Normalize many BasicBlock names.
- Use dotted notation for blocks related to a particular statement
   type.
 - Use .end for landing pads.

No functionality change in NDEBUG mode. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59210 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 01:38:36 +00:00
Daniel Dunbar a448fb2da0 Rework IRgen invariant w.r.t. current insert point.
- EmitStmt is no longer required to finish with a current insertion
   point defined (i.e. it does not need to make dummy
   blocks). Instead, it can clear the insertion point in the builder
   which indicates that the current insertion point is unreachable.
 - CodeGenFunction provides HaveInsertPoint and EnsureInsertPoint
   which respectively test if there is an insert point and ensure an
   insertion point exists (by making a dummy block).
 - Clearly mark functions in CodeGenFunction which can be called with
   no insertion point defined. Currently this is a limited set, and
   EmitStmt simply EnsureInsertPoint()s before emitting subsequent IR.

Remove EmitDummyBlock, which is no longer needed. Clients who haven't
already cleared the insertion point (typically via EmitBranch) can do
so by hand.

Remove isDummyBlock, which has effectively been renamed to
HaveInsertPoint.

The main thrust of this change is that we no longer have create dummy
blocks just to destroy them a short time later in EmitBlock in the
common case that there is no unreachable code following something like
a goto. 

Additionally, this means that we are not using the hokey condition in
isDummyBlock that a block without a name is a dummy block. Guess how
well that works when we never emit block names!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59089 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 23:11:34 +00:00
Sebastian Redl 0518999d3a Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof expressions, both of values and types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59057 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 17:56:53 +00:00
Daniel Dunbar d57a871339 Add CodeGenFunction::EmitBranch.
- Emits an unconditional branch, with extra logic to avoid generating
   spurious branches out of dummy blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59037 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 09:41:28 +00:00
Daniel Dunbar 55e874299f Centralize basic block creation in CodeGenFunction::createBasicBlock.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59017 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 02:29:29 +00:00
Daniel Dunbar 45d196b838 Move IRBuilder type definition to common file.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58546 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-01 01:53:16 +00:00
Daniel Dunbar 7f8ea5c5b3 Add Objective-C property setter support.
- Change Obj-C runtime message API, drop the ObjCMessageExpr arg in
   favor of just result type and selector. Necessary so it can be
   reused in situations where we don't want to cons up an
   ObjCMessageExpr.
 - Update aggregate binary assignment to know about special property
   ref lvalues.
 - Add CodeGenFunction::EmitCallArg overload which takes an already
   emitted rvalue.

Add CodeGenFunction::StoreComplexIntoAddr.

Disabled logic in Sema for parsing Objective-C dot-syntax that
accesses methods. This code does not search in the correct order and
the AST node has no way of properly representing its results.

Updated StmtDumper to print a bit more information about
ObjCPropertyRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-30 05:35:15 +00:00
Argyrios Kyrtzidis 7267f7832e Add CodeGen support for CXXZeroInitValueExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55249 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 19:35:47 +00:00
Daniel Dunbar 488e993a13 Change WarnUnsupported to ErrorUnsupported (in name and in practice).
- We are beyond the point where this shows up often and when it does
   generating miscompiled files is bad.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 00:56:44 +00:00
Daniel Dunbar de7fb8413b More #include cleaning
- Remove internal uses of AST.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54628 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 05:00:27 +00:00
Chris Lattner 85e356825b update to make IRBuilder API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54548 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 19:57:58 +00:00
Chris Lattner 9619662a1d remove uses of QualType::getCanonicalType() from codegen for PR2189
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54107 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 22:37:01 +00:00
Ted Kremenek 5549976193 This patch is motivated by numerous strict-aliasing warnings when compiling
clang as a Release build.

The big change is that all AST nodes (subclasses of Stmt) whose children are
Expr* store their children as Stmt* or arrays of Stmt*. This is to remove
strict-aliasing warnings when using StmtIterator. None of the interfaces of any
of the classes have changed (except those with arg_iterators, see below), as the
accessor methods introduce the needed casts (via cast<>). While this extra
casting may seem cumbersome, it actually adds some important sanity checks
throughout the codebase, as clients using StmtIterator can potentially overwrite
children that are expected to be Expr* with Stmt* (that aren't Expr*). The casts
provide extra sanity checks that are operational in debug builds to catch
invariant violations such as these.

For classes that have arg_iterators (e.g., CallExpr), the definition of
arg_iterator has been replaced. Instead of it being Expr**, it is an actual
class (called ExprIterator) that wraps a Stmt**, and provides the necessary
operators for iteration. The nice thing about this class is that it also uses
cast<> to type-checking, which introduces extra sanity checks throughout the
codebase that are useful for debugging.

A few of the CodeGen functions that use arg_iterator (especially from
OverloadExpr) have been modified to take begin and end iterators instead of a
base Expr** and the number of arguments. This matches more with the abstraction
of iteration. This still needs to be cleaned up a little bit, as clients expect
that ExprIterator is a RandomAccessIterator (which we may or may not wish to
allow for efficiency of representation).

This is a fairly large patch. It passes the tests (except CodeGen/bitfield.c,
which was already broken) on both a Debug and Release build, but it should
obviously be reviewed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52378 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 02:43:46 +00:00
Eli Friedman c4777f1928 Add support for init lists for complex variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51080 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 23:11:35 +00:00
Chris Lattner 2c62a1aa39 use simplified API for making fp constants.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50623 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-04 18:23:51 +00:00
Chris Lattner 50b3674167 update to follow mainline llvm API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49607 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 07:32:11 +00:00
Chris Lattner 0442108783 Add support for C++ default arguments, and rework Parse-Sema
interaction for function parameters, fixing PR2046.

Patch by Doug Gregor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49369 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 04:40:51 +00:00