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

30 Коммитов

Автор SHA1 Сообщение Дата
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 acc5f3e423 More #include cleaning
- Kill unnecessary #includes in .cpp files. This is an automatic
   sweep so some things removed are actually used, but happen to be
   included by a previous header. I tried to get rid of the obvious
   examples and this was the easiest way to trim the #includes in one
   fell swoop.
 - We now return to regularly scheduled development.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54632 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 06:23:49 +00:00
Daniel Dunbar c4a1dea2dc More #include cleaning
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
 - Moved Sema::getCurMethodDecl() out of line (dependent on
   ObjCMethodDecl via dyn_cast).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 05:35:13 +00:00
Mon P Wang c500451648 Updated to match new atomic names (to enable overloading for pointers to
different address spaces) for llvm r54195.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54241 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-31 03:28:23 +00:00
Nate Begeman abfaf9984e X86 builtin fixes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54049 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 20:17:24 +00:00
Chris Lattner 9a847f598c don't depend on the result of CreateNeg to be a binop
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53948 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-23 06:53:34 +00:00
Daniel Dunbar 1caae95901 Implement bzero, memset, memmove builtins.
This subsumes Nico Weber's patch and implements bzero in terms
of llvm.memset to match llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53888 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 00:26:45 +00:00
Daniel Dunbar 4493f79fce Implement nans, prefetch, and trap builtins.
This closes <rdar://problem/6080720>, support for __builtin_constant_p
has been filed separately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 22:59:13 +00:00
Daniel Dunbar 14ecaefc28 Kill an unused variable warning
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 21:43:28 +00:00
Daniel Dunbar a933c3c052 Add __builtin_powi[fl] support
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53866 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 18:44:41 +00:00
Daniel Dunbar 04b290030e Implement ffs, parity, and popcount builtins.
+ test case


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 17:19:41 +00:00
Mon P Wang 6c5df7f54f Add support shufpd
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53747 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 00:14:09 +00:00
Chris Lattner 6a705f0443 Codegen support for __builtin_stdarg_start
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53329 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 17:28:44 +00:00
Chris Lattner b7cfe88e88 Make a few related changes:
1) add a new ASTContext::getFloatTypeSemantics method.
2) Use it from SemaExpr.cpp, CodeGenTypes.cpp and other places.
3) Change the TargetInfo.h get*Format methods to return their 
   fltSemantics byref instead of by pointer.
4) Change CodeGenFunction::EmitBuiltinExpr to allow builtins which
   sometimes expand specially and othertimes fall back to libm.
5) Add support for __builtin_nan("") to codegen, cases that don't pass
   in an empty string are currently lowered to libm calls.
6) Fix codegen of __builtin_infl.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52914 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 18:32:54 +00:00
Mon P Wang 09b6bf5bfa Updated atomic intrinsic name from llvm r52706. Fixed dropped bit in shufps.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52707 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-25 08:21:36 +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
Chris Lattner 9e800e3dd8 force size of alloca to i32, which is currently required by LLVM IR.
This fixes use of alloca on 64-bit systems.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 17:15:14 +00:00
Eli Friedman 1e692ace08 Basic support for volatile loads and stores. Stores the volatile
qualifier in the lvalue, and changes lvalue loads/stores to honor 
the volatile flag.  Places which need some further attention are marked 
with FIXMEs.

Patch by Cédric Venet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52264 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-13 23:01:12 +00:00
Eli Friedman f4e8533405 Implementation of __builtin_ctlz.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51595 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 15:32:46 +00:00
Eli Friedman 256f77e431 Add codegen support for stack address intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51309 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 08:59:34 +00:00
Eli Friedman d4b32e4651 Implement CodeGen for __builtin_memcpy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51282 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 23:27:48 +00:00
Nate Begeman 2451250131 Fix some prototypes, and implement some builtins until we have our header files completed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51199 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16 18:59:42 +00:00
Nate Begeman 7ea2e3f6aa Handle a couple missing builtins that will go away eventually when the various
intrin.h files are finished


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 07:38:03 +00:00
Mon P Wang 1ffe281890 Added support to generate some atomic operators (add, sub, and, or etc..)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50919 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 22:40:52 +00:00
Chris Lattner 3eae03e7d1 simplify some builder calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50694 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 00:56:42 +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
Nate Begeman e7722103ab Enable clang to codegen emmintrin.h until we have our own emmintrin.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49633 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 04:49:57 +00:00
Torok Edwin 730f2c13e8 fix build error: add missing braces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49209 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 06:16:25 +00:00
Nate Begeman dbebb73b86 Teach clang how to codegen punpcklbw and punpcklwd
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49186 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 19:58:06 +00:00
Chris Lattner bda0b626e7 Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it.  This follows the main
llvm tree, and allows the libraries to be built in parallel.  The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in.  This speeds
up parallel builds, particularly incremental ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15 23:59:48 +00:00