aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp
AgeCommit message (Collapse)AuthorFilesLines
2020-02-10Revert "Remove redundant "std::move"s in return statements"Bill Wendling1-5/+5
The build failed with error: call to deleted constructor of 'llvm::Error' errors. This reverts commit 1c2241a7936bf85aa68aef94bd40c3ba77d8ddf2.
2020-02-10Remove redundant "std::move"s in return statementsBill Wendling1-5/+5
2020-01-01[NFC] Fixes -Wrange-loop-analysis warningsMark de Wever1-1/+1
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71857
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-4/+3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-09-11[PDB] Write FPO Data to the PDB.Zachary Turner1-1/+1
llvm-svn: 342003
2017-12-18[YAML] Add support for non-printable charactersFrancis Visoiu Mistrih1-1/+1
LLVM IR function names which disable mangling start with '\01' (https://www.llvm.org/docs/LangRef.html#identifiers). When an identifier like "\01@abc@" gets dumped to MIR, it is quoted, but only with single quotes. http://www.yaml.org/spec/1.2/spec.html#id2770814: "The allowed character range explicitly excludes the C0 control block allowed), the surrogate block #xD800-#xDFFF, #xFFFE, and #xFFFF." http://www.yaml.org/spec/1.2/spec.html#id2776092: "All non-printable characters must be escaped. [...] Note that escape sequences are only interpreted in double-quoted scalars." This patch adds support for printing escaped non-printable characters between double quotes if needed. Should also fix PR31743. Differential Revision: https://reviews.llvm.org/D41290 llvm-svn: 320996
2017-07-01[ObjectYAML] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko1-14/+37
warnings; other minor fixes (NFC). llvm-svn: 306925
2017-06-30Fix ODR violations due to abuse of LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTORRichard Smith1-2/+0
This is a short-term fix for PR33650 aimed to get the modules build bots green again. Remove all the places where we use the LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR macros to try to locally specialize a global template for a global type. That's not how C++ works. Instead, we now centrally define how to format vectors of fundamental types and of string (std::string and StringRef). We use flow formatting for the former cases, since that's the obvious right thing to do; in the latter case, it's less clear what the right choice is, but flow formatting is really bad for some cases (due to very long strings), so we pick block formatting. (Many of the cases that were using flow formatting for strings are improved by this change.) Other than the flow -> block formatting change for some vectors of strings, this should result in no functionality change. Differential Revision: https://reviews.llvm.org/D34907 Corresponding updates to clang, clang-tools-extra, and lld to follow. llvm-svn: 306878
2017-06-14Resubmit "[codeview] Make obj2yaml/yaml2obj support .debug$S..."Zachary Turner1-178/+160
This was originally reverted because of some non-deterministic failures on certain buildbots. Luckily ASAN eventually caught this as a stack-use-after-scope, so the fix is included in this patch. llvm-svn: 305393
2017-06-14Revert "[codeview] Make obj2yaml/yaml2obj support .debug$S..."Zachary Turner1-160/+167
This is causing failures on linux bots with an invalid stream read. It doesn't repro in any configuration on Windows, so reverting until I have a chance to investigate on Linux. llvm-svn: 305371
2017-06-14Use make_shared instead of make_unique.Zachary Turner1-2/+2
llvm-svn: 305369
2017-06-14Fix some more errors.Zachary Turner1-10/+10
llvm-svn: 305368
2017-06-14[codeview] Make obj2yaml/yaml2obj support .debug$S/T sections.Zachary Turner1-160/+153
This allows us to use yaml2obj and obj2yaml to round-trip CodeView symbol and type information without having to manually specify the bytes of the section. This makes for much easier to maintain tests. See the tests under lld/COFF in this patch for example. Before they just said SectionData: <blob> whereas now we can use meaningful record descriptions. Note that it still supports the SectionData yaml field, which could be useful for initializing a section to invalid bytes for testing, for example. Differential Revision: https://reviews.llvm.org/D34127 llvm-svn: 305366
2017-06-09[pdb] Support CoffSymbolRVA debug subsection.Zachary Turner1-0/+54
llvm-svn: 305108
2017-06-09[CodeView] Support remaining debug subsection typesZachary Turner1-16/+295
This adds support for Symbols, StringTable, and FrameData subsection types. Even though these subsections rarely if ever appear in a PDB file (they are usually in object files), there's no theoretical reason why they *couldn't* appear in a PDB. The real issue though is that in order to add support for dumping and writing them (which will be useful for object files), we need a way to test them. And since there is no support for reading and writing them to / from object files yet, making PDB support them is the best way to both add support for the underlying format and add support for tests at the same time. Later, when we go to add support for reading / writing them from object files, we'll need only minimal changes in the underlying read/write code. llvm-svn: 305037
2017-06-08[llvm-pdbdump] Support native ordering of subsections in raw mode.Zachary Turner1-28/+29
This is the same change for the YAML Output style applied to the raw output style. Previously we would queue up all subsections until every one had been read, and then output them in a pre- determined order. This was because some subsections need to be read first in order to properly dump later subsections. This patch allows them to be dumped in the order they appear. Differential Revision: https://reviews.llvm.org/D34015 llvm-svn: 305034
2017-06-05[CodeView] Handle Cross Module Imports and Exports.Zachary Turner1-9/+146
While it's not entirely clear why a compiler or linker might put this information into an object or PDB file, one has been spotted in the wild which was causing llvm-pdbdump to crash. This patch adds support for reading-writing these sections. Since I don't know how to get one of the native tools to generate this kind of debug info, the only test here is one in which we feed YAML into the tool to produce a PDB and then spit out YAML from the resulting PDB and make sure that it matches. llvm-svn: 304738
2017-06-02Fix build error on gcc.Zachary Turner1-1/+1
llvm-svn: 304595
2017-06-02Fix build error with clang and gcc.Zachary Turner1-2/+2
llvm-svn: 304589
2017-06-02[CodeView] Support CodeView subsections in any order.Zachary Turner1-25/+382
Previously we would expect certain subsections to appear in a certain order because some subsections would reference other subsections, but in practice we need to support arbitrary orderings since some object file and PDB file producers generate them this way. This also paves the way for supporting Yaml <-> Object File conversion of CodeView, since Object Files typically have quite a large number of subsections in their debug info. Differential Revision: https://reviews.llvm.org/D33807 llvm-svn: 304588
2017-05-31[ObjectYAML] Split CodeViewYAML into 3 pieces.Zachary Turner1-0/+127
The code was a mess and disorganized due to the sheer amount of it being in one file. So I'm splitting this into three files. One for CodeView types, one for CodeView symbols, and one for CodeView debug subsections. NFC. llvm-svn: 304278