summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBlocks.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Debug info: (Bugfix) Make sure artificial functions like _GLOBAL__I_aAdrian Prantl2014-04-101-4/+5
| | | | | | | | | | | | | | | | are not associated with any source lines. Previously, if the Location of a Decl was empty, EmitFunctionStart would just keep using CurLoc, which would sometimes be correct (e.g., thunks) but in other cases would just point to a hilariously random location. This patch fixes this by completely eliminating all uses of CurLoc from EmitFunctionStart and rather have clients explicitly pass in a SourceLocation for the function header and the function body. rdar://problem/14985269 llvm-svn: 205999
* ObjC: allow targets to decide when to use stret for blocks.Tim Northover2014-03-291-1/+1
| | | | | | | This was originally part of the ARM64 patch, but seems semantically separate. llvm-svn: 205097
* PGO: Statically generate data structuresDuncan P. N. Exon Smith2014-03-171-1/+1
| | | | | | | | | | | | | | | | | | | In instrumentation-based profiling, we need a set of data structures to represent the counters. Previously, these were built up during static initialization. Now, they're shoved into a specially-named section so that they show up as an array. As a consequence of the reorganizing symbols, instrumentation data structures for linkonce functions are now correctly coalesced. This is the first step in a larger project to minimize runtime overhead and dependencies in instrumentation-based profilng. The larger picture includes removing all initialization overhead and making the dependency on libc optional. <rdar://problem/15943240> llvm-svn: 204080
* [C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with ↵Aaron Ballman2014-03-141-40/+32
| | | | | | iterator_range captures(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203958
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-17/+17
| | | | | | class. llvm-svn: 203643
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-1/+1
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* [C++11] Replacing BlockDecl iterators param_begin() and param_end() with ↵Aaron Ballman2014-03-071-3/+2
| | | | | | iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203250
* PGO: Add support for Objective-C blocks.Bob Wilson2014-03-061-1/+7
| | | | llvm-svn: 203157
* [Modules] Update to reflect the move of CallSite into the IR library inChandler Carruth2014-03-041-1/+1
| | | | | | LLVM r202816. llvm-svn: 202817
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-021-2/+2
| | | | llvm-svn: 202639
* [ms-cxxabi] Use x86_cdeclmethodcc for __cdecl methods on win32Reid Kleckner2014-01-311-17/+9
| | | | | | | | | | | | | | | | | | | This fixes PR15768, where the sret parameter and the 'this' parameter are in the wrong order. Instance methods compiled by MSVC never return records in registers, they always return indirectly through an sret pointer. That sret pointer always comes after the 'this' parameter, for both __cdecl and __thiscall methods. Unfortunately, the same is true for other calling conventions, so we'll have to change the overall approach here relatively soon. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2664 llvm-svn: 200587
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-5/+4
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-051-1/+1
| | | | llvm-svn: 196510
* Thread a SourceLocation into the EmitCheck for "load_invalid_value". This occursNick Lewycky2013-10-021-2/+2
| | | | | | when scalars are loaded / undergo lvalue-to-rvalue conversion. llvm-svn: 191808
* Simplify/clean up debug info suppression in CodeGenFunctionDavid Blaikie2013-08-261-12/+0
| | | | | | | | | | CodeGenFunction is run on only one function - a new object is made for each new function. I would add an assertion/flag to this effect, but there's an exception: ObjC properties involve emitting helper functions that are all emitted by the same CodeGenFunction object, so such a check is not possible/correct. llvm-svn: 189277
* Debug Info: Fix an oversight of r186553. Ensure that the function prologueAdrian Prantl2013-07-241-4/+6
| | | | | | of an artificial function gets an artificial location as well. llvm-svn: 187074
* s/BuiltinLocation/ArtificialLocation/Adrian Prantl2013-07-181-2/+2
| | | | llvm-svn: 186557
* Don't generate bogus line table entries for __copy_helper_block_ andAdrian Prantl2013-07-181-0/+4
| | | | | | __destroy_helper_block_, but do generate scope information. llvm-svn: 186553
* Replace llvm::DIBuilder::DisableDebugLocations() with two RAII interfacesAdrian Prantl2013-07-181-2/+1
| | | | | | | | | | | | | inspired by CodegenFunction::LexicalScope. - NoLocation temporarily turns off debug locations altogether. This is useful for emitting instructions that should be counted towards the function prologue. - BuiltinLocation temporarily switches to an artificial debug location that has a valid scope, but no line information. This is useful when emitting compiler-generated helper functions that have no source location associated with them. llvm-svn: 186552
* Compute 'this' correctly for block in lambda.Eli Friedman2013-07-121-8/+3
| | | | | | | | | Using CurFuncDecl is both correct and simple compared to crawling the DeclContexts of the block. Fixes <rdar://problem/14415072>. llvm-svn: 186210
* Comment: use \code...\endcode for code examplesDmitri Gribenko2013-05-081-1/+3
| | | | llvm-svn: 181481
* unbreak buildbot.Fariborz Jahanian2013-05-081-1/+1
| | | | llvm-svn: 181479
* Correctly emit certain implicit references to 'self' even withinJohn McCall2013-05-031-22/+3
| | | | | | | | | | | | | | | | | | a lambda. Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation functions. Fix that by generally improving getNonClosureContext to look through lambdas and captured statements but only report code contexts, which is generally what's wanted. Audit uses of CurFuncDecl and getNonClosureAncestor for correctness. Bug #2 is that lambdas weren't specially mapping 'self' when inside an ObjC method. Fix that by removing the requirement for that and using the normal EmitDeclRefLValue path in LoadObjCSelf. rdar://13800041 llvm-svn: 181000
* Use a more idiomatic way to disable debug locations.Adrian Prantl2013-05-021-4/+2
| | | | llvm-svn: 180931
* Standardize accesses to the TargetInfo in IR-gen.John McCall2013-04-161-1/+2
| | | | | | Patch by Stephen Lin! llvm-svn: 179638
* Don't copy just to capture a strong block pointer under ARC.John McCall2013-04-081-7/+27
| | | | | | | | | It turns out that the optimizer can't eliminate this without extra information, for which there's a separate bug. rdar://13588325 llvm-svn: 179069
* fix indentationAdrian Prantl2013-04-081-1/+1
| | | | llvm-svn: 179052
* Add 178663 back.Rafael Espindola2013-04-031-4/+0
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-031-0/+4
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. llvm-svn: 178681
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-031-4/+0
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
* un-break remaining gdb buildbot testcases.Adrian Prantl2013-04-021-0/+6
| | | | | | | Make sure we do not generate line info for debugging-related frame setup. Follow-up to r178361 / rdar://problem/12767564 llvm-svn: 178517
* Bugfix/Followup for r177086.Adrian Prantl2013-03-291-15/+14
| | | | | | | | | * Store the .block_descriptor (instead of self) in the alloca so we can guarantee that all captured variables are available at -O0. * Add the missing OpDeref for the alloca. rdar://problem/12767564 llvm-svn: 178361
* Allocate stack storage for .block_descriptor and captured self at -O0.Adrian Prantl2013-03-141-2/+16
| | | | | | | | | This way the register allocator will not optimize away the debug info for captured variables. Fixes rdar://problem/12767564 llvm-svn: 177086
* Tighten up the rules for precise lifetime and documentJohn McCall2013-03-131-3/+3
| | | | | | | | the requirements on the ARC optimizer. rdar://13407451 llvm-svn: 176924
* Fix the emission of the copy-initialization of a block captureJohn McCall2013-03-041-2/+10
| | | | | | | | from a lambda capture when the capture is not trivially-copyable. rdar://13295759 llvm-svn: 176431
* Use the actual ABI-determined C calling convention for runtimeJohn McCall2013-02-281-7/+27
| | | | | | | | | | | | | | | | | | | | | | 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
* Use the correct field to copy/dispose a __block variable.John McCall2013-01-221-14/+41
| | | | | | | | | | | | | | | We were previously hard-coding a particular field index. This was fine before (because we were obviously guaranteed the presence of a copy/dispose member) except for (1) alignment padding and (2) future extensions adding extra members to the header, such as the extended-layout pointer. Note that we only introduce the extended-layout pointer in the presence of structs. (We also seem to be introducing it even in the presence of an all-non-object layout, but that's a different potential issue.) llvm-svn: 173122
* objC block layout: Patch reorders block layout to Fariborz Jahanian2013-01-171-7/+42
| | | | | | produce more inline layout metadata. // rdar://12752901 llvm-svn: 172683
* In my last patch initialize the destination to null (with a simple store) ↵Fariborz Jahanian2013-01-051-0/+2
| | | | | | | | before doing a storeStrong to it. // rdar://12530881 llvm-svn: 171572
* objective-C arc: in copy helper function for Fariborz Jahanian2013-01-041-0/+5
| | | | | | | | | __strong __block variables, perform objc_storeStrong on source and destination instead of direct move. This is done with -O0 and to improve some analysis. // rdar://12530881 llvm-svn: 171555
* Debug Info: fix the line location for cleanup code of a block functionManman Ren2013-01-041-0/+3
| | | | | | | | | | The line information was changed when emitting debug information for all the DeclRefExprs and we should change it back to get ready for PopClenupBlocks called from FinishFunction. rdar://11562117 llvm-svn: 171493
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-021-2/+2
| | | | | | | | reflect the migration in r171366. Re-sort the #include lines to reflect the new paths. llvm-svn: 171369
* Fix the required args count for variadic blocks.John McCall2012-12-071-1/+1
| | | | | | | | | | | | | | | | | We were emitting calls to blocks as if all arguments were required --- i.e. with signature (A,B,C,D,...) rather than (A,B,...). This patch fixes that and accounts for the implicit block-context argument as a required argument. In addition, this patch changes the function type under which we call unprototyped functions on platforms like x86-64 that guarantee compatibility of variadic functions with unprototyped function types; previously we would always call such functions under the LLVM type T (...)*, but now we will call them under the type T (A,B,C,D,...)*. This last change should have no material effect except for making the type conventions more explicit; it was a side-effect of the most convenient implementation. llvm-svn: 169588
* objective-c blocks: Consider padding due to alignmentFariborz Jahanian2012-12-041-5/+13
| | | | | | | after the fixed size block header when generating captured block variable info. // rdar://12773256 llvm-svn: 169285
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-3/+3
| | | | | | | | | | | | | 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
* objective-C blocks: Make sure that identical logic is usedFariborz Jahanian2012-11-281-3/+2
| | | | | | | | | | in deciding a copy/dispose field is needed in a byref structure and when generating the copy/dispose helpers. In certain cases, these fields were being added but no copy/dispose was being generated. This was uncovered in ARC, but not in MRR. // rdar://12759433 llvm-svn: 168825
* A step towards sorting out handling of triviality of special members in C++11.Richard Smith2012-11-161-1/+1
| | | | | | | | | | | | | | Separate out the notions of 'has a trivial special member' and 'has a non-trivial special member', and use them appropriately. These are not opposites of one another (there might be no special member, or in C++11 there might be a trivial one and a non-trivial one). The CXXRecordDecl predicates continue to produce incorrect results, but do so in fewer cases now, and they document the cases where they might be wrong. No functionality changes are intended here (they will come when the predicates start producing the right answers...). llvm-svn: 168119
* fixes a buildbot failure.Fariborz Jahanian2012-11-141-0/+1
| | | | llvm-svn: 167934
* objective-C blocks: Provide layout map for byrefFariborz Jahanian2012-11-141-5/+72
| | | | | | variables captured in a block. // rdar://12184410 llvm-svn: 167931
* objective-C block meta-data. This patch completes meta-dataFariborz Jahanian2012-11-011-2/+7
| | | | | | | | generation for captured block variables in arc mode. This includes inlined version of the meta-data when it can be done. It also includes severat tests. This is wip. // rdar://12184410. llvm-svn: 167241
OpenPOWER on IntegriCloud