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

182 Коммитов

Автор SHA1 Сообщение Дата
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
Anders Carlsson 7c50aca2fe Add code generation and sema checking for __builtin_va_arg.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43006 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 20:28:48 +00:00
Anders Carlsson 23af9f2128 Fix an incorrect assertion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42951 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 05:52:34 +00:00
Anders Carlsson 793680ed81 Generate code for va_start and va_end.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42939 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 23:56:29 +00:00
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