Commit Graph

1257 Commits

Author SHA1 Message Date
Daniel Dunbar d4f616b853 Move [LR]Value into CGValue.h
- No (intended) functional change.

llvm-svn: 55221
2008-08-23 03:10:25 +00:00
Chris Lattner 9e8c057ab7 add action to know about end of translation unit.
llvm-svn: 55218
2008-08-23 02:06:50 +00:00
Chris Lattner ce90ef51b9 we already have a handle on the 'in' keyword, don't bother getting two.
llvm-svn: 55217
2008-08-23 02:02:23 +00:00
Chris Lattner 2cc35ae286 minor cleanup, remove finalize method.
llvm-svn: 55216
2008-08-23 02:00:52 +00:00
Chris Lattner 2ebb178f8b Fix a FIXME by not creating an invalid AST on erroneous input. Also
make diagnostic output in some other malformed cases significantly
more useful.  This fixes PR2708

llvm-svn: 55215
2008-08-23 01:48:03 +00:00
Ted Kremenek 4e7713c04d Simplify interface to Store::AddDecl
llvm-svn: 55213
2008-08-23 00:50:55 +00:00
Daniel Dunbar 80a840bc70 NeXT: Emit property metadata (classes, protocols, categories).
llvm-svn: 55209
2008-08-23 00:19:03 +00:00
Anders Carlsson 8e82b7fd0f Use isa instead of dyn_cast.
llvm-svn: 55207
2008-08-22 22:10:48 +00:00
Argyrios Kyrtzidis a65490c5df Allow nested backtracks.
llvm-svn: 55204
2008-08-22 21:27:50 +00:00
Daniel Dunbar 938a77f4c9 NeXT: Emit category metadata.
llvm-svn: 55197
2008-08-22 20:34:54 +00:00
Anders Carlsson 87fc5a5e6b Add preliminary (and probably broken) codegen support for C++ static initializers.
llvm-svn: 55180
2008-08-22 16:00:37 +00:00
Argyrios Kyrtzidis 857fcc2f8e Add support for C++'s "type-specifier ( expression-list )" expression:
-The Parser calls a new "ActOnCXXTypeConstructExpr" action.
-Sema, depending on the type and expressions number:
   -If the type is a class, it will treat it as a class constructor. [TODO]
   -If there's only one expression (i.e. "int(0.5)" ), creates a new "CXXFunctionalCastExpr" Expr node
   -If there are no expressions (i.e "int()" ), creates a new "CXXZeroInitValueExpr" Expr node.

llvm-svn: 55177
2008-08-22 15:38:55 +00:00
Nico Weber ed9b4100a8 Move most of HeaderSearch initialization to libDriver.
For example, adding the default system include paths in clients is now as
simple as

  InitHeaderSearch init(headers);
  init.AddDefaultSystemIncludePaths(langopts);
  init.Realize();

llvm-svn: 55174
2008-08-22 09:25:22 +00:00
Anders Carlsson 41e0881b34 Initial sema support for C++ static initializers.
llvm-svn: 55166
2008-08-22 05:00:02 +00:00
Eli Friedman 3e62c21c49 Fix some issues with array type merging. (No visible difference,
because nothing uses the merged types yet.)

llvm-svn: 55161
2008-08-22 01:48:21 +00:00
Eli Friedman 777a6bb582 Minor const cleanup.
llvm-svn: 55160
2008-08-22 00:59:49 +00:00
Eli Friedman 47f7711e4b Rewrite type compatibility testing to do type merging rather than just
testing compatibility.  This is necessary for some constructs, like merging
redeclarations.

Also, there are some ObjC changes to make sure that 
typesAreCompatible(a,b) == typesAreCompatible(b,a).  I don't have any 
ObjC code beyond the testsuite, so please tell me if there are any cases 
where this doesn't behave as expected.

llvm-svn: 55158
2008-08-22 00:56:42 +00:00
Eli Friedman 24c0154b77 Initial implementation of floats in Expr::tryEvaluate; this doesn't
implement some things, like unary operators and casts, but it's enough
to fix PR2703 as filed.

