summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Use the actual ABI-determined C calling convention for runtimeJohn McCall2013-02-281-0/+18
| | | | | | | | | | | | | | | | | | | | | | calls and declarations. LLVM has a default CC determined by the target triple. This is not always the actual default CC for the ABI we've been asked to target, and so we sometimes find ourselves annotating all user functions with an explicit calling convention. Since these calling conventions usually agree for the simple set of argument types passed to most runtime functions, using the LLVM-default CC in principle has no effect. However, the LLVM optimizer goes into histrionics if it sees this kind of formal CC mismatch, since it has no concept of CC compatibility. Therefore, if this module happens to define the "runtime" function, or got LTO'ed with such a definition, we can miscompile; so it's quite important to get this right. Defining runtime functions locally is quite common in embedded applications. llvm-svn: 176286
* Better support for constructors with -cxx-abi microsoft, partly fixes PR12784Timur Iskhodzhanov2013-02-271-0/+7
| | | | llvm-svn: 176186
* ubsan: Emit bounds checks for array indexing, vector indexing, and (in ↵Richard Smith2013-02-231-1/+8
| | | | | | really simple cases) pointer arithmetic. This augments the existing bounds checking with language-level array bounds information. llvm-svn: 175949
* Re-apply r174919 - smarter copy/move assignment/construction, with fixes forLang Hames2013-02-171-0/+1
| | | | | | | | | | | bitfield related issues. The original commit broke Takumi's builder. The bug was caused by bitfield sizes being determined by their underlying type, rather than the field info. A similar issue with bitfield alignments showed up on closer testing. Both have been fixed in this patch. llvm-svn: 175389
* ubsan: Add checking for invalid downcasts. Per [expr.static.cast]p2 and p11,Richard Smith2013-02-131-1/+7
| | | | | | | base-to-derived casts have undefined behavior if the object is not actually an instance of the derived type. llvm-svn: 175078
* Emit virtual/deleting destructors properly with -cxx-abi microsoft, PR15058Timur Iskhodzhanov2013-02-131-8/+18
| | | | llvm-svn: 175045
* Backing out r174919 while I investigate a self-host bug on Takumi's builder.Lang Hames2013-02-121-1/+0
| | | | llvm-svn: 174925
* When generating IR for default copy-constructors, copy-assignment operators,Lang Hames2013-02-111-0/+1
| | | | | | | | | | | | | | | | | | | | move-constructors and move-assignment operators, use memcpy to copy adjacent POD members. Previously, classes with one or more Non-POD members would fall back on element-wise copies for all members, including POD members. This often generated a lot of IR. Without padding metadata, it wasn't often possible for the LLVM optimizers to turn the element-wise copies into a memcpy. This code hasn't yet received any serious tuning. I didn't see any serious regressions on a self-hosted clang build, or any of the nightly tests, but I think it's important to get this out in the wild to get more testing. Insights, feedback and comments welcome. Many thanks to David Blaikie, Richard Smith, and especially John McCall for their help and feedback on this work. llvm-svn: 174919
* Fix typo in commentArnaud A. de Grandmaison2013-02-051-2/+2
| | | | llvm-svn: 174359
* Fix exception handling line table problems introduced by r173593David Blaikie2013-02-011-1/+1
| | | | | | | | | | | | | r173593 made us a little too eager to associate all code at the end of a function with the user-written 'return' line. This caused problems with breakpoints as they'd be set in exception handling code preceeding the actual non-exception return handling code, leading to the breakpoint never being hit in non-exceptional execution. This change restores the pre-r173593 exception handling line information where the cleanup code is associated with the '}' not the return line. llvm-svn: 174206
* Destroy arrays and ARC fields when throwing out of ctors.John McCall2013-02-011-0/+2
| | | | | | | | Previously we were only handling non-array fields of class type. Testcases derived from a patch by WenHan Gu. llvm-svn: 174146
* When we're emitting a constructor or destructor call from a delegatingDouglas Gregor2013-01-311-2/+4
| | | | | | | constructor, retrieve our VTT parameter directly. Fixes PR14588 / <rdar://problem/12867962>. llvm-svn: 174042
* [ubsan] Implement the -fcatch-undefined-behavior flag using a trappingChad Rosier2013-01-291-1/+1
| | | | | | | | | | | implementation; this is much more inline with the original implementation (i.e., pre-ubsan) and does not require run-time library support. The trapping implementation can be invoked using either '-fcatch-undefined-behavior' or '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error', with the latter being preferred. Eventually, the -fcatch-undefined-behavior' flag will be removed. llvm-svn: 173848
* PR14566: Debug Info: avoid top level lexical blocks in functionsDavid Blaikie2013-01-261-1/+4
| | | | | | | | | | | | | | | One of the gotchas (see changes to CodeGenFunction) was due to the fix in r139416 (for PR10829). This only worked previously because the top level lexical block would set the location to the end of the function, the debug location would be updated (as per r139416), the location would be set to the end of the function again (but that would no-op, since it was the same as the previous location), then the return instruction would be emitted using the debug location. Once the top level lexical block was no longer emitted, the end-of-function location change was causing the debug loc to be updated, regressing that bug. llvm-svn: 173593
* patch for PR9027 and // rdar://11861085Fariborz Jahanian2013-01-251-3/+13
| | | | | | | | | | | Title: [PR9027] volatile struct bug: member is not loaded at -O; This is caused by last flag passed to @llvm.memcpy being false, not honoring that aggregate has at least one 'volatile' data member (even though aggregate itself has not been qualified as 'volatile'. As a result, optimization optimizes away the memcpy altogether. Patch review by John MaCall (I still need to fix up a test though). llvm-svn: 173535
* [ubsan] Add support for -fsanitize-blacklistWill Dietz2013-01-181-1/+4
| | | | llvm-svn: 172808
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-3/+3
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Don't assert/crash on reference variables in lambdas bound to aEli Friedman2013-01-031-5/+0
| | | | | | static local variable from the parent scope. PR14773. llvm-svn: 171433
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-8/+8
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* [ubsan] Add flag to enable recovery from checks when possible.Will Dietz2012-12-021-1/+11
| | | | llvm-svn: 169114
* Fix the Objective-C exception rethrow from cleanups (GNU runtimes). Note thatDavid Chisnall2012-11-071-1/+1
| | | | | | | a bug in the inliner still causes the wrong thing to happen at -O2 and above (PR14116). llvm-svn: 167534
* Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith2012-11-051-2/+3
| | | | | | | checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. llvm-svn: 167413
* Split emission of -ftrapv checks and -fcatch-undefined-behavior checks intoRichard Smith2012-11-011-2/+7
| | | | | | separate functions, since they share essentially no code. llvm-svn: 167259
* -fcatch-undefined-behavior checking for appropriate vptr value: Clang ↵Richard Smith2012-10-251-2/+5
| | | | | | CodeGen side. llvm-svn: 166661
* At -O0, prefer objc_storeStrong with a null new value to theJohn McCall2012-10-171-0/+1
| | | | | | | | | | | combination of a load+objc_release; this is generally better for tools that try to track why values are retained and released. Also use objc_storeStrong when copying a block (again, only at -O0), which requires us to do a preliminary store of null in order to compensate for objc_storeStrong's assign semantics. llvm-svn: 166085
* Transform pattern:Alexey Samsonov2012-10-161-0/+8
| | | | | | | | | | | if (CGM.getModuleDebugInfo()) DebugInfo = CGM.getModuleDebugInfo() into a call: maybeInitializeDebugInfo(); This is a simplification for a possible future fix of PR13942. llvm-svn: 166019
* Add codegen support for __uuidof().Nico Weber2012-10-111-0/+2
| | | | llvm-svn: 165710
* -fcatch-undefined-behavior: emit calls to the runtime library whenever one ↵Richard Smith2012-10-091-3/+18
| | | | | | of the checks fails. llvm-svn: 165536
* CodeGen: Copy tail padding when we're not dealing with a trivial copy assign ↵Benjamin Kramer2012-09-301-1/+14
| | | | | | | | | | or move assign operator. This fixes a regression from r162254, the optimizer has problems reasoning about the smaller memcpy as it's often not safe to widen a store but making it smaller is. llvm-svn: 164917
* Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. ↵Sylvestre Ledru2012-09-271-2/+2
| | | | | | See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164766 llvm-svn: 164769
* Fix a typo 'iff' => 'if'Sylvestre Ledru2012-09-271-2/+2
| | | | llvm-svn: 164766
* Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.Dmitri Gribenko2012-09-151-6/+6
| | | | llvm-svn: 163983
* -fcatch-undefined-behavior: Factor emission of the creation of, and branch to,Richard Smith2012-09-081-17/+16
| | | | | | | | | the trap BB out of the individual checks and into a common function, to prepare for making this code call into a runtime library. Rename the existing EmitCheck to EmitTypeCheck to clarify it and to move it out of the way of the new EmitCheck. llvm-svn: 163451
* [ms-inline asm] Have MSAsmStmts use the generic EmitAsmStmt codegen function.Chad Rosier2012-08-281-1/+0
| | | | llvm-svn: 162796
* [ms-inline asm] Rename EmitGCCAsmStmt to EmitAsmStmt and have it accept Chad Rosier2012-08-281-1/+1
| | | | | | | | AsmStmts. This function is only used by GCCAsmStmts, however. Constraints need to be properly computed before MSAsmStmts can use EmitAsmStmt. No functional change intended. llvm-svn: 162776
* [ms-inline asm] As part of a larger refactoring, rename AsmStmt to GCCAsmStmt.Chad Rosier2012-08-251-1/+1
| | | | | | No functional change intended. llvm-svn: 162632
* New -fcatch-undefined-behavior features:Richard Smith2012-08-241-2/+24
| | | | | | | | * when checking that a pointer or reference refers to appropriate storage for a type, also check the alignment and perform a null check * check that references are bound to appropriate storage * check that 'this' has appropriate storage in member accesses and member function calls llvm-svn: 162523
* [ms-inline asm] Remove an unused argument. This logic can now be reused by theChad Rosier2012-08-231-4/+2
| | | | | | ms-style inline asms. llvm-svn: 162463
* Fix a bunch of -Wdocumentation warnings.Dmitri Gribenko2012-08-231-3/+2
| | | | llvm-svn: 162452
* Use the alignment from lvalue emission to more accurately compute the alignmentEli Friedman2012-08-231-9/+3
| | | | | | | of a pointer for builtin emission, instead of just depending on the type of the pointee. <rdar://problem/11314941>. llvm-svn: 162425
* Fix an assertion failure with a C++ constructor initializing aEli Friedman2012-08-081-3/+0
| | | | | | member of reference type in an anonymous struct. PR13154. llvm-svn: 161473
* Change APInt to APSInt in one instance. Also change a call to operator==() toRichard Trieu2012-07-231-1/+1
| | | | | | APSInt::isSameValue() when comparing different sized APSInt's. llvm-svn: 160641
* Revert commit r160308. We decide to move builtins selection to the backend.Simon Atanasyan2012-07-171-1/+0
| | | | llvm-svn: 160353
* MIPS: Implement __builtin_mips_shll_qb builtin function overloading.Simon Atanasyan2012-07-161-0/+1
| | | | | | | This function has two versions. The first one is used for a register operand. The second one is used for an immediate number. llvm-svn: 160308
* Temporarily revert this to see if it brings the gdb bot back.Eric Christopher2012-07-111-7/+2
| | | | llvm-svn: 160049
* The end of a block doesn't necessarily need a line table entry unlessEric Christopher2012-07-111-2/+7
| | | | | | | | | | there's something going on there. Remove the unconditional line entry and only add one if we're emitting cleanups (any other statements would be handled normally). Fixes rdar://9199234 llvm-svn: 160033
* Patch by Anton Lokhmotov to add OpenCL work group size attributes.Tanya Lattner2012-07-091-0/+10
| | | | llvm-svn: 159965
* Significantly simplify CGExprAgg's logic about ignored results:John McCall2012-07-021-4/+5
| | | | | | | | | | | | if we want to ignore a result, the Dest will be null. Otherwise, we must copy into it. This means we need to ensure a slot when loading from a volatile l-value. With all that in place, fix a bug with chained assignments into __block variables of aggregate type where we were losing insight into the actual source of the value during the second assignment. llvm-svn: 159630
* Dead code eliminate the massive hexagon builtin intrinsic supporting code.Benjamin Kramer2012-06-281-2/+0
| | | | | | | | The tablegen'd code does the same thing without this egregious duplication. In my limited testing everything seems to work, however there can be differences if the clang and llvm builtin definitions don't match. llvm-svn: 159371
* Support MIPS DSP Rev1 intrinsics. Simon Atanasyan2012-06-281-0/+1
| | | | | | This patch was reviewed in the llvm-commits list by Jim Grosbach. llvm-svn: 159366
OpenPOWER on IntegriCloud