summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
AgeCommit message (Collapse)Author
2020-08-10Re-Re-land: [CodeView] Add full repro to LF_BUILDINFO recordAlexandre Ganea
This patch adds the missing information to the LF_BUILDINFO record, which allows for rebuilding a .CPP without any external dependency but the .OBJ itself (other than the compiler). Some external tools that we are using (Recode, Live++) are extracting the information to reproduce a build without any knowledge of the build system. The LF_BUILDINFO stores a full path to the compiler, the PWD (CWD at program startup), a relative or absolute path to the TU, and the full CC1 command line. The command line needs to be freestanding (not depend on any environment variables). In the same way, MSVC doesn't store the provided command-line, but an expanded version (somehow their equivalent of CC1) which is also freestanding. For more information see PR36198 and D43002. Differential Revision: https://reviews.llvm.org/D80833
2020-08-01Use llvm::is_contained where appropriate (NFC)Kazu Hirata
Use llvm::is_contained where appropriate (NFC) Reviewed By: kazu Differential Revision: https://reviews.llvm.org/D85083
2020-07-22CodeViewDebug.cpp - remove duplicate includes that already exist in ↵Simon Pilgrim
CodeViewDebug.h. NFC.
2020-07-14[NFC] Add 'override' keyword where missing in include/ and lib/.Logan Smith
This fixes warnings raised by Clang's new -Wsuggest-override, in preparation for enabling that warning in the LLVM build. This patch also removes the virtual keyword where redundant, but only in places where doing so improves consistency within a given file. It also removes a couple unnecessary virtual destructor declarations in derived classes where the destructor inherited from the base class is already virtual. Differential Revision: https://reviews.llvm.org/D83709
2020-07-10Revert "Re-land [CodeView] Add full repro to LF_BUILDINFO record"Alexandre Ganea
This reverts commit add59ecb34e3003311b7e2318b16a0ef10c76d79 and 41d2813a5faea1c18b7d329109e0287c5cd9ffea.
2020-07-10Re-land [CodeView] Add full repro to LF_BUILDINFO recordAlexandre Ganea
This patch adds some missing information to the LF_BUILDINFO which allows for rebuilding an .OBJ without any external dependency but the .OBJ itself (other than the compiler executable). Some tools need this information to reproduce a build without any knowledge of the build system. The LF_BUILDINFO therefore stores a full path to the compiler, the PWD (which is the CWD at program startup), a relative or absolute path to the TU, and the full CC1 command line. The command line needs to be freestanding (not depend on any environment variable). In the same way, MSVC doesn't store the provided command-line, but an expanded version (somehow their equivalent of CC1) which is also freestanding. For more information see PR36198 and D43002. Differential Revision: https://reviews.llvm.org/D80833
2020-06-18[CodeView] Revert 8374bf43634725dc02a262a77b5f940fca25938c and ↵Alexandre Ganea
403f9537924b8910ed4f741ed96c61f5e657915b This reverts: 8374bf43634725dc02a262a77b5f940fca25938c [CodeView] Fix generated command-line expansion in LF_BUILDINFO. Fix the 'pdb' entry which was previously a null reference, now an empty string. 403f9537924b8910ed4f741ed96c61f5e657915b [CodeView] Add full repro to LF_BUILDINFO record This is causing the lld/test/COFF/pdb-relative-source-lines.test to fail: http://lab.llvm.org:8011/builders/lld-x86_64-win/builds/1096/steps/test-check-all/logs/FAIL%3A%20lld%3A%3Apdb-relative-source-lines.test And clang/test/CodeGen/debug-info-codeview-buildinfo.c fails as well: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/33346/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Adebug-info-codeview-buildinfo.c
2020-06-18[CodeView] Fix generated command-line expansion in LF_BUILDINFO. Fix the ↵Alexandre Ganea
'pdb' entry which was previously a null reference, now an empty string. Previously, the DIA SDK didn't like the empty reference in the 'pdb' entry.
2020-06-18[CodeView] Add full repro to LF_BUILDINFO recordAlexandre Ganea
This patch adds some missing information to the LF_BUILDINFO which allows for rebuilding an .OBJ without any external dependency but the .OBJ itself (other than the compiler executable). Some tools need this information to reproduce a build without any knowledge of the build system. The LF_BUILDINFO therefore stores a full path to the compiler, the PWD (which is the CWD at program startup), a relative or absolute path to the TU, and the full CC1 command line. The command line needs to be freestanding (not depend on any environment variable). In the same way, MSVC doesn't store the provided command-line, but an expanded version (somehow their equivalent of CC1) which is also freestanding. For more information see PR36198 and D43002. Differential Revision: https://reviews.llvm.org/D80833
2020-05-28[DebugInfo] Upgrade DISubrange to support Fortran dynamic arraysAlok Kumar Sharma
This patch upgrades DISubrange to support fortran requirements. Summary: Below are the updates/addition of fields. lowerBound - Now accepts signed integer or DIVariable or DIExpression, earlier it accepted only signed integer. upperBound - This field is now added and accepts signed interger or DIVariable or DIExpression. stride - This field is now added and accepts signed interger or DIVariable or DIExpression. This is required to describe bounds of array which are known at runtime. Testing: unit test cases added (hand-written) check clang check llvm check debug-info Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D80197
2020-05-18Re-land [Debug][CodeView] Emit fully qualified names for globalsReid Kleckner
This reverts commit 525a591f0f48b9d54018bf5245f2abee09c9c1c8. Fixed an issue with pointers to members based on typedefs. In this case, LLVM would emit a second UDT. I fixed it by not passing the class type to getTypeIndex when the base type is not a function type. lowerType only uses the class type for direct function types. This suggests if we have a PMF with a function typedef, there may be an issue, but that can be solved separately.
2020-05-18Revert 76c5f277f2 "Re-land [Debug][CodeView] Emit fully qualified names for ↵Hans Wennborg
globals" > Before this patch, S_[L|G][THREAD32|DATA32] records were emitted with a simple name, not the fully qualified name (namespace + class scope). > > Differential Revision: https://reviews.llvm.org/D79447 This causes asserts in Chromium builds: CodeViewDebug.cpp:2997: void llvm::CodeViewDebug::emitDebugInfoForUDTs(const std::vector<std::pair<std::string, const DIType *>> &): Assertion `OriginalSize == UDTs.size()' failed. I will follow up on the Phabricator issue.
2020-05-15Re-land [Debug][CodeView] Emit fully qualified names for globalsAlexandre Ganea
Before this patch, S_[L|G][THREAD32|DATA32] records were emitted with a simple name, not the fully qualified name (namespace + class scope). Differential Revision: https://reviews.llvm.org/D79447
2020-05-06Revert "[Debug][CodeView] Emit fully qualified names for globals"Alexandre Ganea
This reverts commit 06591b6d191ad3582d21a801cbaf56b36714cae7.
2020-05-06[Debug][CodeView] Emit fully qualified names for globalsAlexandre Ganea
Emit S_[L|G][THREAD32|DATA32] records with a fully qualified name (namespace + class scope). Differential Revision: https://reviews.llvm.org/D79447
2020-05-04[DebugInfo][CodeView] Include namespace into emitted globalsAlexandre Ganea
Before this patch, global variables didn't have their namespace prepended in the Codeview debug symbol stream. This prevented Visual Studio from displaying them in the debugger (they appeared as 'unspecified error') Differential Revision: https://reviews.llvm.org/D79028
2020-04-20[MC][NFC] Use camelCase style for functions in MCObjectStreamerShengchen Kan
2020-04-18[DebugInfo] Change DIEnumerator payload type from int64_t to APIntLemonBoy
This allows the representation of arbitrarily large enumeration values. See https://lists.llvm.org/pipermail/llvm-dev/2017-December/119475.html for context. Reviewed By: andrewrk, aprantl, MaskRay Differential Revision: https://reviews.llvm.org/D62475
2020-04-16Reland "[codeview] Reference types in type parent scopes"Amy Huang
Summary: Original description (https://reviews.llvm/org/D69924) Without this change, when a nested tag type of any kind (enum, class, struct, union) is used as a variable type, it is emitted without emitting the parent type. In CodeView, parent types point to their inner types, and inner types do not point back to their parents. We already walk over all of the parent scopes to build the fully qualified name. This change simply requests their type indices as we go along to enusre they are all emitted. Now, while walking over the parent scopes, add the types to DeferredCompleteTypes, since they might already be in the process of being emitted. Fixes PR43905 Reviewers: rnk, amccarth Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78249
2020-04-07CodeGen: Use Register in TargetFrameLoweringMatt Arsenault
2020-03-12Add support for SHA256 source file checksums in debug infoArlo Siemsen
LLVM currently supports CSK_MD5 and CSK_SHA1 source file checksums in debug info. This change adds support for CSK_SHA256 checksums. The SHA256 checksums are supported by the CodeView debug format. Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D75785
2020-03-03[DebugInfo] Fix for adding "returns cxx udt" option to functions in CodeView.Amy Huang
Summary: This change checks for the return type in the frontend and adds a flag to the DISubroutineType to indicate that the option should be added in CodeViewDebug. Previously function types sometimes appeared twice in the PDB: once with "returns cxx udt" and once without. See https://bugs.llvm.org/show_bug.cgi?id=44785. Reviewers: rnk, asmith Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D75215
2020-02-29[MC] Add MCStreamer::emitInt{8,16,32,64}Fangrui Song
Similar to AsmPrinter::emitInt{8,16,32,64}.
2020-02-14[MCStreamer] De-capitalize EmitValue EmitIntValue{,InHex}Fangrui Song
2020-02-14[MC] De-capitalize another set of MCStreamer::Emit* functionsFangrui Song
Emit{ValueTo,Code}Alignment Emit{DTP,TP,GP}* EmitSymbolValue etc
2020-02-14[MC] De-capitalize some MCStreamer::Emit* functionsFangrui Song
2020-01-28Make llvm::StringRef to std::string conversions explicit.Benjamin Kramer
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here. This is mostly mechanical from a custom clang-tidy check, with a lot of manual fixups. It uncovers a lot of minor inefficiencies. This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2019-11-08Revert d91ed80 "[codeview] Reference types in type parent scopes"Hans Wennborg
This triggered asserts in the Chromium build, see https://crbug.com/1022729 for details and reproducer. > Without this change, when a nested tag type of any kind (enum, class, > struct, union) is used as a variable type, it is emitted without > emitting the parent type. In CodeView, parent types point to their inner > types, and inner types do not point back to their parents. We already > walk over all of the parent scopes to build the fully qualified name. > This change simply requests their type indices as we go along to enusre > they are all emitted. > > Fixes PR43905 > > Reviewers: akhuang, amccarth > > Differential Revision: https://reviews.llvm.org/D69924
2019-11-07[codeview] Reference types in type parent scopesReid Kleckner
Without this change, when a nested tag type of any kind (enum, class, struct, union) is used as a variable type, it is emitted without emitting the parent type. In CodeView, parent types point to their inner types, and inner types do not point back to their parents. We already walk over all of the parent scopes to build the fully qualified name. This change simply requests their type indices as we go along to enusre they are all emitted. Fixes PR43905 Reviewers: akhuang, amccarth Differential Revision: https://reviews.llvm.org/D69924
2019-10-28Recommit "Add a heap alloc site marker field to the ExtraInfo in MachineInstrs"Amy Huang
Summary: Fixes some things from original commit at https://reviews.llvm.org/D69136. The main change is that the heap alloc marker is always stored as ExtraInfo in the machine instruction instead of in the PointerSumType because it cannot hold more than 4 pointer types. Add instruction marker to MachineInstr ExtraInfo. This does almost the same thing as Pre/PostInstrSymbols, except that it doesn't create a label until printing instructions. This allows for labels to be put around instructions that are deleted/duplicated somewhere. Use this marker to track heap alloc site call instructions. Reviewers: rnk Subscribers: MatzeB, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69536
2019-10-25Revert "Add an instruction marker field to the ExtraInfo in MachineInstrs."Amy Huang
Reverting commit b85b4e5a6f8579c137fecb59a4d75d7bfb111f79 due to some buildbot failures/ out of memory errors.
2019-10-25Add an instruction marker field to the ExtraInfo in MachineInstrs.Amy Huang
Summary: Add instruction marker to MachineInstr ExtraInfo. This does almost the same thing as Pre/PostInstrSymbols, except that it doesn't create a label until printing instructions. This allows for labels to be put around instructions that are deleted/duplicated somewhere. Also undo the workaround in r375137. Reviewers: rnk Subscribers: MatzeB, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69136
2019-10-19Avoid including CodeView/SymbolRecord.h from MCStreamer.hReid Kleckner
Move the types needed out so they can be forward declared instead. llvm-svn: 375325
2019-10-10[codeview] Try to avoid emitting .cv_loc with line zeroReid Kleckner
Summary: Visual Studio doesn't like it while stepping. It kicks you out of the source view of the file being stepped through and tries to fall back to the disassembly view. Fixes PR43530 The fix is incomplete, because it's possible to have a basic block with no source locations at all. In this case, we don't emit a .cv_loc, but that will result in wrong stepping behavior in the debugger if the layout predecessor of the location-less BB has an unrelated source location. We could try harder to find a valid location that dominates or post-dominates the current BB, but in general it's a dataflow problem, and one still might not exist. I left a FIXME about this. As an alternative, we might want to consider having the middle-end check if its emitting codeview and get it to stop using line zero. Reviewers: akhuang Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68747 llvm-svn: 374267
2019-08-25Removing block comments from CodeView records in assembly files & related ↵Nilanjana Basu
code cleanup llvm-svn: 369860
2019-08-21Improving CodeView debug info type record's inline commentsNilanjana Basu
llvm-svn: 369533
2019-08-15[llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere
Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
2019-08-05Changing representation of .cv_def_range directives in Codeview debug info ↵Nilanjana Basu
assembly format for better readability llvm-svn: 367867
2019-08-05Revert "Changing representation of .cv_def_range directives in Codeview ↵Nilanjana Basu
debug info assembly format for better readability" This reverts commit a885afa9fa8cab3b34f1ddf3d21535f88b662881. llvm-svn: 367861
2019-08-05Changing representation of .cv_def_range directives in Codeview debug info ↵Nilanjana Basu
assembly format for better readability llvm-svn: 367850
2019-08-02Temporarily Revert "Changing representation of cv_def_range directives in ↵Eric Christopher
Codeview debug info assembly format for better readability" This is breaking bots and the author asked me to revert. This reverts commit 367704. llvm-svn: 367707
2019-08-02Changing representation of cv_def_range directives in Codeview debug info ↵Nilanjana Basu
assembly format for better readability llvm-svn: 367704
2019-08-02Temporarily revert "Changes to improve CodeView debug info type record ↵Eric Christopher
inline comments" due to a sanitizer failure. This reverts commit 367623. llvm-svn: 367640
2019-08-01Changes to improve CodeView debug info type record inline commentsNilanjana Basu
Signed-off-by: Nilanjana Basu <nilanjana.basu87@gmail.com> llvm-svn: 367623
2019-07-18[COFF] Change a variable type to be const in the HeapAllocSite map.Amy Huang
llvm-svn: 366479
2019-07-17Changes to display code view debug info type records in hex formatNilanjana Basu
llvm-svn: 366390
2019-07-17Adding inline comments to code view type record directives for better ↵Nilanjana Basu
readability llvm-svn: 366372
2019-07-09Changing CodeView debug info type record representation in assembly files to ↵Nilanjana Basu
make it more human-readable & editable & fixing bug introduced in r364987 llvm-svn: 365417
2019-07-03Revert Changing CodeView debug info type record representation in assembly ↵Nilanjana Basu
files to make it more human-readable & editable This reverts r364982 (git commit 2082bf28ebea76cc187b508f801122866420d9ff) llvm-svn: 364987
2019-07-03Changing CodeView debug info type record representation in assembly files to ↵Nilanjana Basu
make it more human-readable & editable llvm-svn: 364982