summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement codegen of aggregates as lvalues in binary expressions,Daniel Dunbar2008-09-041-0/+2
| | | | | | e.g. "(a = b).somefield". llvm-svn: 55758
* Stub out CodeGenFunction::EmitObjCForCollectionStmt.Anders Carlsson2008-08-301-0/+5
| | | | | | Add CodeGenFunction::EmitMemSetToZero and make AggExprEmitter::EmitAggregateClear use it. llvm-svn: 55573
* Add Objective-C property setter support.Daniel Dunbar2008-08-301-0/+18
| | | | | | | | | | | | | | | | | | | | | | - Change Obj-C runtime message API, drop the ObjCMessageExpr arg in favor of just result type and selector. Necessary so it can be reused in situations where we don't want to cons up an ObjCMessageExpr. - Update aggregate binary assignment to know about special property ref lvalues. - Add CodeGenFunction::EmitCallArg overload which takes an already emitted rvalue. Add CodeGenFunction::StoreComplexIntoAddr. Disabled logic in Sema for parsing Objective-C dot-syntax that accesses methods. This code does not search in the correct order and the AST node has no way of properly representing its results. Updated StmtDumper to print a bit more information about ObjCPropertyRefExprs. llvm-svn: 55561
* Refactor handling of calls:Daniel Dunbar2008-08-301-7/+6
| | | | | | | | | | | | | | | | - Added CodeGenFunction::EmitCall which just takes the callee, return type, and a list of (Value*,QualType) pairs. - Added CodeGenFunction::EmitCallArg which handles emitting code for a call argument and turning it into an appropriate (Value*,QualType) pair. - Changed Objective-C runtime interface so that the actual emission of arguments for message sends is (once again) done in the code to emit a message send. No intended functionality change, this is prep work for better ABI support and for Objective-C property setter support. llvm-svn: 55560
* Downgrade a number of FIXME asserts to ErrorUnsupported.Daniel Dunbar2008-08-291-1/+0
| | | | | | - Notably VLAs llvm-svn: 55544
* Add special "property reference" CodeGen::LValue type for emittingDaniel Dunbar2008-08-291-0/+4
| | | | | | | | Objective-C property references. - This handles property references "more correctly" but setters still don't work. llvm-svn: 55534
* Initial support for Obj-C dot-syntax for getters.Daniel Dunbar2008-08-271-0/+1
| | | | llvm-svn: 55410
* Objective-C @synthesize support.Daniel Dunbar2008-08-261-1/+13
| | | | | | | | | | | - Only supports simple assignment and atomic semantics are ignored. - Not quite usable yet because the methods do not actually get added to the class metadata. - Added ObjCPropertyDecl::getSetterKind (one of Assign, Copy, Retain). - Rearrange CodeGenFunction so synthesis can reuse function prolog / epilog code. llvm-svn: 55365
* Support __PRETTY_FUNCTION__ and friends in Obj-C methods.Daniel Dunbar2008-08-251-0/+6
| | | | | | | | | | | | Add CodeGenFunction::EmitUnsupportedLValue - Gives error and returns undef value. Swap some asserts() over to using EmitUnsupportedLValue - Rumor has it users (and even some developers) prefer carat diagnostics to backtraces. - Works better in Release-Asserts to boot. llvm-svn: 55328
* Implement Obj-C ivar references to aggregates.Daniel Dunbar2008-08-231-0/+2
| | | | | | | | | | | Implement Obj-C lvalue message sends (aggregate returns). Update several places to emit more precise ErrorUnsupported warnings for currently unimplemented Obj-C features (main missing chunks are property references, Obj-C exception handling, and the for ... in syntax). llvm-svn: 55234
* Trim CGObjCRuntime::GenerateMessageSend[Super]Daniel Dunbar2008-08-231-3/+10
| | | | | | | | | | | | | | | | | | - Returns an RValue. - Reduced to only taking the CodeGenFunction, Expr, and Receiver. - Becomes responsible for emitting the arguments. Add CodeGenFunction::EmitCallExprExt - Takes optional extra arguments to insert at the head of the call. - This allows the Obj-C runtimes to call into this and isolates the argument and call instruction generation code to one place. Upshot is that we now pass structures (more) correctly. Also, fix one aspect of generating methods which take structure arguments (for NeXT). This probably needs to be merged with the SetFunctionAttributes code in CodeGenModule.cpp llvm-svn: 55223
* Move [LR]Value into CGValue.hDaniel Dunbar2008-08-231-182/+2
| | | | | | - No (intended) functional change. llvm-svn: 55221
* Add preliminary (and probably broken) codegen support for C++ static ↵Anders Carlsson2008-08-221-0/+4
| | | | | | initializers. llvm-svn: 55180
* Move all Obj-C runtime interaction into CodeGenFunction.Daniel Dunbar2008-08-201-1/+1
| | | | | | | - Drop duplicate (and broken) code for sending messages. - Add EmitObjCProtocolExpr to CodeGenFunction. llvm-svn: 55024
* Add NeXT runtime support for generating methods.Daniel Dunbar2008-08-161-1/+5
| | | | | | | | | | | | | Change CodeGenFunction::EmitParmDecl to take either a ParmVarDecl or an ImplicitParamDecl. Drop hasAggregateLLVMType from CodeGenModule.cpp (use version in CodeGenFunction). Change the Objective-C method generation to use EmitParmDecl for implicit parameters. llvm-svn: 54838
* Change WarnUnsupported to ErrorUnsupported (in name and in practice).Daniel Dunbar2008-08-161-2/+2
| | | | | | | - We are beyond the point where this shows up often and when it does generating miscompiled files is bad. llvm-svn: 54836
* More #include cleaningDaniel Dunbar2008-08-111-1/+5
| | | | | | | | - Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h - Moved Sema::getCurMethodDecl() out of line (dependent on ObjCMethodDecl via dyn_cast). llvm-svn: 54629
* rename PreDefinedExpr -> PredefinedExprChris Lattner2008-08-101-1/+1
| | | | llvm-svn: 54605
* update to make IRBuilder API change.Chris Lattner2008-08-081-1/+1
| | | | llvm-svn: 54548
* Add CodeGen support for indirect goto.Daniel Dunbar2008-08-041-1/+24
| | | | | | | | | | - Follows emission scheme used by llvm-gcc, i.e. invent an id for each label whose address is taken and replace each indirect goto by a switch to each possible target. - Currently we emit a switch for each indirect goto instead of merging them as llvm-gcc does. llvm-svn: 54318
* Rework codegen emission of globalsDaniel Dunbar2008-07-291-2/+3
| | | | | | | | | | | | | | | | | | | | - No (intended) functionality change. - Primary purpose is to clearly separate (lazy) construction of globals that are a forward declaration or tentative definition from those that are the final definition. - Lazy construction is now encapsulated in GetAddrOf{Function,GlobalVar} while final definitions are constructed in EmitGlobal{Function,Var}Definition. - External interface for dealing with globals is now limited to EmitGlobal and GetAddrOf{Function,GlobalVar}. - Also updated helper functions dealing with statics, annotations, and ctors to be private. llvm-svn: 54179
* implement codegen support for labels at the end of stmtexprs.Chris Lattner2008-07-261-0/+1
| | | | llvm-svn: 54100
* Move comment to match styleNate Begeman2008-07-251-1/+2
| | | | llvm-svn: 54047
* "Support for Objective-C message sends which return structures. Also ↵Chris Lattner2008-06-241-0/+4
| | | | | | | | includes a small fix for constant string handling that should have been in the last patch (sorry!) and a hook for generating selectors (rest of this implementation to follow in the next patch)." Patch by David Chisnall! llvm-svn: 52681
* Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.Chris Lattner2008-06-171-2/+7
| | | | | | Patch by David Chisnall! llvm-svn: 52422
* This patch is motivated by numerous strict-aliasing warnings when compilingTed Kremenek2008-06-171-46/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 52378
* Basic support for volatile loads and stores. Stores the volatile Eli Friedman2008-06-131-7/+27
| | | | | | | | | | 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. llvm-svn: 52264
* Make CurFuncDecl more specific; I have some code I'm going to land in a Eli Friedman2008-05-221-1/+1
| | | | | | bit that wants to use CurFuncDecl as a FunctionDecl. llvm-svn: 51402
* Move getAccessedFieldNo out of lib/AST/Expr.cpp intoDan Gohman2008-05-221-0/+5
| | | | | | | | | lib/CodeGen/CGExpr.cpp and to change include/clang/AST/Attr.h to use its own enum for visibility types instead of using llvm::GlobalValue::VisibilityTypes. These changes eliminate dependencies in the AST library on LLVM's VMCore library. llvm-svn: 51398
* Add codegen support for block-level compound literals.Eli Friedman2008-05-131-0/+2
| | | | llvm-svn: 51081
* Extend vector member references to include {.hi, .lo, .e, .o} which return aNate Begeman2008-05-091-5/+9
| | | | | | | | | | | | | vector of the same element type and half the width, with the high, low, even, and odd elements respectively. Allow member references to member references, so that .hi.hi gives you the high quarter of a vector. This is fairly convenient syntax for some insert/extract operations. Remove some unnecessary methods/types in the ExtVectorElementExpr class. llvm-svn: 50892
* Add basic support for the pic-* target triples and add support forChris Lattner2008-05-081-0/+6
| | | | | | | | | targets that do not support recursion (and thus codegen stack variables as globals). Patch contributed by Alireza Moshtaghi! llvm-svn: 50844
* OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.Nate Begeman2008-04-181-13/+14
| | | | llvm-svn: 49942
* Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff2008-04-151-5/+5
| | | | | | | | VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl(). This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it). llvm-svn: 49748
* update to follow mainline llvm API change.Chris Lattner2008-04-131-2/+2
| | | | llvm-svn: 49607
* Codegen assignment to self correctly, patch by David Chisnall!Chris Lattner2008-04-041-1/+4
| | | | llvm-svn: 49201
* Add initial support for objc codegen for methods, ivars, and theChris Lattner2008-03-301-2/+7
| | | | | | etoile runtime, patch by David Chisnall! llvm-svn: 48969
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+486
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. llvm-svn: 48402
OpenPOWER on IntegriCloud