llvm-svn: 55155
2008-08-22 00:06:13 +00:00
Zhongxing Xu 614f6a060d Modify comments.
llvm-svn: 55150
2008-08-21 23:00:21 +00:00
Zhongxing Xu d95495f601 Move the handling of DeclStmt from GRExprEngine to BasicStoreManager.
llvm-svn: 55144
2008-08-21 22:34:01 +00:00
Daniel Dunbar dec75f895e NeXT: Emit [meta]class protocol references.
Updated ObjCProtocolDecl::protocol_iterator to match that of
ObjCInterfaceDecl.

llvm-svn: 55143
2008-08-21 21:57:41 +00:00
Chris Lattner ea71438a93 add a simple check to warn people who type "=+" when they probably meant
"+=".

llvm-svn: 55131
2008-08-21 18:04:13 +00:00
Daniel Dunbar 22d82ed0e2 Preliminary support for Obj-C classes in NeXT runtime.
- Functional for simple cases but there are some glaring omissions
   (protocols, properties, and other language extensions).
 - The code needs a fair bit of cleaning.

llvm-svn: 55108
2008-08-21 04:36:09 +00:00
Eli Friedman 41d7e49e15 Remove duplicate define from Windows-x86 target.
llvm-svn: 55101
2008-08-21 01:56:54 +00:00
Eli Friedman c968a6ab8e Initial implementation of Windows x86 target; at the moment, the only
difference from generic x86 is the defines.  The rest is non-trivial to 
implement.

I'm not planning on adding any more targets myself; if there are any 
targets anyone is currently using that are missing, feel free to add 
them, or ask me to add them.

This concludes the work I'm planning for the TargetInfo 
implementations at the moment; all the other issues with TargetInfo require
some API changes, and I haven't really thought it through.  Some of the
remaining issues: allowing targets to define size_t and wchar_t properly,
adding some sort of __builtin_type_info intrinsic so we can finish clang's 
limits.h and float.h and get rid of a massive number of macro 
definitions, allowing target-specific command-line options, allowing
target-specific defaults for certain command-line options like
-fms-extensions, exposing vector alignment outside of the description 
string, exposing endianness outside of the description string, allowing 
targets to expose special bit-field layout requirements, exposing some 
sort of custom hook for call generation in CodeGen, and adding CPU 
selection to control defines like __SSE__.

llvm-svn: 55098
2008-08-21 01:40:19 +00:00
Eli Friedman ff594f24dd Add Linux x86-32 target.
llvm-svn: 55095
2008-08-21 00:24:02 +00:00
Eli Friedman 873f65afe8 First cut at OS detection, taking advantage of the new generic targets.
This approach allows adding OS-specific targets/defines/etc. without 
completely breaking unknown subtargets.  No new subtargets yet, although 
I plan to add x86-Linux soon.  Others can add targets that they use as 
needed; adding a new subtarget takes very little code.

Also does some fixups for description strings; a lot of them were 
unspecified.  I think all the ones I added are correct, but 
they're unverified; corrections are welcome.

llvm-svn: 55091
2008-08-21 00:13:15 +00:00
Eli Friedman b9e5bed4dd Class reorg for PPC; shouldn't be any visible changes unless I messed
up somehow.

This concludes the series of reorg patches for the target 
implementations.

llvm-svn: 55086
2008-08-20 23:11:40 +00:00
Eli Friedman 1be92d297a Fix a regression from my fix to PR2631. Fixes PR2692.
llvm-svn: 55083
2008-08-20 22:17:17 +00:00
Eli Friedman 002ad1274b Fix a minor crash-on-invalid.
llvm-svn: 55082
2008-08-20 22:07:34 +00:00
Daniel Dunbar 73a73f52fd Fix attributes on Obj-C interfaces & methods.
- Drop MethodAttrs parameter to ObjCMethodDecl
 - Call ProcessDeclAttributeList for interface & method decls.

llvm-svn: 55068
2008-08-20 18:02:42 +00:00
Ted Kremenek e5edbdd4ee Patch by Zhongxing Xu:
This patch moves some code in GRStateManager::RemoveDeadBindings() to EnvironmentManager::RemoveDeadBindings().

