summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Return function results whose size is smaller than 128-bits in registers if ABIAkira Hatanaka2011-11-021-6/+9
| | | | | | is N32/64. llvm-svn: 143589
* back out changes in r143399 and r143475.Fariborz Jahanian2011-11-022-18/+10
| | | | | | | rvale-references are captured by reference in blocks. // rdar://9971124. llvm-svn: 143583
* Check for homogeneous aggregate return values with ARM's AAPCS-VFP ABI.Bob Wilson2011-11-021-0/+8
| | | | llvm-svn: 143530
* Fix the representation of wide strings in the AST and IR so that it uses the ↵Eli Friedman2011-11-013-31/+56
| | | | | | | | | | native representation of integers for the elements. This fixes a bunch of nastiness involving treating wide strings as a series of bytes. Patch by Seth Cantrell. llvm-svn: 143417
* Adds IRGen support for captured rvalue references in blocks.Fariborz Jahanian2011-10-312-12/+22
| | | | | | | In this case, temporary value is copied into block descriptor as their own copy to work on. // rdar://9971124 llvm-svn: 143399
* In x86_64, when calling an Objective-C method that returns a _Complex long ↵Anders Carlsson2011-10-313-2/+44
| | | | | | double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil. llvm-svn: 143350
* Turn on the new .file directive when appropriate, instead of turning it off.Nick Lewycky2011-10-311-2/+2
| | | | llvm-svn: 143327
* Add support for lazily linking bitcode files (using a newPeter Collingbourne2011-10-301-6/+53
| | | | | | | -mlink-bitcode-file flag), and more generally llvm::Modules, before running optimisations. llvm-svn: 143314
* Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it willRichard Smith2011-10-295-8/+9
| | | | | | | | implicitly perform an lvalue-to-rvalue conversion if used on an lvalue expression. Also improve the documentation of Expr::Evaluate* to indicate which of them will accept expressions with side-effects. llvm-svn: 143263
* In case of template specialization, do not try to delay emitting debug info ↵Devang Patel2011-10-281-5/+21
| | | | | | for concrete type in -flimit-debug-info mode. This fixes some of the failures from bs15503.exp tests in gdb testsuite. llvm-svn: 143227
* Fix PR9614 for functions with the always_inline attribute. Try to keepRafael Espindola2011-10-281-6/+3
| | | | | | the common case (-O0, no always_inline) fast. llvm-svn: 143222
* It turns out that the Objective-C message lookup functions can throw ↵David Chisnall2011-10-281-11/+14
| | | | | | exceptions after all... llvm-svn: 143205
* Annotate imprecise FP division with fpaccuracy metadataPeter Collingbourne2011-10-273-2/+33
| | | | | | | | | The OpenCL single precision division operation is only required to be accurate to 2.5ulp. Annotate the fdiv instruction with metadata which signals to the backend that an imprecise divide instruction may be used. llvm-svn: 143136
* Objective-c: fix an ir-gen crash where objc messag returns a _ComplexFariborz Jahanian2011-10-261-8/+24
| | | | | | | value and ABI requires return slot to be passed as first argument to message sent. // rdar://10331109 llvm-svn: 143053
* Fix pr9614 by not emitting an available_externally function when it callsRafael Espindola2011-10-262-4/+60
| | | | | | | | | itself via an asm label. available_externally functions are supposed to correspond to an external function, and that is not the case in the examples in pr9614. llvm-svn: 143049
* Restore r142914 and r142915, now with missing file and apparentJohn McCall2011-10-253-4/+5
| | | | | | GCC compiler workaround. llvm-svn: 142931
* Revert r142914 and r142915, due to possibly missing file.NAKAMURA Takumi2011-10-253-5/+4
| | | | | | r142914: "Introduce a placeholder type for "pseudo object"" r142915: "Pull the pseudo-object stuff into its own file." llvm-svn: 142921
* Change an int64_t to an intptr_t so that we don't end up with crashes in the ↵David Chisnall2011-10-251-8/+8
| | | | | | back end on large classes on 32-bit. llvm-svn: 142918
* Introduce a placeholder type for "pseudo object"John McCall2011-10-253-4/+5
| | | | | | | | | | | | | | | expressions: expressions which refer to a logical rather than a physical l-value, where the logical object is actually accessed via custom getter/setter code. A subsequent patch will generalize the AST for these so that arbitrary "implementing" sub-expressions can be provided. Right now the only client is ObjC properties, but this should be generalizable to similar language features, e.g. Managed C++'s __property methods. llvm-svn: 142914
* Implement support for dependent Microsoft __if_exists/__if_not_existsDouglas Gregor2011-10-251-0/+1
| | | | | | | | | | statements. As noted in the documentation for the AST node, the semantics of __if_exists/__if_not_exists are somewhat different from the way Visual C++ implements them, because our parsed-template representation can't accommodate VC++ semantics without serious contortions. Hopefully this implementation is "good enough". llvm-svn: 142901
* Remove the SystemZ backend.Dan Gohman2011-10-241-82/+0
| | | | llvm-svn: 142879
* Do not drop type qualifiers in -flimit-debug-info mode.Devang Patel2011-10-241-1/+7
| | | | llvm-svn: 142873
* Don't try to emit CK_LValueBitCast casts as constants. PR9558.Eli Friedman2011-10-241-1/+1
| | | | llvm-svn: 142863
* Fix mismatched new[]/delete[].Benjamin Kramer2011-10-241-1/+1
| | | | llvm-svn: 142803
OpenPOWER on IntegriCloud