summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [codeview] Don't emit variable templates as class membersReid Kleckner2018-07-201-5/+10
| | | | | | | | | | | | | MSVC doesn't, so neither should we. Fixes PR38004, which is a crash that happens when we try to emit debug info for a still-dependent partial variable template specialization. As a follow-up, we should review what we're doing for function and class member templates. It looks like we don't filter those out, but I can't seem to get clang to emit any. llvm-svn: 337616
* [DebugInfo] Follow-up commit to improve consistency. NFCJonas Devlieghere2018-06-281-112/+106
| | | | | | Follow-up commit for r335757 to address some inconsistencies. llvm-svn: 335834
* [DebugInfo] Emit ObjC methods as part of interfaceJonas Devlieghere2018-06-271-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As brought up during the discussion of the DWARF5 accelerator tables, there is currently no way to associate Objective-C methods with the interface they belong to, other than the .apple_objc accelerator table. After due consideration we came to the conclusion that it makes more sense to follow Pavel's suggestion of just emitting this information in the .debug_info section. One concern was that categories were emitted in the .apple_names as well, but it turns out that LLDB doesn't rely on the accelerator tables for this information. This patch changes the codegen behavior to emit subprograms for structure types, like we do for C++. This will result in the DW_TAG_subprogram being nested as a child under its DW_TAG_structure_type. This behavior is only enabled for DWARF5 and later, so we can have a unique code path in LLDB with regards to obtaining the class methods. This was tested on the LLDB side and doesn't lead to a regression. There's already code in place to deal with member functions in C++, which deals with this transparently. For more background please refer to the discussion on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-June/123986.html Differential revision: https://reviews.llvm.org/D48241 llvm-svn: 335757
* Re-land "[LTO] Enable module summary emission by default for regular LTO"Tobias Edler von Koch2018-06-221-1/+1
| | | | | | | | | | | | Since we are now producing a summary also for regular LTO builds, we need to run the NameAnonGlobals pass in those cases as well (the summary cannot handle anonymous globals). See https://reviews.llvm.org/D34156 for details on the original change. This reverts commit 6c9ee4a4a438a8059aacc809b2dd57128fccd6b3. llvm-svn: 335385
* Revert "[LTO] Enable module summary emission by default for regular LTO"Tobias Edler von Koch2018-06-211-1/+1
| | | | | | | | | | | This is breaking a couple of buildbots. We need to run the NameAnonGlobal pass for regular LTO now as well (since we're producing a summary). I'll post a separate patch for review to make this happen and then re-commit. This reverts commit c0759b7b1f4a81ff9021b952aa38a222d5fa4dfd. llvm-svn: 335291
* [LTO] Enable module summary emission by default for regular LTOTobias Edler von Koch2018-06-211-1/+1
| | | | | | | | | | | | | | | | | | | Summary: With D33921, we gained the ability to have module summaries in regular LTO modules without triggering ThinLTO compilation. Module summaries in regular LTO allow garbage collection (dead stripping) before LTO compilation and thus open up additional optimization opportunities. This patch enables summary emission in regular LTO for all targets except ld64-based ones (which use the legacy LTO API). Reviewers: pcc, tejohnson, mehdi_amini Subscribers: inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D34156 llvm-svn: 335284
* [Fixed Point Arithmetic] Addition of the remaining fixed point types and ↵Leonard Chan2018-06-141-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
* This diff includes changes for supporting the following types.Leonard Chan2018-06-041-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | // Primary fixed point types signed short _Accum s_short_accum; signed _Accum s_accum; signed long _Accum s_long_accum; unsigned short _Accum u_short_accum; unsigned _Accum u_accum; unsigned long _Accum u_long_accum; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent _Fract types will also be added in future patches. The tests included are for asserting that we can declare these types. Fixed the test that was failing by not checking for dso_local on some targets. Differential Revision: https://reviews.llvm.org/D46084 llvm-svn: 333923
* Revert "This diff includes changes for supporting the following types."Leonard Chan2018-06-021-10/+0
| | | | | | | This reverts commit r333814, which fails for a test checking the bit width on ubuntu. llvm-svn: 333815
* This diff includes changes for supporting the following types.Leonard Chan2018-06-021-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | ``` // Primary fixed point types signed short _Accum s_short_accum; signed _Accum s_accum; signed long _Accum s_long_accum; unsigned short _Accum u_short_accum; unsigned _Accum u_accum; unsigned long _Accum u_long_accum; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; ``` This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent `_Fract` types will also be added in future patches. The tests included are for asserting that we can declare these types. Differential Revision: https://reviews.llvm.org/D46084 llvm-svn: 333814
* Revert "[DebugInfo] Don't bother with MD5 checksums of preprocessed files."Paul Robinson2018-05-251-12/+4
| | | | | | | This reverts commit d734f2aa3f76fbf355ecd2bbe081d0c1f49867ab. Also known as r333311. A very small but nonzero number of bots fail. llvm-svn: 333319
* [DebugInfo] Don't bother with MD5 checksums of preprocessed files.Paul Robinson2018-05-251-4/+12
| | | | | | | | | | The checksum will not reflect the real source, so there's no clear reason to include them in the debug info. Also this was causing a crash on the DWARF side. Differential Revision: https://reviews.llvm.org/D47260 llvm-svn: 333311
* [CodeView] Enable debugging of captured variables within C++ lambdasBrock Wyma2018-05-221-19/+43
| | | | | | | | | This change will help Visual Studio resolve forward references to C++ lambda routines used by captured variables. Differential Revision: https://reviews.llvm.org/D45438 llvm-svn: 332975
* [CodeView] Improve debugging of virtual base class member variablesBrock Wyma2018-05-141-2/+6
| | | | | | | | Initial support for passing the virtual base pointer offset to CodeViewDebug. https://reviews.llvm.org/D46271 llvm-svn: 332296
* Revert r331843 "[DebugInfo] Generate debug information for labels."Hans Wennborg2018-05-091-26/+0
| | | | | | | | | | | | | | | | It broke the Chromium build (see reply on the review). > Generate DILabel metadata and call llvm.dbg.label after label > statement to associate the metadata with the label. > > Differential Revision: https://reviews.llvm.org/D45045 > > Patch by Hsiangkai Wang. This doesn't revert the change to backend-unsupported-error.ll that seems to correspond to an llvm-side change. llvm-svn: 331861
* [DebugInfo] Generate debug information for labels.Shiva Chen2018-05-091-0/+26
| | | | | | | | | | | Generate DILabel metadata and call llvm.dbg.label after label statement to associate the metadata with the label. Differential Revision: https://reviews.llvm.org/D45045 Patch by Hsiangkai Wang. llvm-svn: 331843
* Implement P0482R2, support for char8_t type.Richard Smith2018-05-011-0/+1
| | | | | | | | | | | | This is not yet part of any C++ working draft, and so is controlled by the flag -fchar8_t rather than a -std= flag. (The GCC implementation is controlled by a flag with the same name.) This implementation is experimental, and will be removed or revised substantially to match the proposal as it makes its way through the C++ committee. llvm-svn: 331244
* [CodeGen] Reland r330442: Add an option to suppress output of llvm.identMikhail Maltsev2018-04-231-1/+2
| | | | | | | The test case in the original patch was overly contrained and failed on PPC targets. llvm-svn: 330575
* Revert r330442, CodeGen/no-ident-version.c is failing on PPCMikhail Maltsev2018-04-201-2/+1
| | | | llvm-svn: 330451
* [CodeGen] Add an option to suppress output of llvm.identMikhail Maltsev2018-04-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: By default Clang outputs its version (including git commit hash, in case of trunk builds) into object and assembly files. It might be useful to have an option to disable this, especially for debugging purposes. This patch implements new command line flags -Qn and -Qy (the names are chosen for compatibility with GCC). -Qn disables output of the 'llvm.ident' metadata string and the 'producer' debug info. -Qy (enabled by default) does the opposite. Reviewers: faisalv, echristo, aprantl Reviewed By: aprantl Subscribers: aprantl, cfe-commits, JDevlieghere, rogfer01 Differential Revision: https://reviews.llvm.org/D45255 llvm-svn: 330442
* [CodeView] Initial support for emitting S_THUNK32 symbols for compiler...Brock Wyma2018-04-161-1/+6
| | | | | | | | | | | When emitting CodeView debug information, compiler-generated thunk routines should be emitted using S_THUNK32 symbols instead of S_GPROC32_ID symbols so Visual Studio can properly step into the user code. This initial support only handles standard thunk ordinals. Differential Revision: https://reviews.llvm.org/D43838 llvm-svn: 330132
* Fix typos in clangAlexander Kornienko2018-04-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* Revert "Set calling convention for CUDA kernel"Artem Belevich2018-04-031-3/+0
| | | | | | | This reverts r328795 which introduced an issue with referencing __global__ function templates. More details in the original review D44747. llvm-svn: 329099
* Fix some DenseMap use-after-rehash bugs and hoist MethodVFTableLocationReid Kleckner2018-04-021-1/+1
| | | | | | | | | | | | | | This re-lands r328845 with fixes for crbug.com/827810. The initial motiviation was to hoist MethodVFTableLocation to global scope so it could be forward declared. In this patch, I noticed that MicrosoftVTableContext uses some risky patterns. It has methods that return references to data stored in DenseMaps. I've made some of them return by value for trivial structs and I've moved some things into separate allocations. llvm-svn: 329007
* Revert r328845, it caused crbug.com/827810.Nico Weber2018-03-311-1/+1
| | | | llvm-svn: 328922
* Hoist MethodVFTableLocation out of MicrosoftVTableContext, NFCReid Kleckner2018-03-291-1/+1
| | | | | | | | | | | | | This allows forward declaring it so that we can add it to MicrosoftMangleContext::mangleVirtualMemPtrThunk without including VTableBuilder.h. That saves a hashtable lookup when emitting virtual member pointer functions. It also shortens a really long type name. This struct has "VFtable" in the name, so it seems pretty unlikely that someone will assume it is generally useful for non-MS C++ ABI stuff. llvm-svn: 328845
* Set calling convention for CUDA kernelYaxun Liu2018-03-291-0/+3
| | | | | | | | | | | This patch sets target specific calling convention for CUDA kernels in IR. Patch by Greg Rodgers. Revised and lit test added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D44747 llvm-svn: 328795
* [CodeGen] Emit DWARF "constructor" calling conventionJonas Devlieghere2018-03-221-3/+11
| | | | | | | | | | | Now that LLVM has support for emitting calling conventions in DWARF (see r328191) have clang emit them. Patch by: Adrien Guinet Differential revision: https://reviews.llvm.org/D42351 llvm-svn: 328196
* Remove redundant casts. NFCGeorge Burgess IV2018-03-011-2/+2
| | | | | | | | | | | | | | | | | | | So I wrote a clang-tidy check to lint out redundant `isa`, `cast`, and `dyn_cast`s for fun. This is a portion of what it found for clang; I plan to do similar cleanups in LLVM and other subprojects when I find time. Because of the volume of changes, I explicitly avoided making any change that wasn't highly local and obviously correct to me (e.g. we still have a number of foo(cast<Bar>(baz)) that I didn't touch, since overloading is a thing and the cast<Bar> did actually change the type -- just up the class hierarchy). I also tried to leave the types we were cast<>ing to somewhere nearby, in cases where it wasn't locally obvious what we were dealing with before. llvm-svn: 326416
* [DebugInfo] Support DWARF v5 source code embedding extensionScott Linder2018-02-261-5/+24
| | | | | | | | | | | | | In DWARF v5 the Line Number Program Header is extensible, allowing values with new content types. This vendor extension to DWARF v5 allows source text to be embedded directly in the line tables of the debug line section. Add new flag (-g[no-]embed-source) to Driver and CC1 which indicates that source should be passed through to LLVM during CodeGen. Differential Revision: https://reviews.llvm.org/D42766 llvm-svn: 326102
* [CodeGen][DebugInfo] Refactor duplicated code, NFCScott Linder2018-02-261-6/+2
| | | | llvm-svn: 326099
* Implement function attribute artificialErich Keane2018-02-141-1/+1
| | | | | | | | | | | | Added support in clang for GCC function attribute 'artificial'. This attribute is used to control stepping behavior of debugger with respect to inline functions. Patch By: Elizabeth Andrews (eandrews) Differential Revision: https://reviews.llvm.org/D43259 llvm-svn: 325081
* [DebugInfo] Update Checksum handling in CGDebugInfoScott Linder2018-02-121-10/+14
| | | | | | Update to match new DIFile API. llvm-svn: 324929
* Re-commit r324490: [DebugInfo] Improvements to representation of enumeration ↵Momchil Velikov2018-02-121-5/+7
| | | | | | | | types (PR36168) Differential revision: https://reviews.llvm.org/D42736 llvm-svn: 324900
* Revert [DebugInfo] Improvements to representation of enumeration types ↵Momchil Velikov2018-02-071-7/+5
| | | | | | | | (PR36168)" Revert due to breaking buildbots (LLDB tests) llvm-svn: 324508
* [DebugInfo] Improvements to representation of enumeration types (PR36168)Momchil Velikov2018-02-071-5/+7
| | | | | | | | | | | | | | | This patch: * fixes an incorrect sign-extension of unsigned values, when emitting debug info metadata for enumerators * the enumerators metadata is created with a flag, which determines interpretation of the value bits (signed or unsigned) * the enumerations metadata contains the underlying integer type and a flag, indicating whether this is a C++ "fixed enum" Differential Revision: https://reviews.llvm.org/D42736 llvm-svn: 324490
* Recommit rL323952: [DebugInfo] Enable debug information for C99 VLA types.Sander de Smalen2018-02-031-16/+25
| | | | | | Fixed build issue when building with g++-4.8 (specialization after instantiation). llvm-svn: 324173
* Reverting patch rL323952 due to build errors that ISander de Smalen2018-02-011-25/+16
| | | | | | haven't encountered in local builds. llvm-svn: 323956
* [DebugInfo] Enable debug information for C99 VLA typesSander de Smalen2018-02-011-16/+25
| | | | | | | | | | | | | | | | | | | | | Summary: This patch enables debugging of C99 VLA types by generating more precise LLVM Debug metadata, using the extended DISubrange 'count' field that takes a DIVariable. This should implement: Bug 30553: Debug info generated for arrays is not what GDB expects (not as good as GCC's) https://bugs.llvm.org/show_bug.cgi?id=30553 Reviewers: echristo, aprantl, dexonsmith, clayborg, pcc, kristof.beyls, dblaikie Reviewed By: aprantl Subscribers: jholewinski, schweitz, davide, fhahn, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D41698 llvm-svn: 323952
* [DWARFv5] Have -gdwarf-5 generate MD5 checksumsPaul Robinson2018-01-121-1/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D42011 llvm-svn: 322413
* Debug Info: Support DW_AT_calling_convention on composite types.Adrian Prantl2018-01-051-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | This implements the DWARF 5 feature described at http://www.dwarfstd.org/ShowIssue.php?issue=141215.1 This allows a consumer to understand whether a composite data type is trivially copyable and thus should be passed by value instead of by reference. The canonical example is being able to distinguish the following two types: // S is not trivially copyable because of the explicit destructor. struct S { ~S() {} }; // T is a POD type. struct T { ~T() = default; }; <rdar://problem/36034993> Differential Revision: https://reviews.llvm.org/D41039 llvm-svn: 321845
* Delete dead code.Adrian Prantl2017-12-211-1/+0
| | | | llvm-svn: 321321
* Refactor overridden methods iteration to avoid double lookups.Benjamin Kramer2017-12-171-1/+1
| | | | | | Convert most uses to range-for loops. No functionality change intended. llvm-svn: 320954
* Refactor functions PrintTemplateArgumentListSerge Pavlov2017-11-281-7/+3
| | | | | | | | | | | These functions were defined as static members of TemplateSpecializationType. Now they are moved to namespace level. Previously there were different implementations for lists containing TemplateArgument and TemplateArgumentLoc, now these implementations share the same code. This change is a result of refactoring patch D40508. NFC. llvm-svn: 319178
* Simplify codegen and debug info generation for block context parameters.Adrian Prantl2017-10-261-12/+4
| | | | | | | | | | | | | | | | | | | | The exisiting code goes out of its way to put block parameters into an alloca only at -O0, and then describes the funciton argument with a dbg.declare, which is undocumented in the LLVM-CFE contract and does not actually behave as intended after LLVM r642022. This patch just generates the alloca unconditionally, the mem2reg pass will eliminate it at -O1 and up anyway and points the dbg.declare to the alloca as intended (which mem2reg will then correctly rewrite into a dbg.value). This reapplies r316684 with some dead code removed. rdar://problem/35043980 Differential Revision: https://reviews.llvm.org/D39305 llvm-svn: 316689
* Revert "Simplify codegen and debug info generation for block context ↵Adrian Prantl2017-10-261-4/+12
| | | | | | | | parameters." This reverts commit r316684 while investigating buildbot breakage. llvm-svn: 316686
* Simplify codegen and debug info generation for block context parameters.Adrian Prantl2017-10-261-12/+4
| | | | | | | | | | | | | | | | | | The exisiting code goes out of its way to put block parameters into an alloca only at -O0, and then describes the funciton argument with a dbg.declare, which is undocumented in the LLVM-CFE contract and does not actually behave as intended after LLVM r642022. This patch just generates the alloca unconditionally, the mem2reg pass will eliminate it at -O1 and up anyway and points the dbg.declare to the alloca as intended (which mem2reg will then correctly rewrite into a dbg.value). rdar://problem/35043980 Differential Revision: https://reviews.llvm.org/D39305 llvm-svn: 316684
* [DWARF] Allow forward declarations of a class template instantiationPaul Robinson2017-09-281-0/+4
| | | | | | | | | to have child entries describing the template parameters. This will be on by default for SCE tuning. Differential Revision: https://reviews.llvm.org/D14358 llvm-svn: 314444
* Mark static member functions as static in CodeViewDebugAdrian McCarthy2017-09-131-0/+2
| | | | | | | | | | | | | | Summary: To improve CodeView quality for static member functions, we need to make the static explicit. In addition to a small change in LLVM's CodeViewDebug to return the appropriate MethodKind, this requires a small change in Clang to note the staticness in the debug info metadata. Subscribers: aprantl, hiraditya Differential Revision: https://reviews.llvm.org/D37715 llvm-svn: 313192
* IR: Represent -ggnu-pubnames with a flag on the DICompileUnit.Peter Collingbourne2017-09-121-1/+2
| | | | | | | | This allows the flag to be persisted through to LTO. Differential Revision: https://reviews.llvm.org/D37655 llvm-svn: 313078
OpenPOWER on IntegriCloud