summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Switch LValue so that it exposes alignment in CharUnits. (No functional ↵Eli Friedman2011-12-031-2/+2
| | | | | | change.) llvm-svn: 145753
* Introduce a module import declaration, so that we properly represent, e.g.,Douglas Gregor2011-12-021-0/+1
| | | | | | | | __import_module__ std.vector; in the AST. llvm-svn: 145725
* Fix wrong-code bug when a const automatic variable of struct type has both aRichard Smith2011-12-021-7/+10
| | | | | | | | | | | | mutable member and a constant initializer. We'd previously promoted such variables to global constants, resulting in nasal demons if the mutable member was modified. This is only a temporary fix. The subtle interplay between isConstantInitializer and CGExprConstant is very bug-prone; there are some other issues in this area which I will be addressing in subsequent, more major reworking of this code. llvm-svn: 145654
* The cheap version of getName() is sufficient here.Benjamin Kramer2011-11-291-1/+1
| | | | llvm-svn: 145399
* CodeGen: Simplify code.Benjamin Kramer2011-11-211-6/+3
| | | | llvm-svn: 145040
* CodeGen: allow __asm renaming on static local variables.Benjamin Kramer2011-11-201-1/+9
| | | | | | Fixes PR4777. llvm-svn: 145015
* Enter the cleanups for a block outside the enclosingJohn McCall2011-11-101-2/+4
| | | | | | | | | | | | full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. llvm-svn: 144268
* Fix the alignment on scalar parameter variables so that it matches what the ↵Eli Friedman2011-11-031-1/+4
| | | | | | AST thinks it should be. Per report on cfe-dev. llvm-svn: 143645
* de-tmpify clang.Benjamin Kramer2011-09-271-3/+3
| | | | llvm-svn: 140637
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-4/+4
| | | | llvm-svn: 140367
* OpenCL: introduce support for function scope __local variablesPeter Collingbourne2011-09-191-0/+3
| | | | llvm-svn: 140068
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-1/+1
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
* Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: canJulien Lerouge2011-09-091-7/+8
| | | | | | | annotate global, local variables, struct fields, or arbitrary statements (using the __builtin_annotation), rdar://8037476. llvm-svn: 139423
* Track whether an AggValueSlot is potentially aliased, and do notJohn McCall2011-08-251-1/+2
| | | | | | | | | | emit call results into potentially aliased slots. This allows us to properly mark indirect return slots as noalias, at the cost of requiring an extra memcpy when assigning an aggregate call result into a l-value. It also brings us into compliance with the x86-64 ABI. llvm-svn: 138599
* Use stronger typing for the flags on AggValueSlot and requireJohn McCall2011-08-251-1/+3
| | | | | | | creators to tell us whether something needs GC barriers. No functionality change. llvm-svn: 138581
* blocks - capturing logic of byref block variable's expression Fariborz Jahanian2011-08-251-1/+17
| | | | | | | statement initializer makes safe assumption when a substatement is encounterred (with a fix me). llvm-svn: 138528
* Make constant aggregate constant initializers private linkage.Eric Christopher2011-08-241-1/+1
| | | | | | | | | After talking with John making this the case for all of these is the right way to go. Fixes rdar://9804564 and PR10414 llvm-svn: 138418
* Whitespace and 80-col cleanup.Eric Christopher2011-08-231-3/+2
| | | | llvm-svn: 138413
* Whitespace.Eric Christopher2011-08-231-45/+45
| | | | llvm-svn: 138404
* checking for __block variable captured by givenFariborz Jahanian2011-08-231-2/+9
| | | | | | | stmt expression, recursively walk down all substatements of the stmt expression. // rdar://10001085 llvm-svn: 138334
* block IRgen - Fixes a crash when determining if given block variableFariborz Jahanian2011-08-231-0/+3
| | | | | | is captured by a given statement expression. // rdar://10001085 llvm-svn: 138314
* 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
OpenPOWER on IntegriCloud