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

33 Коммитов

Автор SHA1 Сообщение Дата
John McCall 8d3d6c9355 Ensure an insertion point at the end of a statement-expression.
Fixes PR8967.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123360 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-13 02:03:06 +00:00
John McCall fd569004b7 Silly special case: never load when dereferencing void*.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120905 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 12:43:24 +00:00
John McCall 85515d64c1 First pass at implementing the intent of ANSI C DR106.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 12:29:11 +00:00
Daniel Dunbar f52697a589 Improve test coverage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 02:46:28 +00:00
Daniel Dunbar 986b5d156d tests: Fix test to not depend on instruction names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 18:34:40 +00:00
Chris Lattner ce88d0f015 tweak test to pass on windows
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-28 18:29:14 +00:00
Chris Lattner 4ac0d83090 Fix UnitTests/2004-02-02-NegativeZero.c, which regressed when
I broke negate of FP values.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-28 17:12:37 +00:00
Chris Lattner f70d857cbd merge two tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-27 01:08:03 +00:00
Chris Lattner 9269d5c05b Implement rdar://7530813 - collapse multiple GEP instructions in IRgen
This avoids generating two gep's for common array operations.  Before
we would generate something like:

  %tmp = load i32* %X.addr                        ; <i32> [#uses=1]
  %arraydecay = getelementptr inbounds [100 x i32]* %A, i32 0, i32 0 ; <i32*> [#uses=1]
  %arrayidx = getelementptr inbounds i32* %arraydecay, i32 %tmp ; <i32*> [#uses=1]
  %tmp1 = load i32* %arrayidx                     ; <i32> [#uses=1]

Now we generate:

  %tmp = load i32* %X.addr                        ; <i32> [#uses=1]
  %arrayidx = getelementptr inbounds [100 x i32]* %A, i32 0, i32 %tmp ; <i32*> [#uses=1]
  %tmp1 = load i32* %arrayidx                     ; <i32> [#uses=1]

Less IR is better at -O0.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106966 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-26 23:03:20 +00:00
Chris Lattner a4d71455f0 Implement support for -fwrapv, rdar://7221421
As part of this, pull together trapv handling into the same enum.

This also add support for NSW multiplies.

This also makes PCH disagreement on overflow behavior silent, since it
really doesn't matter except for warnings and codegen (no macros get 
defined etc).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-26 21:25:03 +00:00
Chris Lattner e70ffd6311 implement rdar://7432000 - signed negate should codegen as NSW.
While I'm in there, adjust pointer to member adjustments as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-26 20:27:24 +00:00
Daniel Dunbar a5728872c7 Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 20:14:24 +00:00
Chris Lattner c08582ba5e add 'F' to a bunch of libm builtins so that codegen doesn't die on them,
pointed out by Charles Davis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 02:09:14 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Mike Stump c36541e7bf Prep for new warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76638 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 20:52:43 +00:00
Chris Lattner 7a574ccd52 implement l-value codegen of comma expr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 21:28:12 +00:00
Chris Lattner 654599454c fix PR4067: [Linux kernel] cannot aggregate codegen stmtexpr as lvalue
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-25 19:35:26 +00:00
Chris Lattner f0a990c2aa fix PR4026: Clang can't codegen __func__ without implicit cast
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69747 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 23:00:09 +00:00
Daniel Dunbar 9034558f2f Support member reference on ?: of struct type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67603 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24 02:38:23 +00:00
Daniel Dunbar d7d5f0223b Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24 02:24:46 +00:00
Chris Lattner 40f929242a fix the more complex cases by actually codegen'ing the right expr :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67219 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18 18:30:44 +00:00
Chris Lattner 75dfedaf70 add codegen support for casting an element to a union.
There are some more complex cases (_Complex and structs)
that I'm still working on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67218 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18 18:28:57 +00:00
Chris Lattner 8cc9d08eb8 fix PR3809, codegen for inc/dec of function pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18 04:25:13 +00:00
Chris Lattner c3953a61f7 teach codegen to handle noop casts as lvalues.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18 04:02:57 +00:00
Chris Lattner e5ed15195b finish off codegen support for sub of pointer to functions,
finishing off rdar://6520707


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64295 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 07:21:43 +00:00
Nuno Lopes a468d34bed fix folding of '*doubleArray'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59647 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 17:44:31 +00:00
Nuno Lopes f9ef0c675b fix folding of comma if given a non-constant operand.
Eli please take a look, as I'm not sure if this gets the extension warning in the right place

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59422 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 20:09:07 +00:00
Chris Lattner 3cc5e5b526 Fix a bug where we didn't promote 'const float' (or typedefs) to
double in some places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52846 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 22:48:56 +00:00
Chris Lattner a269ebfd91 implement codegen support for sizeof(void), fixing PR2080.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 05:45:29 +00:00
Chris Lattner 6860f3cef7 Fix PR1921 by promoting negative indices to intptrty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46599 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 04:12:50 +00:00
Chris Lattner 01e3c9e06d fix a problem reported by Eli, caused by not keeping bool as i1
when in a register.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46552 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30 07:01:17 +00:00
Chris Lattner 8f925280ab Fix a crash reported by Seo Sanghyeon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45530 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03 06:36:51 +00:00
Chris Lattner efdd1574e3 Fix PR1895: a crash on an ugly gcc extension.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45505 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-02 21:54:09 +00:00