Anders Carlsson
0c67829763
Put constant CFStrings in the __DATA,__cfstring section.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43593 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 00:41:52 +00:00
Anders Carlsson
d6a275f9a2
Stub out codegen for __builtin_constant_p. Remove any implicit cast exprs in the call to __builtin___CFStringMakeConstantString.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43592 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 00:39:26 +00:00
Devang Patel
c2527d1664
Remove unnecessary method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43591 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 00:11:37 +00:00
Devang Patel
f9fef92564
start adding pading fields.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43590 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 00:07:12 +00:00
Anders Carlsson
50b5a30db4
Fix a typo that prevented pointer-to-int conversions from working.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43588 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 23:18:02 +00:00
Devang Patel
0bd41f2cea
Refactor code into a separate method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43587 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 23:17:19 +00:00
Anders Carlsson
148fe67727
Handle function calls that return aggregate expressions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43581 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 22:04:46 +00:00
Devang Patel
9e124d96ab
Check whether next slot meets field type's alignment requirements.
...
If it does not then assert at the moment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43576 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 21:01:37 +00:00
Devang Patel
d9e9ede6b1
Keep track of field offsets during structure layout.
...
Take 2.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43573 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 20:08:22 +00:00
Devang Patel
7a4718e813
Take 2.
...
Make target info available to clang code generator. This is far from complete but this helps clang codegen module make progress.
At the moment target triplet and target description strings are hard coded in clang::TargetInfo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43572 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 20:01:01 +00:00
Devang Patel
61bb9cac04
Initialize MemCpyFn
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43569 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 19:54:57 +00:00
Chris Lattner
e03cd7b7c8
temporarily revert devang's patch to link in the llvm codegen etc.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43544 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 04:53:03 +00:00
Devang Patel
8967e9e6c3
Keep track of field offsets during structure layout.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43539 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 01:23:10 +00:00
Devang Patel
f767e218ee
Make target info available to clang code generator.
...
This is far from complete but this helps clang codegen module
make progress.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43536 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 00:59:29 +00:00
Devang Patel
47c87b4b16
Avoid unnecessary PATypeHolder copy.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43530 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 23:22:14 +00:00
Chris Lattner
7da36f642e
__real__ and __imag__ can be lvalues. Add support to ast and codegen for them.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43525 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 22:53:42 +00:00
Devang Patel
9e32d4b4a7
Refactor code into a separate method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43519 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 21:27:20 +00:00
Devang Patel
e9b8c0a385
Fix 80 col violations.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43516 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 20:59:40 +00:00
Devang Patel
0ffe89ab1e
Use
...
+ llvm::DenseMap<Type *, llvm::PATypeHolder> TypeHolderMap;
instead of
- llvm::DenseMap<Type *, llvm::PATypeHolder *> TypeHolderMap;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43514 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 20:46:47 +00:00
Devang Patel
03f7c03ecf
Remove commented out line.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43508 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 18:31:12 +00:00
Devang Patel
86522b9e84
Add RecordOrganizer::layoutUnionFields()
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43472 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 20:50:19 +00:00
Devang Patel
6cb812e186
Insetead of assert() just emit an error message for
...
an unimplemented work and continue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43449 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 16:56:27 +00:00
Anders Carlsson
85f9bceab1
Add (partial) support for @encode.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43439 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 05:01:08 +00:00
Anders Carlsson
89799cf254
Generate code for __builtin_classify_type.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43429 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 02:59:40 +00:00
Devang Patel
abad06cfd0
Codegen union member references.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43390 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 19:42:18 +00:00
Devang Patel
0a96118bb8
Handle non LValue base expressions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43387 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 18:15:21 +00:00
Devang Patel
e40daa4e84
Code gen static initializer.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43386 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 17:50:58 +00:00
Devang Patel
636c3d0467
Codegen array initializers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43385 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 17:44:44 +00:00
Devang Patel
8e53e720b3
Codegen global array initializers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43383 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 16:31:40 +00:00
Devang Patel
f86206ffbf
Fix "strbuf += stufflen;" crash.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43365 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 22:19:13 +00:00
Devang Patel
5825ac2950
Document ConvertNewType() method and make it a private method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43363 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 21:40:12 +00:00
Devang Patel
30ec9972be
Cache llvm::Type through PATypeHolder.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43355 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 18:32:36 +00:00
Chris Lattner
27437caade
Add a new ChooseExpr::isConditionTrue method to unify
...
some code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43322 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 00:29:32 +00:00
Devang Patel
c5d3d72bac
Remove unused #includes
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43317 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 23:42:18 +00:00
Devang Patel
126a856ecd
Handle
...
foo()->a = 42;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43315 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 22:26:28 +00:00
Devang Patel
057afddf0f
Move RecordOrganizer into CodeGenTypes.cpp
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43310 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 20:38:06 +00:00
Devang Patel
a83cc33195
Handle non-constant initializers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43301 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 18:05:48 +00:00
Devang Patel
35634f5ed6
Visit CompoundLiteralExpr and InitListExpr
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43300 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 17:18:43 +00:00
Devang Patel
c4c429a1a5
Constify methods and reuse RecordOrganizer object.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43284 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:56:23 +00:00
Devang Patel
0e63f6b436
check base type.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43283 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:54:17 +00:00
Devang Patel
71bcb09b8f
Add notes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43282 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:32:16 +00:00
Devang Patel
977f14e1ab
Use isUnionType() predicate.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43281 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:28:49 +00:00
Devang Patel
655bf3df1f
untabify
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43280 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:26:24 +00:00
Hartmut Kaiser
21fdf41672
Fixed a strange construct, please review.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43278 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:07:36 +00:00
Devang Patel
b1e3989731
Handle nested structs.
...
typdef struct A { int i; struct A *next; } A
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43268 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 23:26:46 +00:00
Devang Patel
b9b00ad626
Handle simple struct member expr.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43258 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 20:28:39 +00:00
Devang Patel
b84a06e68f
Begin struct layout work.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43236 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 02:10:49 +00:00
Hartmut Kaiser
7b66000bdf
Updated VC++ build system.
...
Silenced some VC++ warnings.
Had to rephrase a partial specialization of the IntrospectionTrait struct in SerializationTest.cpp, please review.
Added a compiler specific workaround in IdentifierTable.h. Is that the way to fix this kind of issues?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43074 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 15:00:17 +00:00
Anders Carlsson
1a86b33c18
Generate code for static variables that don't have initializers. Also, report an error if a static initializer is not constant.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43058 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 00:52:43 +00:00
Steve Naroff
ec0550fa36
Move type compatibility predicates from Type to ASTContext. In addition, the predicates are now instance methods (they were previously static class methods on Type).
...
This allowed me to fix the following hack from this weekend...
// FIXME: Devise a way to do this without using strcmp.
// Would like to say..."return getAsStructureType() == IdStructType;", but
// we don't have a pointer to ASTContext.
bool Type::isObjcIdType() const {
if (const RecordType *RT = getAsStructureType())
return !strcmp(RT->getDecl()->getName(), "objc_object");
return false;
}
...which is now...
bool isObjcIdType(QualType T) const {
return T->getAsStructureType() == IdStructType;
}
Side notes:
- I had to remove a convenience function from the TypesCompatibleExpr class.
int typesAreCompatible() const {return Type::typesAreCompatible(Type1,Type2);}
Which required a couple clients get a little more verbose...
- Result = TCE->typesAreCompatible();
+ Result = Ctx.typesAreCompatible(TCE->getArgType1(), TCE->getArgType2());
Overall, I think this change also makes sense for a couple reasons...
1) Since ASTContext vends types, it makes sense for the type compatibility API to be there.
2) This allows the type compatibility predeciates to refer to data not strictly present in the AST (which I have found problematic on several occasions).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43009 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 20:41:53 +00:00