summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement function template specialization at class scope extension in ↵Francois Pichet2011-08-141-0/+1
| | | | | | | | | | | | | | | | | Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization. Example: template <class T> class A { public: template <class U> void f(U p) { } template <> void f(int p) { } // <== class scope specialization }; This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code. BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error. llvm-svn: 137573
* Fix a couple of problems with initialization and assignment toJohn McCall2011-07-281-1/+1
| | | | | | | | | | | __block variables where the act of initialization/assignment itself causes the __block variable to be copied to the heap because the variable is of block type and is being assigned a block literal which captures the variable. rdar://problem/9814099 llvm-svn: 136337
* Rename getInstantiationLineNumber to getExpansionLineNumber in bothChandler Carruth2011-07-251-2/+1
| | | | | | SourceManager and FullSourceLoc. llvm-svn: 135969
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-3/+3
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to useJay Foad2011-07-221-4/+2
| | | | | | ArrayRef. llvm-svn: 135761
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-7/+7
| | | | llvm-svn: 135370
* Okay, that rule about zero-length arrays applies to destroyingJohn McCall2011-07-131-37/+32
| | | | | | them, too. llvm-svn: 135038
* Generalize Cleanup::Emit's "isForEH" parameter into a setJohn McCall2011-07-121-10/+11
| | | | | | of flags. No functionality change. llvm-svn: 134997
* Switch field destruction over to use the new destroyer-based APIJohn McCall2011-07-121-12/+27
| | | | | | and kill a lot of redundant code. llvm-svn: 134988
* Fix a lot of problems with the partial destruction of arrays:John McCall2011-07-111-67/+168
| | | | | | | | | | | - an off-by-one error in emission of irregular array limits for InitListExprs - use an EH partial-destruction cleanup within the normal array-destruction cleanup - get the branch destinations right for the empty check Also some refactoring which unfortunately obscures these changes. llvm-svn: 134890
* More compiler workarounds. I have to admit that I was notJohn McCall2011-07-091-4/+14
| | | | | | | | expecting so much concentrated oddity on what seemed like a trivial feature. Thanks to François Pichet for doing the MSVC legwork here. llvm-svn: 134813
* GCC 4.2 compatibility hack.John McCall2011-07-091-3/+4
| | | | llvm-svn: 134785
* A number of array-related IR-gen cleanups.John McCall2011-07-091-56/+214
| | | | | | | | | | | | - Emit default-initialization of arrays that were partially initialized with initializer lists with a loop, rather than emitting the default initializer N times; - support destroying VLAs of non-trivial type, although this is not yet exposed to users; and - support the partial destruction of arrays initialized with initializer lists when an initializer throws an exception. llvm-svn: 134784
* Don't zero-initialize default-initialized local variables that haveDouglas Gregor2011-07-011-1/+18
| | | | | | | | trivial default constructors. This generated-code regression was caused by r131796, which had simplified the handling of default initialization in Sema. Fixes <rdar://problem/9694300>. llvm-svn: 134260
* objc-arc: fix a IRGen crash when checking forFariborz Jahanian2011-06-291-1/+2
| | | | | | | accessibility of an initializer which is a compound statement. // rdar://9694706 llvm-svn: 134091
* LValue carries a type now, so simplify the main EmitLoad/Store APIsJohn McCall2011-06-251-7/+8
| | | | | | by removing the redundant type parameter. llvm-svn: 133860
* Honor objc_precise_lifetime in GC mode by feeding the valueJohn McCall2011-06-241-0/+20
| | | | | | | in the variable to an inline asm which gets run when the variable goes out of scope. llvm-svn: 133840
* Change the IR-generation of VLAs so that we capture bounds,John McCall2011-06-241-15/+13
| | | | | | | not sizes; so that we use well-typed allocas; and so that we properly recurse through the full set of variably-modified types. llvm-svn: 133827
* Remove dead variables.Benjamin Kramer2011-06-181-1/+0
| | | | llvm-svn: 133346
* Objective-C fast enumeration loop variables are not retained in ARC, butJohn McCall2011-06-171-4/+38
| | | | | | | | | | | | they should still be officially __strong for the purposes of errors, block capture, etc. Make a new bit on variables, isARCPseudoStrong(), and set this for 'self' and these enumeration-loop variables. Change the code that was looking for the old patterns to look for this bit, and change IR generation to find this bit and treat the resulting variable as __unsafe_unretained for the purposes of init/destroy in the two places it can come up. llvm-svn: 133243
* Restore correct use of GC barriers.John McCall2011-06-161-37/+41
| | | | llvm-svn: 133144
* Suppress a warning in -Asserts builds.John McCall2011-06-151-0/+1
| | | | llvm-svn: 133110
* Automatic Reference Counting.John McCall2011-06-151-16/+240
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Do not emit stoppoint before emitting debug info for parameters.Devang Patel2011-06-151-3/+1
| | | | | | | - llvm.dbg.declare already receives line number information from ParmDecl - Additional extra stoppoint messes up gdb's understanding of where function body starts. llvm-svn: 133065
* Rework r132576.Devang Patel2011-06-041-2/+0
| | | | | | Emit debug info only if there is an insertion point. The debug info should not force an insertion point. Codegen may later on decide to not emit code for some reason, see extensive comment in CodeGenFunction::EmitStmt(), and debug info should not get in the way. llvm-svn: 132610
* Emit debug info only if there is an insertion point. The debug info should ↵Devang Patel2011-06-031-9/+10
| | | | | | not force an insertion point. Codegen may later on decide to not emit code for some reason, see extensive comment in CodeGenFunction::EmitStmt(), and debug info should not get in the way. llvm-svn: 132576
* Add unnamed_addr to internal globals which are only used as an operand to ↵Eli Friedman2011-05-271-0/+1
| | | | | | memcpy. (Spotted by looking at IR.) llvm-svn: 132226
* Implement support for C++0x alias templates.Richard Smith2011-05-051-0/+1
| | | | llvm-svn: 130953
* Simplify code a bit by using CallArgList::add. No intended functionality ↵Eli Friedman2011-05-021-2/+2
| | | | | | change. llvm-svn: 130699
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-2/+3
| | | | llvm-svn: 129567
* Fix typo.Devang Patel2011-04-051-1/+1
| | | | llvm-svn: 128921
* Move all the significant __block code into CGBlocks.cpp. No functionalityJohn McCall2011-03-311-187/+7
| | | | | | change. llvm-svn: 128608
* Add support for language-specific address spaces. On top of that,Peter Collingbourne2011-03-181-4/+7
| | | | | | | | | add support for the OpenCL __private, __local, __constant and __global address spaces, as well as the __read_only, _read_write and __write_only image access specifiers. Patch originally by ARM; language-specific address space support by myself. llvm-svn: 127915
* Extract a function to emit an arbitrary expression as if it were the initializerJohn McCall2011-03-081-53/+77
| | | | | | for a local variable. llvm-svn: 127227
* Revert r126422 "Use private linkage to avoid symbol conflicts inDouglas Gregor2011-03-061-1/+1
| | | | | | corner cases like the one in PR9301." which caused PR9416. llvm-svn: 127136
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-031-2/+3
| | | | | | | | in order. This fixes few blocks.exp regressions. llvm-svn: 126960
* revert r126858.Devang Patel2011-03-021-3/+2
| | | | llvm-svn: 126874
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-021-2/+3
| | | | | | | | | | in order. This fixes few blocks.exp regressions. Reapply r126795 with a fix (one character change) for gdb testsuite regressions. llvm-svn: 126858
* Revert r126794.Devang Patel2011-03-021-3/+2
| | | | llvm-svn: 126848
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-011-2/+3
| | | | | | | | in order. This fixes few blocks.exp regressions. llvm-svn: 126795
* Use private linkage to avoid symbol conflicts in corner cases like the oneRafael Espindola2011-02-241-1/+1
| | | | | | in PR9301. llvm-svn: 126422
* Emit the structure layout of the block literal parameter to a blockJohn McCall2011-02-221-1/+18
| | | | | | | | | | invocation function into the debug info. Rather than faking up a class, which is tricky because of the custom layout we do, we just emit a struct directly from the layout information we've already got. Also, don't emit an unnecessarily parameter alloca for this "variable". llvm-svn: 126255
* Establish the iteration variable of an ObjC for-in loop beforeJohn McCall2011-02-221-2/+6
| | | | | | | emitting the collection expression. Fixes some really, really broken code. llvm-svn: 126193
* Reorganize the emission of local variables.John McCall2011-02-221-147/+214
| | | | llvm-svn: 126189
* The flags we're supposed to write into a byref struct are *not* theJohn McCall2011-02-181-12/+13
| | | | | | | | | | | | _Block_object_* flags; it's just BLOCK_HAS_COPY_DISPOSE or not. Also, we don't need to chase forwarding pointers prior to calling _Block_object_dispose; _Block_object_dispose in fact already does this. rdar://problem/9006315 llvm-svn: 125823
* implement basic support for __label__. I wouldn't be shocked if there areChris Lattner2011-02-181-1/+1
| | | | | | | | | bugs from other clients that don't expect to see a LabelDecl in a DeclStmt, but if so they should be easy to fix. This implements most of PR3429 and rdar://8287027 llvm-svn: 125817
* Step #1/N of implementing support for __label__: split labels intoChris Lattner2011-02-171-1/+1
| | | | | | | | | | | | | | | | | | | LabelDecl and LabelStmt. There is a 1-1 correspondence between the two, but this simplifies a bunch of code by itself. This is because labels are the only place where we previously had references to random other statements, causing grief for AST serialization and other stuff. This does cause one regression (attr(unused) doesn't silence unused label warnings) which I'll address next. This does fix some minor bugs: 1. "The only valid attribute " diagnostic was capitalized. 2. Various diagnostics printed as ''labelname'' instead of 'labelname' 3. This reduces duplication of label checking between functions and blocks. Review appreciated, particularly for the cindex and template bits. llvm-svn: 125733
* Ensure that the NRVO flag has some block to insert into. Fixes PR9178!Nick Lewycky2011-02-161-1/+2
| | | | llvm-svn: 125694
* Simplify test to check an aggregate argument that has non trivial ↵Devang Patel2011-02-161-3/+2
| | | | | | | | constructor or destructor. This patch rewrites r125142. llvm-svn: 125632
* Assorted cleanup:John McCall2011-02-151-3/+3
| | | | | | | | | - Have CGM precompute a number of commonly-used types - Have CGF copy that during initialization instead of recomputing them - Use TBAA info when initializing a parameter variable - Refactor the scalar ++/-- code llvm-svn: 125562
OpenPOWER on IntegriCloud