llvm-svn: 55064
2008-08-20 17:08:29 +00:00
Ted Kremenek eb38fde5e5 Patch by Zhongxing Xu: We should set back the modified ConstEq map.
llvm-svn: 55060
2008-08-20 16:59:15 +00:00
Eli Friedman f05b7728b3 Class reorg for ARM. Shouldn't be any visible changes.
llvm-svn: 55042
2008-08-20 07:44:10 +00:00
Eli Friedman da8f5a9bd8 Class hierarchy reorg for Sparc architecture. While I was there, I
cleaned it up a bit, including fixing the definition of va_list; this
shouldn't break anything, but anyone using Sparc should watch for 
regressions.

llvm-svn: 55041
2008-08-20 07:28:14 +00:00
Daniel Dunbar 94834d8883 Fix subtle bug introduced in r54852.
- UsualUnaryConversions takes an Expr *& and may modify its argument,
   this broke when it was refactored into Sema::CheckCastTypes. This
   meant that we were missing implicit casts in some places.
 - Seems pretty sad that this got through our tests.

llvm-svn: 55039
2008-08-20 03:55:42 +00:00
Ted Kremenek 821159e352 Re-enable deletion of AST nodes upon completion of ParseAST.
llvm-svn: 55038
2008-08-20 03:27:00 +00:00
Ted Kremenek 0e857200bb Added ObjCAtDefsFieldDecl to represent FieldDecls created by @defs.
This fixes an ownership issue where FieldDecls could be owned both by an ObjCInterfaceDecl and a RecordDecl.

llvm-svn: 55037
2008-08-20 03:26:33 +00:00
Eli Friedman 3fd920afce Reorganize the class hierarchy for x86 targets; shouldn't have any
visible effects, but this will significantly reduce the amount of 
boilerplate code necessary to add subtargets.

If this looks okay, I'll do the rest of the processors (PPC, Sparc, ARM) 
soon.

llvm-svn: 55036
2008-08-20 02:34:37 +00:00
Daniel Dunbar 66912a1a6d Move all Obj-C runtime interaction into CodeGenFunction.
- Drop duplicate (and broken) code for sending messages.
 - Add EmitObjCProtocolExpr to CodeGenFunction.

llvm-svn: 55024
2008-08-20 00:28:19 +00:00
Ted Kremenek 19edd216f2 Move store pretty-printing logic inside of StoreManager (previously in GRState).
llvm-svn: 55013
2008-08-19 22:24:03 +00:00
Ted Kremenek 67102b281e Patch by Zhongxing Xu!
This patch extends BasicStoreManager::getInitialStore() to include code that symbolicates input variables.
It also removes redundant handling of ImplicitParamDecl, since it is a subclass of VarDecl.

llvm-svn: 54993
2008-08-19 16:51:45 +00:00
Argyrios Kyrtzidis 3bab3d21f9 Add ExplicitCastExpr to replace the current CastExpr, and have ImplicitCastExpr and ExplicitCastExpr derive from a common base class (CastExpr):
Expr
  -> CastExpr
     -> ExplicitCastExpr
     -> ImplicitCastExpr 

llvm-svn: 54955
2008-08-18 23:01:59 +00:00
Chris Lattner e5d812af59 warn when someone tries to make an array of ObjC interfaces instead of array
of pointers to them.  rdar://4304469

llvm-svn: 54953
2008-08-18 22:49:54 +00:00
Argyrios Kyrtzidis 22fc2665e6 "Remove the 'else' since the code is fallthrough after it." - suggestion by Chris.
llvm-svn: 54952
2008-08-18 22:49:40 +00:00
Daniel Dunbar aa64b7e0a8 Support initialization of incomplete array with zero size (as
extension).

llvm-svn: 54946
2008-08-18 20:28:46 +00:00
Chris Lattner 22361bf422 Fix PR2627, support for Q constraint.
llvm-svn: 54943
2008-08-18 20:05:00 +00:00
Chris Lattner 496acc1815 Several cleanups and tweaks to diagnostics in Sema::ActOnAsmStmt,
no other functionality change.

llvm-svn: 54941
2008-08-18 19:55:17 +00:00
Sanjiv Gupta 14f18f3f91 Allow targets to override description string.
llvm-svn: 54914
2008-08-18 10:05:22 +00:00
Chris Lattner 5d1cfa1229 various updates to match r54873 on mainline.
llvm-svn: 54874
2008-08-17 07:19:51 +00:00