summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement IRGen for MemberExpr referring to static member function.Eli Friedman2009-11-261-17/+24
| | | | llvm-svn: 89938
* Add a Thunk struct to the vtable builder.Anders Carlsson2009-11-261-19/+45
| | | | llvm-svn: 89935
* Use the more general Evaluate infrastructure for folding constant DeclRefsEli Friedman2009-11-261-17/+17
| | | | | | | | | | | | | instead of checking explicitly for an EnumConstantDecl. This folds references to constant integer VarDecls, which has two benefits: 1. Slightly smaller emitted code from emitting a constant instead of a load, and skipping emitting some constant globals. 2. Some code forgets to define static constant member variables; emitting a load instead of the value in that case leads to a link error. (Such programs are technically not well-formed, but in practice build with g++.) llvm-svn: 89934
* Add a CovariantThunkAdjustment struct that represents the adjustments needed ↵Anders Carlsson2009-11-267-67/+93
| | | | | | for a covariant thunk. llvm-svn: 89933
* Use new getLinkage() method to correctly compute whether a variable hasEli Friedman2009-11-261-4/+3
| | | | | | internal linkage. Fixes PR5433. llvm-svn: 89931
* Move the mangler into the CodeGen namespace. Change mangleThunk to take a ↵Anders Carlsson2009-11-264-24/+30
| | | | | | ThunkAdjustment. llvm-svn: 89930
* Add a ThunkAdjustment struct which holds a non-virtual and a virtual ↵Anders Carlsson2009-11-267-43/+79
| | | | | | adjustment offset. Start using it. General cleanup in Mangle.cpp. llvm-svn: 89925
* Use StringRef (again) in DebugInfo interface.Devang Patel2009-11-251-18/+18
| | | | llvm-svn: 89867
* Add VTT parameter to base ctors/dtors with virtual bases. (They aren't used ↵Anders Carlsson2009-11-255-6/+86
| | | | | | yet). llvm-svn: 89835
* Implement proper cleanup semantics for condition variables in forDouglas Gregor2009-11-251-11/+34
| | | | | | | | | | statements, e.g., for(; X x = X(); ) { ... } Daniel or Anders, please review! llvm-svn: 89832
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-253-9/+10
| | | | | | | | | | | | | | | | | All statements that involve conditions can now hold on to a separate condition declaration (a VarDecl), and will use a DeclRefExpr referring to that VarDecl for the condition expression. ForStmts now have such a VarDecl (I'd missed those in previous commits). Also, since this change reworks the Action interface for if/while/switch/for, use FullExprArg for the full expressions in those expressions, to ensure that we're emitting Note that we are (still) not generating the right cleanups for condition variables in for statements. That will be a follow-on commit. llvm-svn: 89817
* Clean up the AST for while loops and fix several problems withDouglas Gregor2009-11-242-9/+66
| | | | | | | | | | | | | | | | | cleanups for while loops: 1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g., while (shared_ptr<WorkInt> p = getWorkItem()) { // ... } 2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g., while (blah) RAIIObject raii(blah+1); llvm-svn: 89800
* Handle references correctly when synthesizing copy constructors.Anders Carlsson2009-11-241-8/+28
| | | | | | | | | | | With this change, the clang-on-clang test result is now Expected Passes : 224 Unexpected Failures: 37 Which means that we can compile over 80% of clang with clang! :) llvm-svn: 89799
* Handle cases where we're constructing an array of objects and the ↵Anders Carlsson2009-11-243-36/+67
| | | | | | constructor has default arguments. llvm-svn: 89783
* Explicitly store the condition variable within switch statements, andDouglas Gregor2009-11-241-0/+5
| | | | | | | make sure that this variable is destroyed when we exit the switch statement. llvm-svn: 89776
* We always need to emit the base expression of a member expression, even when ↵Anders Carlsson2009-11-241-2/+9
| | | | | | the member decl refers to an enum. Thanks to Eli for pointing this out! llvm-svn: 89775
* Introduce cleanup scopes for "if" statements in two places:Douglas Gregor2009-11-242-12/+41
| | | | | | | | | | | | | | | | - Outside the "if", to ensure that we destroy the condition variable at the end of the "if" statement rather than at the end of the block containing the "if" statement. - Inside the "then" and "else" branches, so that we emit then- or else-local cleanups at the end of the corresponding block when the block is not a compound statement. To make adding these new cleanup scopes easier (and since switch/do/while will all need the same treatment), added the CleanupScope RAII object to introduce a new cleanup scope and make sure it gets cleaned up. llvm-svn: 89773
* Rename CleanupScope -> DelayedCleanupBlock. No functionality change.Douglas Gregor2009-11-243-10/+10
| | | | llvm-svn: 89769
* Get rid of the ugly CGCXX names and replace them with CGClass, CGExprCXX and ↵Anders Carlsson2009-11-244-7/+7
| | | | | | CGTemporaries. llvm-svn: 89742
* When mangling a ctor/dtor we need to take into consideration whether it's a ↵Anders Carlsson2009-11-241-2/+17
| | | | | | member template. llvm-svn: 89741
* Ignore constructor member templates in CodeGenModule::EmitTopLevelDecl.Anders Carlsson2009-11-241-0/+4
| | | | llvm-svn: 89737
* It is common for vtables to contain pointers to functions that have either ↵Anders Carlsson2009-11-243-4/+33
| | | | | | | | incomplete return types or incomplete argument types. Handle this by returning the llvm::OpaqueType for those cases, which CodeGenModule::GetOrCreateLLVMFunction knows about, and treats as being an "incomplete function". llvm-svn: 89736
* Explicitly track the condition variable within an "if" statement,Douglas Gregor2009-11-231-0/+2
| | | | | | | | | rather than burying it in a CXXConditionDeclExpr (that occassionally hides behind implicit conversions). Similar changes for switch, while, and do-while will follow, then the removal of CXXConditionDeclExpr. This commit is the canary. llvm-svn: 89717
* Don't try to treat an enum constant as an lvalue.Anders Carlsson2009-11-231-1/+8
| | | | llvm-svn: 89705
* Handle converting member pointers to bool.Anders Carlsson2009-11-231-0/+29
| | | | llvm-svn: 89692
* Handle base-to-derived casts. Will land test case shortly.Anders Carlsson2009-11-235-51/+153
| | | | llvm-svn: 89678
* Centralize and complete the computation of value- and type-dependence for ↵Douglas Gregor2009-11-231-3/+3
| | | | | | DeclRefExprs llvm-svn: 89649
* Teach CodeGenFunction::EmitDecl to ignore Using and UsingShadow decls.Daniel Dunbar2009-11-231-2/+6
| | | | llvm-svn: 89633
* x86_64, PR5582: Layout bases for C++ records.Daniel Dunbar2009-11-221-1/+27
| | | | | | | - Ideally we would have an single iteration interface for this, but this works for now. llvm-svn: 89632
* Use EmitStoreOfScalar when copying the scalar to the space allocated by 'new'.Anders Carlsson2009-11-221-2/+3
| | | | llvm-svn: 89613
* Support emitting aggregate class initializers. Fixes PR5581.Anders Carlsson2009-11-211-1/+1
| | | | llvm-svn: 89569
* This patch implements objective-c's 'SEL' type as a built-inFariborz Jahanian2009-11-212-0/+2
| | | | | | | | | | | | | | | | | | type and fixes a long-standing code gen. crash reported in at least two PRs and a radar. (radar 7405040 and pr5025). There are couple of remaining issues that I would like for Ted. and Doug to look at: Ted, please look at failure in Analysis/MissingDealloc.m. I have temporarily added an expected-warning to make the test pass. This tests has a declaration of 'SEL' type which may not co-exist with the new changes. Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp. I think the changes which I have ifdef'ed out are correct. They need be considered for in a few Indexer/PCH test cases. llvm-svn: 89561
* Mangler: Sketch mangling for TemplateArgument::Declaration kind.Daniel Dunbar2009-11-211-27/+32
| | | | | | - Several important FIXMEs related to whether arguments are expressions or external names, and the mangling of extern "C" names (c.f., PR5522). llvm-svn: 89556
* Mangler: Lift shouldMangleDeclName predicate out of CXXNameMangler::mangle.Daniel Dunbar2009-11-213-44/+49
| | | | | | | | - Sometimes we have to mangle things we wouldn't normally (e.g., because they appear in a template expression). - This also tidies up the predicate to be more obvious what is getting mangled. llvm-svn: 89555
* Mangler: Strengthen invariants, MangleContext::mangleName should only be ↵Daniel Dunbar2009-11-211-15/+12
| | | | | | called on var or function decls. llvm-svn: 89554
* Mangler: Inline a bunch of functions into their sole caller, not that I ↵Daniel Dunbar2009-11-211-106/+56
| | | | | | don't love typing for typings sake, but... llvm-svn: 89553
* Remove dead variable.Daniel Dunbar2009-11-211-1/+0
| | | | llvm-svn: 89551
* Mangler: Split isStdNamespace for when the caller already has a NamespaceDecl.Daniel Dunbar2009-11-211-5/+6
| | | | llvm-svn: 89550
* IRgen: Eliminate CXXNameMangler::mangleCXX{C,D}tor.Daniel Dunbar2009-11-211-24/+10
| | | | llvm-svn: 89549
* IRgen: Switch the C++ mangler interfaces to take the SmallVector to write into,Daniel Dunbar2009-11-216-96/+67
| | | | | | | instead of requiring clients to make a raw_svector_ostream, which is just an implementation detail. llvm-svn: 89548
* Sink free mangle* methods into MangleContext.Daniel Dunbar2009-11-216-239/+234
| | | | llvm-svn: 89547
* Delete trailing space.Daniel Dunbar2009-11-211-85/+85
| | | | llvm-svn: 89545
* Added rudimentary C++0x attribute support.Alexis Hunt2009-11-211-2/+6
| | | | | | | | | | | | | | The following attributes are currently supported in C++0x attribute lists (and in GNU ones as well): - align() - semantics believed to be conformant to n3000, except for redeclarations and what entities it may apply to - final - semantics believed to be conformant to CWG issue 817's proposed wording, except for redeclarations - noreturn - semantics believed to be conformant to n3000, except for redeclarations - carries_dependency - currently ignored (this is an optimization hint) llvm-svn: 89543
* Checkpoint current work. WIP.Mike Stump2009-11-202-8/+126
| | | | llvm-svn: 89513
* Fix lifetime of conditional temporaries. Patch by Victor Zverovich!Anders Carlsson2009-11-205-46/+31
| | | | llvm-svn: 89467
* Fixed crash when using undefined protocols (GNU runtime).David Chisnall2009-11-201-2/+7
| | | | llvm-svn: 89457
* Fix a couple minor memory leaks.Eli Friedman2009-11-201-1/+7
| | | | llvm-svn: 89450
* Implement throw d, where d is a class type that requires copyMike Stump2009-11-201-2/+22
| | | | | | construction. WIP. llvm-svn: 89442
* Handle throw d, where d is a class type but only has a trivial copyMike Stump2009-11-201-8/+9
| | | | | | constructor. WIP. llvm-svn: 89438
* Add suport for throw;. WIP.Mike Stump2009-11-201-4/+16
| | | | llvm-svn: 89424
OpenPOWER on IntegriCloud