summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBlocks.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [CodeGenObjCXX] Don't rematerialize default arguments of functionAkira Hatanaka2016-05-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | parameters in the body of a block. This fixes a bug where clang would materialize the default argument inside the body of a block instead of passing the value via the block descriptor. For example, in the code below, foo1 would always print 42 regardless of the value of argument "a" passed to foo1. void foo1(const int a = 42 ) { auto block = ^{ printf("%d\n", a); }; block(); } rdar://problem/24449235 llvm-svn: 268314
* Preserve ExtParameterInfos into CGFunctionInfo.John McCall2016-03-111-11/+10
| | | | | | | | | As part of this, make the function-arrangement interfaces a little simpler and more semantic. NFC. llvm-svn: 263191
* Move DebugInfoKind into its own header to cut the cyclic dependency edge ↵Benjamin Kramer2016-02-021-4/+4
| | | | | | from Driver to Frontend. llvm-svn: 259489
* Update for LLVM function name change.Rui Ueyama2016-01-141-2/+2
| | | | llvm-svn: 257802
* [PGO] Instrument only base constructors and destructors.Serge Pavlov2015-12-061-1/+1
| | | | | | | | | | | | | | | | Constructors and destructors may be represented by several functions in IR. Only base structors correspond to source code, others are small pieces of code and eventually call the base variant. In this case instrumentation of non-base structors has little sense, this fix remove it. Now profile data of a declaration corresponds to exactly one function in IR, it agrees with the current logic of the profile data loading. This change fixes PR24996. Differential Revision: http://reviews.llvm.org/D15158 llvm-svn: 254876
* Don't actually add the __unsafe_unretained qualifier in MRC;John McCall2015-11-191-3/+9
| | | | | | | | | | | driving a canonical difference between that and an unqualified type is a really bad idea when both are valid. Instead, remember that it was there in a non-canonical way, then look for that in the one place we really care about it: block captures. The net effect closely resembles the behavior of a decl attribute, except still closely following ARC's standard qualifier parsing rules. llvm-svn: 253534
* CodeGen: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-11-061-4/+3
| | | | | | | Make ilist iterator conversions explicit in clangCodeGen. Eventually I'll remove them everywhere. llvm-svn: 252358
* Define weak and __weak to mean ARC-style weak references, even in MRC.John McCall2015-10-221-34/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, __weak was silently accepted and ignored in MRC mode. That makes this a potentially source-breaking change that we have to roll out cautiously. Accordingly, for the time being, actual support for __weak references in MRC is experimental, and the compiler will reject attempts to actually form such references. The intent is to eventually enable the feature by default in all non-GC modes. (It is, of course, incompatible with ObjC GC's interpretation of __weak.) If you like, you can enable this feature with -Xclang -fobjc-weak but like any -Xclang option, this option may be removed at any point, e.g. if/when it is eventually enabled by default. This patch also enables the use of the ARC __unsafe_unretained qualifier in MRC. Unlike __weak, this is being enabled immediately. Since variables are essentially __unsafe_unretained by default in MRC, the only practical uses are (1) communication and (2) changing the default behavior of by-value block capture. As an implementation matter, this means that the ObjC ownership qualifiers may appear in any ObjC language mode, and so this patch removes a number of checks for getLangOpts().ObjCAutoRefCount that were guarding the processing of these qualifiers. I don't expect this to be a significant drain on performance; it may even be faster to just check for these qualifiers directly on a type (since it's probably in a register anyway) than to do N dependent loads to grab the LangOptions. rdar://9674298 llvm-svn: 251041
* Roll-back r250822.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* [CodeGen] [CodeGen] Attach function attributes to functions created inAkira Hatanaka2015-10-081-0/+11
| | | | | | | | | | | | | | | | | | CGBlocks.cpp. This commit fixes a bug in clang's code-gen where it creates the following functions but doesn't attach function attributes to them: __copy_helper_block_ __destroy_helper_block_ __Block_byref_object_copy_ __Block_byref_object_dispose_ rdar://problem/20828324 Differential Revision: http://reviews.llvm.org/D13525 llvm-svn: 249735
* Fix Clang-tidy modernize-use-nullptr warnings in source directories; other ↵Hans Wennborg2015-10-061-6/+4
| | | | | | | | | | minor cleanups Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13406 llvm-svn: 249484
* When comparing two block captures for layout, don't crashJohn McCall2015-09-111-1/+1
| | | | | | | | if they have the same alignment and one was 'this'. Fixes PR24780. llvm-svn: 247482
* Compute and preserve alignment more faithfully in IR-generation.John McCall2015-09-081-386/+391
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an Address type to bundle a pointer value with an alignment. Introduce APIs on CGBuilderTy to work with Address values. Change core APIs on CGF/CGM to traffic in Address where appropriate. Require alignments to be non-zero. Update a ton of code to compute and propagate alignment information. As part of this, I've promoted CGBuiltin's EmitPointerWithAlignment helper function to CGF and made use of it in a number of places in the expression emitter. The end result is that we should now be significantly more correct when performing operations on objects that are locally known to be under-aligned. Since alignment is not reliably tracked in the type system, there are inherent limits to this, but at least we are no longer confused by standard operations like derived-to-base conversions and array-to-pointer decay. I've also fixed a large number of bugs where we were applying the complete-object alignment to a pointer instead of the non-virtual alignment, although most of these were hidden by the very conservative approach we took with member alignment. Also, because IRGen now reliably asserts on zero alignments, we should no longer be subject to an absurd but frustrating recurring bug where an incomplete type would report a zero alignment and then we'd naively do a alignmentAtOffset on it and emit code using an alignment equal to the largest power-of-two factor of the offset. We should also now be emitting much more aggressive alignment attributes in the presence of over-alignment. In particular, field access now uses alignmentAtOffset instead of min. Several times in this patch, I had to change the existing code-generation pattern in order to more effectively use the Address APIs. For the most part, this seems to be a strict improvement, like doing pointer arithmetic with GEPs instead of ptrtoint. That said, I've tried very hard to not change semantics, but it is likely that I've failed in a few places, for which I apologize. ABIArgInfo now always carries the assumed alignment of indirect and indirect byval arguments. In order to cut down on what was already a dauntingly large patch, I changed the code to never set align attributes in the IR on non-byval indirect arguments. That is, we still generate code which assumes that indirect arguments have the given alignment, but we don't express this information to the backend except where it's semantically required (i.e. on byvals). This is likely a minor regression for those targets that did provide this information, but it'll be trivial to add it back in a later patch. I partially punted on applying this work to CGBuiltin. Please do not add more uses of the CreateDefaultAligned{Load,Store} APIs; they will be going away eventually. llvm-svn: 246985
* Devirtualize EHScopeStack::Cleanup's dtor because it's never destroyed ↵David Blaikie2015-08-181-1/+1
| | | | | | polymorphically llvm-svn: 245378
* Wdeprecated: ByrefHelpers are copy constructed by the ::buildByrefHelpers ↵David Blaikie2015-08-131-22/+22
| | | | | | | | | | | | | helper, make sure they're safely copyable Make the copy/move ctors protected and defaulted in the base, make the derived classes final to avoid exposing any slicing-prone APIs. Also, while I'm here, simplify the use of buildByrefHelpers by taking the parameter by value instead of non-const ref. None of the callers care aobut observing the state after the call. llvm-svn: 244990
* Pass an iterator range to EmitCallArgsDavid Blaikie2015-07-211-2/+1
| | | | llvm-svn: 242824
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-2/+2
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-2/+2
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* InstrProf: Stop using RegionCounter outside of CodeGenPGO (NFC)Justin Bogner2015-04-231-2/+1
| | | | | | | | | The RegionCounter type does a lot of legwork, but most of it is only meaningful within the implementation of CodeGenPGO. The uses elsewhere in CodeGen generally just want to increment or read counters, so do that directly. llvm-svn: 235664
* clang-format my last commitDavid Blaikie2015-04-051-28/+35
| | | | | | (sorry, keep forgetting that) llvm-svn: 234129
* [opaque pointer type] More GEP API migrationsDavid Blaikie2015-04-051-38/+44
| | | | | | | Looks like the VTable code in particular will need some work to pass around the pointee type explicitly. llvm-svn: 234128
* Prefer SmallVector::append/insert over push_back loops. Clang edition.Benjamin Kramer2015-02-171-2/+1
| | | | | | Same functionality, but hoists the vector growth out of the loop. llvm-svn: 229508
* Address review feedback for r228003.Adrian Prantl2015-02-031-6/+5
| | | | | | | - use named constructors - get rid of MarkAsPrologue llvm-svn: 228021
* Merge ArtificialLocation into ApplyDebugLocation and make a clearAdrian Prantl2015-02-031-6/+6
| | | | | | | | | | | | | | | | distinction between the different use-cases. With the previous default behavior we would occasionally emit empty debug locations in situations where they actually were strictly required (= on invoke insns). We now have a choice between defaulting to an empty location or an artificial location. Specifically, this fixes a bug caused by a missing debug location when emitting C++ EH cleanup blocks from within an artificial function, such as an ObjC destroy helper function. rdar://problem/19670595 llvm-svn: 228003
* Reapply r225000 (reverted in r225555): DebugInfo: Generalize debug info ↵David Blaikie2015-01-141-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | location handling (and follow-up commits). Several pieces of code were relying on implicit debug location setting which usually lead to incorrect line information anyway. So I've fixed those (in r225955 and r225845) separately which should pave the way for this commit to be cleanly reapplied. The reason these implicit dependencies resulted in crashes with this patch is that the debug location would no longer implicitly leak from one place to another, but be set back to invalid. Once a call with no/invalid location was emitted, if that call was ever inlined it could produce invalid debugloc chains and assert during LLVM's codegen. There may be further cases of such bugs in this patch - they're hard to flush out with regression testing, so I'll keep an eye out for reports and investigate/fix them ASAP if they come up. Original commit message: Reapply "DebugInfo: Generalize debug info location handling" Originally committed in r224385 and reverted in r224441 due to concerns this change might've introduced a crash. Turns out this change fixes the crash introduced by one of my earlier more specific location handling changes (those specific fixes are reverted by this patch, in favor of the more general solution). Recommitted in r224941 and reverted in r224970 after it caused a crash when building compiler-rt. Looks to be due to this change zeroing out the debug location when emitting default arguments (which were meant to inherit their outer expression's location) thus creating call instructions without locations - these create problems for inlining and must not be created. That is fixed and tested in this version of the change. Original commit message: This is a more scalable (fixed in mostly one place, rather than many places that will need constant improvement/maintenance) solution to several commits I've made recently to increase source fidelity for subexpressions. This resetting had to be done at the DebugLoc level (not the SourceLocation level) to preserve scoping information (if the resetting was done with CGDebugInfo::EmitLocation, it would've caused the tail end of an expression's codegen to end up in a potentially different scope than the start, even though it was at the same source location). The drawback to this is that it might leave CGDebugInfo out of sync. Ideally CGDebugInfo shouldn't have a duplicate sense of the current SourceLocation, but for now it seems it does... - I don't think I'm going to tackle removing that just now. I expect this'll probably cause some more buildbot fallout & I'll investigate that as it comes up. Also these sort of improvements might be starting to show a weakness/bug in LLVM's line table handling: we don't correctly emit is_stmt for statements, we just put it on every line table entry. This means one statement split over multiple lines appears as multiple 'statements' and two statements on one line (without column info) are treated as one statement. I don't think we have any IR representation of statements that would help us distinguish these cases and identify the beginning of each statement - so that might be something we need to add (possibly to the lexical scope chain - a scope for each statement). This does cause some problems for GDB and possibly other DWARF consumers. llvm-svn: 225956
* DebugInfo: Correct the location of EH cleanup for blocksDavid Blaikie2015-01-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | This was previously piggybacking on whatever happened to be the last location set on CGDebugInfo/DIBuilder, which was wrong (it was often the current location, such as the 'fn()' call site, not the end of the block). With my improvements to set/unset the location in a scoped manner (r225000) this went from a bad quality situation, to a crash. Fixing this goes part-way to unblocking the recommit of r225000. It's likely that any call to CodeGenFunction::StartFunction without the CurEHLocation set represents a similar bug or risk of a bug. Perhaps there are some callers that know they won't generate EH cleanups, but I'm not sure. I considered a generic catch-fix in StartFunction (just fallback to the GlobalDecl's location) but that seemed like it'd mask bugs where the EH location shouldn't be the same as the decl's location (& indeed by not using that stop-gap I found this bug). We'll see how long I can hold out on the generic catch-all. I might eventually be able to add an assertion in. llvm-svn: 225845
* Rename RefersToCapturedVariable to RefersToEnclosingVariableOrCapture, NFCAlexey Bataev2015-01-121-6/+7
| | | | llvm-svn: 225624
* Revert "DebugInfo: Generalize debug info location handling" and related commitsDavid Blaikie2015-01-091-6/+6
| | | | | | | | | | | | This reverts commit r225000, r225021, r225083, r225086, r225090. The root change (r225000) still has several issues where it's caused calls to be emitted without debug locations. This causes assertion failures if/when those calls are inlined. I'll work up some test cases and fixes before recommitting this. llvm-svn: 225555
* Reapply "DebugInfo: Generalize debug info location handling"David Blaikie2014-12-301-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally committed in r224385 and reverted in r224441 due to concerns this change might've introduced a crash. Turns out this change fixes the crash introduced by one of my earlier more specific location handling changes (those specific fixes are reverted by this patch, in favor of the more general solution). Recommitted in r224941 and reverted in r224970 after it caused a crash when building compiler-rt. Looks to be due to this change zeroing out the debug location when emitting default arguments (which were meant to inherit their outer expression's location) thus creating call instructions without locations - these create problems for inlining and must not be created. That is fixed and tested in this version of the change. Original commit message: This is a more scalable (fixed in mostly one place, rather than many places that will need constant improvement/maintenance) solution to several commits I've made recently to increase source fidelity for subexpressions. This resetting had to be done at the DebugLoc level (not the SourceLocation level) to preserve scoping information (if the resetting was done with CGDebugInfo::EmitLocation, it would've caused the tail end of an expression's codegen to end up in a potentially different scope than the start, even though it was at the same source location). The drawback to this is that it might leave CGDebugInfo out of sync. Ideally CGDebugInfo shouldn't have a duplicate sense of the current SourceLocation, but for now it seems it does... - I don't think I'm going to tackle removing that just now. I expect this'll probably cause some more buildbot fallout & I'll investigate that as it comes up. Also these sort of improvements might be starting to show a weakness/bug in LLVM's line table handling: we don't correctly emit is_stmt for statements, we just put it on every line table entry. This means one statement split over multiple lines appears as multiple 'statements' and two statements on one line (without column info) are treated as one statement. I don't think we have any IR representation of statements that would help us distinguish these cases and identify the beginning of each statement - so that might be something we need to add (possibly to the lexical scope chain - a scope for each statement). This does cause some problems for GDB and possibly other DWARF consumers. llvm-svn: 225000
* Revert "DebugInfo: Generalize debug info location handling"David Blaikie2014-12-291-6/+6
| | | | | | | | | Asserting when building compiler-rt when using a GCC host compiler. Reverting while I investigate. This reverts commit r224941. llvm-svn: 224970
* Reapply "DebugInfo: Generalize debug info location handling"David Blaikie2014-12-291-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally committed in r224385 and reverted in r224441 due to concerns this change might've introduced a crash. Turns out this change fixes the crash introduced by one of my earlier more specific location handling changes (those specific fixes are reverted by this patch, in favor of the more general solution). Original commit message: This is a more scalable (fixed in mostly one place, rather than many places that will need constant improvement/maintenance) solution to several commits I've made recently to increase source fidelity for subexpressions. This resetting had to be done at the DebugLoc level (not the SourceLocation level) to preserve scoping information (if the resetting was done with CGDebugInfo::EmitLocation, it would've caused the tail end of an expression's codegen to end up in a potentially different scope than the start, even though it was at the same source location). The drawback to this is that it might leave CGDebugInfo out of sync. Ideally CGDebugInfo shouldn't have a duplicate sense of the current SourceLocation, but for now it seems it does... - I don't think I'm going to tackle removing that just now. I expect this'll probably cause some more buildbot fallout & I'll investigate that as it comes up. Also these sort of improvements might be starting to show a weakness/bug in LLVM's line table handling: we don't correctly emit is_stmt for statements, we just put it on every line table entry. This means one statement split over multiple lines appears as multiple 'statements' and two statements on one line (without column info) are treated as one statement. I don't think we have any IR representation of statements that would help us distinguish these cases and identify the beginning of each statement - so that might be something we need to add (possibly to the lexical scope chain - a scope for each statement). This does cause some problems for GDB and possibly other DWARF consumers. llvm-svn: 224941
* Revert "DebugInfo: Generalize debug info location handling"David Blaikie2014-12-171-6/+6
| | | | | | | | | Fails an ASan bootstrap - I'll try to reproduce locally & sort that out before recommitting. This reverts commit r224385. llvm-svn: 224441
* DebugInfo: Generalize debug info location handlingDavid Blaikie2014-12-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a more scalable (fixed in mostly one place, rather than many places that will need constant improvement/maintenance) solution to several commits I've made recently to increase source fidelity for subexpressions. This resetting had to be done at the DebugLoc level (not the SourceLocation level) to preserve scoping information (if the resetting was done with CGDebugInfo::EmitLocation, it would've caused the tail end of an expression's codegen to end up in a potentially different scope than the start, even though it was at the same source location). The drawback to this is that it might leave CGDebugInfo out of sync. Ideally CGDebugInfo shouldn't have a duplicate sense of the current SourceLocation, but for now it seems it does... - I don't think I'm going to tackle removing that just now. I expect this'll probably cause some more buildbot fallout & I'll investigate that as it comes up. Also these sort of improvements might be starting to show a weakness/bug in LLVM's line table handling: we don't correctly emit is_stmt for statements, we just put it on every line table entry. This means one statement split over multiple lines appears as multiple 'statements' and two statements on one line (without column info) are treated as one statement. I don't think we have any IR representation of statements that would help us distinguish these cases and identify the beginning of each statement - so that might be something we need to add (possibly to the lexical scope chain - a scope for each statement). This does cause some problems for GDB and possibly other DWARF consumers. llvm-svn: 224385
* DebugInfo: Correct the location of initializations of auto.David Blaikie2014-12-091-1/+4
| | | | llvm-svn: 223839
* InstrProf: Use LLVM's -instrprof pass for profilingJustin Bogner2014-12-081-2/+0
| | | | | | | | The logic for lowering profiling counters has been moved to an LLVM pass. Emit the intrinsics rather than duplicating the whole pass in clang. llvm-svn: 223683
* Use nullptr to silence -Wsentinel when self-hosting on WindowsReid Kleckner2014-12-011-2/+2
| | | | | | | | | | | Richard rejected my Sema change to interpret an integer literal zero in a varargs context as a null pointer, so -Wsentinel sees an integer literal zero and fires off a warning. Only CodeGen currently knows that it promotes integer literal zeroes in this context to pointer size on Windows. I didn't want to teach -Wsentinel about that compatibility hack. Therefore, I'm migrating to C++11 nullptr. llvm-svn: 223079
* Debug info for blocks: Fix a bug caught by the Verifier.Adrian Prantl2014-11-211-1/+3
| | | | | | | | | | | | When emitting nested block definitions, the insert-at-point variant of DIBuilder::insertDeclare() could be called with the insertion point set to the end-of-BasicBlock sentinel, causing the parent pointer of the CallInst to be set to the intentionally bogus value of the sentinel. Fixed by conditionally invoking the correct version of insertDeclare(). rdar://problem/19034882 llvm-svn: 222487
* Fix a crash when compiling blocks in OpenCL with multiplePekka Jaaskelainen2014-08-141-1/+7
| | | | | | address spaces. llvm-svn: 215629
* Objective-C. Fixes an assert where because of capturedFariborz Jahanian2014-08-121-0/+10
| | | | | | | | variable in block is over-aligned with an align attribute causing block metadata size not be multiple of alignment. rdar://17878679 llvm-svn: 215449
* Implement -Wframe-larger-than backend diagnosticAlp Toker2014-06-051-1/+1
| | | | | | | | | | | | | | | | | | Add driver and frontend support for the GCC -Wframe-larger-than=bytes warning. This is the first GCC-compatible backend diagnostic built around LLVM's reporting feature. This commit adds infrastructure to perform reverse lookup from mangled names emitted after LLVM IR generation. We use that to resolve precise locations and originating AST functions, lambdas or block declarations to produce seamless codegen-guided diagnostics. An associated change, StringMap now maintains unique mangled name strings instead of allocating copies. This is a net memory saving in C++ and a small hit for C where we no longer reuse IdentifierInfo storage, pending further optimisation. llvm-svn: 210293
* Eliminate redundant MangleBuffer classAlp Toker2014-06-031-5/+3
| | | | | | | | | The only remaining user didn't actually use the non-dynamic storage facility this class provides. The std::string is transitional and likely to be StringRefized shortly. llvm-svn: 210058
* [C++11] Use 'nullptr'. CodeGen edition.Craig Topper2014-05-211-33/+39
| | | | llvm-svn: 209272
* If a declaration is loaded, and then a module import adds a redeclaration, thenRichard Smith2014-05-161-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ensure that querying the first declaration for its most recent declaration checks for redeclarations from the imported module. This works as follows: * The 'most recent' pointer on a canonical declaration grows a pointer to the external AST source and a generation number (space- and time-optimized for the case where there is no external source). * Each time the 'most recent' pointer is queried, if it has an external source, we check whether it's up to date, and update it if not. * The ancillary data stored on the canonical declaration is allocated lazily to avoid filling it in for declarations that end up being non-canonical. We'll still perform a redundant (ASTContext) allocation if someone asks for the most recent declaration from a decl before setPreviousDecl is called, but such cases are probably all bugs, and are now easy to find. Some finessing is still in order here -- in particular, we use a very general mechanism for handling the DefinitionData pointer on CXXRecordData, and a more targeted approach would be more compact. Also, the MayHaveOutOfDateDef mechanism should now be expunged, since it was addressing only a corner of the full problem space here. That's not covered by this patch. Early performance benchmarks show that this makes no measurable difference to Clang performance without modules enabled (and fixes a major correctness issue with modules enabled). I'll revert if a full performance comparison shows any problems. llvm-svn: 209046
* Use auto to avoid duplicating the type.Rafael Espindola2014-05-091-4/+4
| | | | llvm-svn: 208374
* Use predicate function to simplify a bit.Rafael Espindola2014-05-081-2/+1
| | | | llvm-svn: 208312
* Cleanup: Add default arguments to CodeGenFunction::StartFunction.Adrian Prantl2014-04-111-4/+4
| | | | | | Thanks dblaikie for the suggestion! llvm-svn: 206012
* 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
OpenPOWER on IntegriCloud