summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Sigh, another workaround for MSVC.Peter Collingbourne2011-11-281-1/+1
| | | | llvm-svn: 145211
* Work around a gcc4.2 bug.Peter Collingbourne2011-11-281-1/+1
| | | | llvm-svn: 145209
* When destroying temporaries, instead of a custom cleanup use thePeter Collingbourne2011-11-276-41/+12
| | | | | | | | | | | generic pushDestroy function. This would reduce the number of useful declarations in CGTemporaries.cpp to one. Since CodeGenFunction::EmitCXXTemporary does not deserve its own file, move it to CGCleanup.cpp and delete CGTemporaries.cpp. llvm-svn: 145202
* Add inreg attributes to reference arguments.Rafael Espindola2011-11-271-1/+2
| | | | llvm-svn: 145189
* Reference initialization with initializer lists.Sebastian Redl2011-11-271-1/+12
| | | | | | This supports single-element initializer lists for references according to DR1288, as well as creating temporaries and binding to them for other initializer lists. llvm-svn: 145186
* Use static storage duration for file-scope compound literals, even when theyRichard Smith2011-11-223-0/+15
| | | | | | appear in non-constant initializers in C++. llvm-svn: 145087
* implement __has_feature(address_sanitizer); also use ↵Kostya Serebryany2011-11-221-1/+1
| | | | | | LangOpts.AddressSanitizer instead of CodeGenOpts.AddressSanitizer llvm-svn: 145054
* 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
* Finish r144971, which was an incomplete commit.Eli Friedman2011-11-181-1/+1
| | | | llvm-svn: 144972
* Fix the meaning of an "empty" record for the case of a zero-length array. ↵Eli Friedman2011-11-181-3/+7
| | | | | | Use isEmptyRecord for arguments on x86-32; there are structs of size 0 which don't count as empty. llvm-svn: 144971
* Make va_arg on x86-64 compute alignment the same way as argument passing.Eli Friedman2011-11-181-7/+5
| | | | | | Fixes <rdar://problem/10463281>. llvm-svn: 144966
* A bunch of fixes to argument passing and va_arg on Darwin x86-32 for ↵Eli Friedman2011-11-181-3/+21
| | | | | | structures containing an SSE vector. llvm-svn: 144963
* Don't try to expand struct arguments containing holes on x86-32. From gcc ↵Eli Friedman2011-11-181-0/+8
| | | | | | struct layout tests. llvm-svn: 144961
* Simplify code for returning a struct for Darwin x86-32 ABI. Use a better ↵Eli Friedman2011-11-181-41/+16
| | | | | | type for a function returning a struct containing only a pointer. Handle the edge case of a struct containing only a float or double plus some dead padding instead of asserting. llvm-svn: 144960
* Ignore empty unions in argument lowering on x86-32. From gcc struct layout ↵Eli Friedman2011-11-181-2/+2
| | | | | | tests. llvm-svn: 144944
* Change ASTConsumer::HandleTopLevelDecl to return true for the parser to continueArgyrios Kyrtzidis2011-11-182-2/+5
| | | | | | parsing or false to abort parsing. llvm-svn: 144943
* Use the canonical decl to index so that we can really find it later.Eric Christopher2011-11-171-4/+4
| | | | | | Fixes rdar://10433202 llvm-svn: 144938
* Constant expression evaluation: add support for evaluation of member pointersRichard Smith2011-11-171-0/+1
| | | | | | and base-to-derived casts, and add proper handling of temporaries. llvm-svn: 144926
* Add -f[no-]address-sanitizer flagKostya Serebryany2011-11-161-0/+10
| | | | llvm-svn: 144800
* Match LLVM API change.Evan Cheng2011-11-161-9/+10
| | | | llvm-svn: 144789
* Fix a bunch of really nasty bugs in how we compute alignment for reference ↵Eli Friedman2011-11-162-14/+37
| | | | | | lvalues. PR11376. llvm-svn: 144745
* Fix crash in calling convention code expanding an struct with a complex member.Eli Friedman2011-11-151-3/+9
| | | | llvm-svn: 144612
* Fixup comment.Eric Christopher2011-11-141-1/+1
| | | | llvm-svn: 144548
* Represent an APValue based on a Decl as that Decl, rather than a DeclRefExprRichard Smith2011-11-121-22/+23
| | | | | | | | or MemberExpr which refers to it. As a side-effect, MemberExprs which refer to static member functions and static data members are now emitted as constant expressions. llvm-svn: 144468
* Add invariant.load metadata to loads from selector references. Allows these ↵Pete Cooper2011-11-101-1/+6
| | | | | | loads to later be moved/combined in the optimizer. Fixes <rdar://problem/6027699> llvm-svn: 144318
* Add missing dependency for shared library build to CMakeLists. Patch by ↵Eli Friedman2011-11-101-0/+1
| | | | | | Johannes Obermayr. llvm-svn: 144310
* Whenever explicitly activating or deactivating a cleanup, weJohn McCall2011-11-107-32/+93
| | | | | | | | | | need to provide a 'dominating IP' which is guaranteed to dominate the (de)activation point but which cannot be avoided along any execution path from the (de)activation point to the push-point of the cleanup. Using the entry block is bad mojo. llvm-svn: 144276
* Fix a subtle bug with cleanups: when activatingJohn McCall2011-11-101-9/+14
| | | | | | | | | | | | a previously-inactive cleanup, not only do we need a flag variable, but we should also force the cleanup to query the flag variable. However, we only need to do this when we're activating in a context that's conditionally executed; otherwise, we may safely assume that the cleanup is dominated by the activation point. llvm-svn: 144271
* Enter the cleanups for a block outside the enclosingJohn McCall2011-11-1011-76/+223
| | | | | | | | | | | | 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
* Constant expression evaluation: support for evaluation of structs and unions ofRichard Smith2011-11-101-2/+3
| | | | | | | literal types, as well as derived-to-base casts for lvalues and derived-to-virtual-base casts. llvm-svn: 144265
* Reflow lines, remove else-if after returns, rename variable "TydefContext" toNick Lewycky2011-11-101-14/+9
| | | | | | "TypedefContext". No functionality change. llvm-svn: 144248
* Remove unnecessary include.Devang Patel2011-11-091-1/+0
| | | | llvm-svn: 144210
* Reflow one line I missed in previous cleanup commit. No functionality change.Nick Lewycky2011-11-091-2/+1
| | | | llvm-svn: 144168
* Minor cleanup, mostly reindenting. Remove one helper function that just calledNick Lewycky2011-11-092-22/+15
| | | | | | | the other helper functions, since we already differentiated the cases it was testing between. No functionality change. llvm-svn: 144167
* Emit the copy and dipose helpers for ARC __strongJohn McCall2011-11-091-10/+48
| | | | | | | | | | | | | | | | | | | | block-typed __block variables using objc_retainBlock and objc_dispose. Previously we were using _Block_object_assign and _Block_object_destroy with BLOCK_BYREF_CALLER, which causes the runtime to completely ignore the retain and release. In most cases this doesn't cause catastrophe because the retain/release are balanced and because the block in the variable was copied upon assignment there. However, the stack copy of the variable will be released when it goes out of scope, which is a problem if that value was released due to an assignment to the heap copy. Similarly, a leak can occur if the variable is assigned after the copy to the heap. llvm-svn: 144162
* Bind function "r-values" as l-values when emitting them asJohn McCall2011-11-082-2/+9
| | | | | | opaque values. Silly C type system. llvm-svn: 144144
* Fix the layout of vb-tables and vf-tables in the MS C++ ABI.John McCall2011-11-081-33/+77
| | | | | | Based on work by Dmitry Sokolov! llvm-svn: 144072
* lib/CodeGen/CGBuiltin.cpp: Tweak the identifier "Type" to appease msvc.NAKAMURA Takumi2011-11-081-3/+3
| | | | llvm-svn: 144065
* Clean up type flags for overloaded Neon builtins. No functional change.Bob Wilson2011-11-081-29/+46
| | | | | | | | | This patch just adds a simple NeonTypeFlags class to replace the various hardcoded constants that had been used until now. Unfortunately I couldn't figure out a good way to avoid duplicating that class between clang and TableGen, but since it's small and rarely changes, that's not so bad. llvm-svn: 144054
* Constant expression evaluation: support for arrays.Richard Smith2011-11-071-0/+3
| | | | llvm-svn: 143922
* Rip out CK_GetObjCProperty.John McCall2011-11-076-23/+0
| | | | llvm-svn: 143910
* Rip the ObjCPropertyRef l-value kind out of IR-generation.John McCall2011-11-077-258/+23
| | | | llvm-svn: 143908
* Change the AST representation of operations on Objective-CJohn McCall2011-11-067-55/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* Use a single integer type for a sub-doubleword part of a byval structure.Akira Hatanaka2011-11-031-11/+4
| | | | llvm-svn: 143666
* Fix alignment on alloca's for parameters using ABIArgInfo::Expand. Eli Friedman2011-11-031-4/+5
| | | | llvm-svn: 143658
* 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
* Do not add "byval" attribute to records with non-trivial copy constructorsJan Wen Voung2011-11-031-1/+7
| | | | | | and destructors in the DefaultABIInfo. llvm-svn: 143601
* Set MinABIStackAlignInBytes to 8 if ABI is N32/64.Akira Hatanaka2011-11-031-4/+3
| | | | llvm-svn: 143597
* Convert the type of a structure passed by value if it has double precisionAkira Hatanaka2011-11-021-0/+71
| | | | | | fields in order to ease handling of such structures in backend. llvm-svn: 143596
OpenPOWER on IntegriCloud