Devang Patel
2c30d8fee8
Recognize while(1) and avoid extra blocks.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42811 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 20:51:27 +00:00
Devang Patel
05f6e6bb3a
Recognize "do {} while (0)" idiom and avoid extra basic blocks.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42808 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 20:33:39 +00:00
Devang Patel
50c9034ea9
Use LLVMFoldingBuilder
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42807 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 19:49:58 +00:00
Devang Patel
00ee4e4ddc
Use const& for RHS.
...
Use copy for LHS, because it is incremented using ++ operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42792 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:10:59 +00:00
Devang Patel
80fd5f96e6
Fix comment. Describe what it is, instead of how it is used.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42791 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:08:50 +00:00
Fariborz Jahanian
e37882ad33
Added a new class for Interfaces qualified by protocol list.
...
Protocols are now sorted and made unique in the list.
Enhanced pretty printer for @interface (So, I can see the protocol list).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 23:06:41 +00:00
Chris Lattner
aa9fc46c6a
Rename FileVariable -> FileVar for consistency with its class name,
...
likewise block and param. Reorder the layout of the Decl kind enum
so that the inheritance tree is reflected in the ordering. This allows
trivial range comparisons to determine whether something is an instance
of some abstract class, making classof faster.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42772 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 21:37:32 +00:00
Devang Patel
c049e4f406
Code gen case statement ranges.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42766 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 20:57:48 +00:00
Chris Lattner
c7229c338c
move IdentifierTable.h from liblex to libbasic.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42730 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 08:58:51 +00:00
Devang Patel
2d79d0f3ac
Support case statement ranges.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42648 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 20:54:07 +00:00
Devang Patel
51b09f2c52
switch statement code gen.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42616 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 23:45:31 +00:00
Devang Patel
d9363c3a80
Do not codegen dummy block.
...
Dummy block is an empty block with no predecessors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42451 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 21:49:18 +00:00
Chris Lattner
c9bec4bfea
further apfloat'ize the front-end, allowing codegen to pass
...
APFloat straight through to LLVM now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42236 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-22 18:47:25 +00:00
Chris Lattner
b1776cb8d3
fix some warnings, patch by Justin Handville
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42010 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-16 19:23:47 +00:00
Steve Naroff
9474504790
Move Decl::NextDeclarator (w/ setters/getters) down to ScopedDecl/FieldDecl.
...
Decl is now svelte:-)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41935 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13 23:52:58 +00:00
Steve Naroff
8e74c93dda
Phase 2 of making the Decl class more lightweight...
...
Move Identifier/Loc instance variables (and associated getters/setters) down from Decl to ScopedDecl/FieldDecl.
Objc AST's can now inherit from Decl without getting instance variables and types that are C specific. For now, I am keeping NextDeclarator, since I believe it may be useful to ObjC. If not, it can be moved later.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41934 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13 21:41:19 +00:00
Chris Lattner
ca2617c0e1
update to match llvm mainline api
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41926 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13 06:19:18 +00:00
Chris Lattner
191396c96d
adjust to a change in the LLVM APIs, this is still very hackish until
...
the front-end adopts APFloat though. This fixes test/CodeGen/mandel.c
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41908 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13 01:26:11 +00:00
Chris Lattner
419ea7ec6a
When dumping out errors about unsupported stuff, emit loc info.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41907 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13 01:17:29 +00:00
Hartmut Kaiser
124dd7b577
Fixed compilation on Windows.
...
Silenced a couple of warnings.
Added *.vcproj file for new clangAnalysis library.
Renamed Basic to clangBasic projects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41767 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-07 14:34:20 +00:00
Ted Kremenek
d6278899cf
Updated calls to CreateGEP to new interface in LLVM mainline.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41704 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-04 17:20:08 +00:00
Chris Lattner
47f7dbf7c0
eliminate some VC++ warnings, patch contributed by Hartmut Kaiser
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41692 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-04 02:34:27 +00:00
Chris Lattner
b2d963f527
add stmtexpr support for aggregates
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41662 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-31 22:54:14 +00:00
Chris Lattner
7e20d098a8
add support for complex stmtexpr's
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41661 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-31 22:51:38 +00:00
Chris Lattner
9b65551d0b
Generalize RValue to handle complex better, generalize EmitCompoundStmt to
...
support any sort of expr, add a new EmitAnyExpr routine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41660 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-31 22:49:20 +00:00
Chris Lattner
3379320c10
implement code generation for scalar stmt expressions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41656 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-31 22:09:40 +00:00
Chris Lattner
c5e940fa55
Implement codegen support for lowering "library builtins" like __builtin_isinf
...
to their corresponding library routines (e.g. isinf). This allows us to handle
all the stuff in macos math.h, and other stuff as it's added to *Builtins.def.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41634 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-31 04:44:06 +00:00
Chris Lattner
bef20ac367
add the ability to get the llvm function corresponding to a library builtin.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41633 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-31 04:31:45 +00:00
Steve Naroff
fb22d96692
Fix the following redefinition errors submitted by Keith Bauer...
...
[dylan:~/llvm/tools/clang] admin% cat tentative_decls.c
// incorrectly generates redefinition error
extern int array[3];
int array[3];
// incorrectly generates a redefinition error
extern void nup(int a[3]);
void nup(int a[3]) {}
It turns out that this exposed a fairly major flaw in the type system,
array types were never getting uniqued! This is because all array types
contained an expression, which aren't unique.
To solve this, we now have 2 array types, ConstantArrayType and
VariableArrayType. ConstantArrayType's are unique, VAT's aren't.
This is a fairly extensive set of fundamental changes. Fortunately,
all the tests pass. Nevertheless, there may be some collateral damage:-)
If so, let me know!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41592 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-30 01:06:46 +00:00
Chris Lattner
1d40060a37
remove some ugly code now that implicit defs are being generated in this case, thanks Steve!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41560 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-29 06:38:44 +00:00
Chris Lattner
e00b18cfc3
Change EnumDecl to store its corresponding integer type
...
directly in it. Remove TargetInfo::getEnumPolicy, as there is only
one policy that we support right now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41548 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-28 18:24:31 +00:00
Chris Lattner
314e7839e4
teach codegen to lay out enum types.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41501 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-27 17:44:34 +00:00
Chris Lattner
bfc0c1ae4b
move EmitAggregateCopy into AggExprEmitter
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41472 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 23:13:56 +00:00
Chris Lattner
d8d1936798
remove dead code
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41470 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 23:02:57 +00:00
Chris Lattner
0e7d53c3fb
remove dead protos
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41469 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 23:01:23 +00:00
Chris Lattner
1e4d21ea58
eliminate EmitAnyExpr, inlining it and simplifying it into its only caller.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41468 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 22:58:05 +00:00
Chris Lattner
660ac12137
eliminate use of EmitAnyExpr.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41467 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 22:55:13 +00:00
Chris Lattner
6b5d0bf42f
implement a fixme
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41466 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 22:47:40 +00:00
Chris Lattner
04dc76496e
Implement compound assignment operators whose LHS is scalar but RHS is complex.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41464 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 22:37:40 +00:00
Chris Lattner
ab340c22fe
implement codegen of compound assignment operators for complex.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41463 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 22:09:01 +00:00
Chris Lattner
3ccf774256
compound assignment operators are of type CompoundAssignOperator
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41460 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 21:41:21 +00:00
Chris Lattner
612c40c214
update fixme's
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41458 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 21:27:07 +00:00
Chris Lattner
3219c5d2d9
implement complex division
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41457 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 21:24:19 +00:00
Chris Lattner
3420d0de2c
fix a typo noticed by Gordon Henriksen
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41451 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 17:25:57 +00:00
Chris Lattner
abe471bb29
llvmgcc is right :)
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41450 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:54:05 +00:00
Chris Lattner
a3e7bfbb9f
compound assignmetns work for scalars.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41449 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:52:57 +00:00
Chris Lattner
ed70f0a536
implement conversions of complex to bool.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41448 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:52:28 +00:00
Chris Lattner
9069fa2244
remove ConvertScalarValueToBool.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41447 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:46:58 +00:00
Chris Lattner
9abc84e7ac
reimplement ConvertScalarValueToBool in CGExprScalar.cpp
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41446 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:42:57 +00:00
Chris Lattner
4f1a7b3808
refactor some code to expose compex->scalar conversion to CGF
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41445 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:34:22 +00:00