summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprAgg.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Support CodeGen for __extension__ operator on aggregates.Eli Friedman2009-01-271-0/+1
| | | | llvm-svn: 63101
* Rename Expr::isConstantExpr to Expr::isConstantInitializer; this more Eli Friedman2009-01-251-1/+1
| | | | | | | | accurately states what the function is trying to do and how it is different from Expr::isEvaluatable. Also get rid of a parameter that is both unused and inaccurate. llvm-svn: 62951
* add codegen support to union castsNuno Lopes2009-01-151-1/+14
| | | | | | init of static vars still not working. I'll get back to it tomorrow or so llvm-svn: 62278
* Prevent a segfault for vaarg expressions on unsupported architectures.Sebastian Redl2009-01-091-2/+4
| | | | llvm-svn: 62008
* Unifies the name-lookup mechanisms used in various parts of the ASTDouglas Gregor2008-12-111-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and separates lexical name lookup from qualified name lookup. In particular: * Make DeclContext the central data structure for storing and looking up declarations within existing declarations, e.g., members of structs/unions/classes, enumerators in C++0x enums, members of C++ namespaces, and (later) members of Objective-C interfaces/implementations. DeclContext uses a lazily-constructed data structure optimized for fast lookup (array for small contexts, hash table for larger contexts). * Implement C++ qualified name lookup in terms of lookup into DeclContext. * Implement C++ unqualified name lookup in terms of qualified+unqualified name lookup (since unqualified lookup is not purely lexical in C++!) * Limit the use of the chains of declarations stored in IdentifierInfo to those names declared lexically. * Eliminate CXXFieldDecl, collapsing its behavior into FieldDecl. (FieldDecl is now a ScopedDecl). * Make RecordDecl into a DeclContext and eliminates its Members/NumMembers fields (since one can just iterate through the DeclContext to get the fields). llvm-svn: 60878
* Disabling this code due to regression on test/CodeGen/bitfield.c. See Eli Friedman2008-12-021-1/+5
| | | | | | PR3152. llvm-svn: 60389
* Fix for PR2969: generate a memcpy from a constant for constant Eli Friedman2008-11-301-8/+17
| | | | | | | | initializers. llvm-gcc appears to be more aggressive, but incorrect, for constructs like "const int a[] = {1,2,3};"; that said, current optimizers will do the appropriate optimizations when safe. llvm-svn: 60270
* Implemented ir-gen for 'implicit' properties using the new AST nodes.Fariborz Jahanian2008-11-221-0/+9
| | | | llvm-svn: 59886
* New AST node to access "implicit" setter/getter using property dor syntax.Fariborz Jahanian2008-11-221-0/+13
| | | | | | | Issuing diagnostics when assigning to read-only properties. This is work in progress. llvm-svn: 59874
* reapply the (corrected) patch to use the new llvm intrinsics for ↵Chris Lattner2008-11-211-2/+4
| | | | | | memcpy/memmove etc. llvm-svn: 59824
* temporarily revert Sangiv's patch.Chris Lattner2008-11-211-1/+1
| | | | llvm-svn: 59821
* mem[cpy,set,move] intrinsics are now overloaded.Sanjiv Gupta2008-11-211-1/+1
| | | | llvm-svn: 59806
* Normalize many BasicBlock names.Daniel Dunbar2008-11-131-3/+3
| | | | | | | | | | - Use dotted notation for blocks related to a particular statement type. - Use .end for landing pads. No functionality change in NDEBUG mode. :) llvm-svn: 59210
* Add CodeGenFunction::EmitBranch.Daniel Dunbar2008-11-111-4/+2
| | | | | | | - Emits an unconditional branch, with extra logic to avoid generating spurious branches out of dummy blocks. llvm-svn: 59037
* Centralize basic block creation in CodeGenFunction::createBasicBlock.Daniel Dunbar2008-11-111-3/+3
| | | | | | - No functionality change. llvm-svn: 59017
* Implement lowering of va_arg in clang directly. (This is 32-bit X86 only for ↵Anders Carlsson2008-11-041-2/+6
| | | | | | now). llvm-svn: 58681
* Move IRBuilder type definition to common file.Daniel Dunbar2008-11-011-1/+1
| | | | | | - No functionality change. llvm-svn: 58546
* make codegen reject initializes with designators, like this:Chris Lattner2008-10-261-1/+10
| | | | | | | | t.c:1:13: error: cannot codegen this designators yet int a[10] = {2, 4, [8]=9, 10}; ^~~~~~~~~~~~~~~~~ llvm-svn: 58220
* Move EmitAggregate{Copy,Clear} into CodeGenFunction.Daniel Dunbar2008-09-091-44/+38
| | | | | | - No functionality change. llvm-svn: 56010
* Stub out CodeGenFunction::EmitObjCForCollectionStmt.Anders Carlsson2008-08-301-18/+1
| | | | | | Add CodeGenFunction::EmitMemSetToZero and make AggExprEmitter::EmitAggregateClear use it. llvm-svn: 55573
* Simplify some calls to Builder.CreateCallAnders Carlsson2008-08-301-17/+13
| | | | llvm-svn: 55567
* Add Objective-C property setter support.Daniel Dunbar2008-08-301-8/+20
| | | | | | | | | | | | | | | | | | | | | | - 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
* Initial support for Obj-C dot-syntax for getters.Daniel Dunbar2008-08-271-4/+13
| | | | llvm-svn: 55410
* Drop a dead call to isConstantExpr()Daniel Dunbar2008-08-231-8/+6
| | | | llvm-svn: 55244
* Implement Obj-C ivar references to aggregates.Daniel Dunbar2008-08-231-1/+7
| | | | | | | | | | | 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-1/+3
| | | | | | | | | | | | | | | | | | - 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
* 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/+2
| | | | | | - Remove internal uses of AST.h llvm-svn: 54628
* update to make IRBuilder API change.Chris Lattner2008-08-081-1/+1
| | | | llvm-svn: 54548
* Fix EmitNullInitializationToLValue for bitfield lvalues. Daniel Dunbar2008-08-061-4/+2
| | | | | | - PR2643 llvm-svn: 54397
* Finally fix PR2189. This makes a fairly invasive but important change toChris Lattner2008-08-041-4/+3
| | | | | | | | | | move getAsArrayType into ASTContext instead of being a method on type. This is required because getAsArrayType(const AT), where AT is a typedef for "int[10]" needs to return ArrayType(const int, 10). Fixing this greatly simplifies getArrayDecayedType, which is a good sign. llvm-svn: 54317
* Fix implicit initialization of structures.Daniel Dunbar2008-07-301-5/+0
| | | | | | <rdar://problem/6113085> llvm-svn: 54237
* remove uses of QualType::getCanonicalType() from codegen for PR2189Chris Lattner2008-07-261-22/+19
| | | | llvm-svn: 54107
* "Support for Objective-C message sends which return structures. Also ↵Chris Lattner2008-06-241-0/+12
| | | | | | | | 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
* This patch is motivated by numerous strict-aliasing warnings when compilingTed Kremenek2008-06-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+12
| | | | | | | | | | 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
* A few more cases for aggregate values.Eli Friedman2008-05-271-0/+10
| | | | llvm-svn: 51596
* Emit memmove, not memcpy, for structure copies; this is unfortunately Eli Friedman2008-05-261-3/+3
| | | | | | | | | | | | | | | | | required for correctness in cases of copying a struct to itself or to an overlapping struct (itself for cases like *a = *a, and overlapping is possible with unions). Hopefully, this won't end up being a perf issue; LLVM *should* be able to optimize memmove to memcpy in a lot of cases, and for small copies the generated code *should* be mostly comparable. (In reality, LLVM is currently horrible at optimizing memmove, but that's a bug, not a fundamental issue.) gcc currently generates wrong code; that's http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667. llvm-svn: 51566
* Change uses of llvm::Type::isFirstClassType to use the newDan Gohman2008-05-221-1/+1
| | | | | | | | | | | | llvm::Type::isSingleValueType. Currently these two functions have the same behavior, but soon isFirstClassType will return true for struct and array types. Clang may some day want to use of isFirstClassType for some of these some day as an optimization, but it'll require some consideration. llvm-svn: 51446
* Implement codegen for comma operator for structs.Eli Friedman2008-05-201-0/+7
| | | | llvm-svn: 51304
* Fix the emission of expressions like char a[10] = "asdf"; previously, Eli Friedman2008-05-191-2/+9
| | | | | | | | they were causing bad code to be emitted. There are two fixes here: one makes sure we emit a string that is long enough, and one makes sure we properly handle string initialization in init lists. llvm-svn: 51259
* Don't try to take the address of a bitfield; fixes PR2310.Eli Friedman2008-05-121-5/+4
| | | | llvm-svn: 50966
* simplify some builder calls.Chris Lattner2008-05-061-8/+4
| | | | llvm-svn: 50694
* update to follow mainline llvm API change.Chris Lattner2008-04-131-1/+1
| | | | llvm-svn: 49607
* Add support for C++ default arguments, and rework Parse-Sema Chris Lattner2008-04-081-0/+3
| | | | | | | | interaction for function parameters, fixing PR2046. Patch by Doug Gregor! llvm-svn: 49369
* tracking API changes arising from r49277Gabor Greif2008-04-061-3/+3
| | | | llvm-svn: 49279
* Fix PR2049, updating Eli's patch that fixes to mainline. This produces ↵Chris Lattner2008-04-041-14/+115
| | | | | | | | incorrect code, but the codegen doesn't crash. I'll file a bugzilla for the AST being wrong. llvm-svn: 49226
* Since isComplexType() no longer returns true for _Complex integers, the codeChris Lattner2008-04-041-2/+2
| | | | | | generator needs to call isAnyComplexType(). This fixes PR1960. llvm-svn: 49220
* simplify the clang codegen by using the new Builder.CreateStructGEP method.Chris Lattner2008-03-191-9/+2
| | | | llvm-svn: 48534
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+337
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