summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfoMetadata.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* DebugInfo: Move DIScope::getName() and getContext() to MDScopeDuncan P. N. Exon Smith2015-04-111-0/+30
| | | | | | | | Continue gutting the `DIDescriptor` hierarchy. In this case, move the guts of `DIScope::getName()` and `DIScope::getContext()` to `MDScope::getName()` and `MDScope::getScope()`. llvm-svn: 234691
* DebugInfo: Move DIExpression bit-piece API to MDExpressionDuncan P. N. Exon Smith2015-04-071-0/+18
| | | | llvm-svn: 234286
* DebugInfo: Move DIFlag-related API from DIDescriptor to DebugNodeDuncan P. N. Exon Smith2015-04-071-0/+44
| | | | llvm-svn: 234274
* DwarfDebug: Avoid creating new DebugLocs in the backendDuncan P. N. Exon Smith2015-03-301-0/+6
| | | | | | | Don't use `DebugLoc::getFnDebugLoc()`, which creates new `MDLocation`s, in the backend. We just want to grab the subprogram here anyway. llvm-svn: 233601
* Verifier: Add operand checks for MDLexicalBlockDuncan P. N. Exon Smith2015-03-301-0/+2
| | | | | | | | | | Add operand checks for `MDLexicalBlock` and `MDLexicalBlockFile`. Like `MDLocalVariable` and `MDLocation`, these nodes always require a scope. There was no test bitrot to fix here (just updated the serialization tests in test/Assembler/mdlexicalblock.ll). llvm-svn: 233561
* LLParser: Require non-null scope for MDLocation and MDLocalVariableDuncan P. N. Exon Smith2015-03-271-0/+2
| | | | | | | | | Change `LLParser` to require a non-null `scope:` field for both `MDLocation` and `MDLocalVariable`. There's no need to wait for the verifier for this check. This also allows their `::getImpl()` methods to assert that the incoming scope is non-null. llvm-svn: 233394
* IR: Change MDFile to directly store the filename/directoryDuncan P. N. Exon Smith2015-02-201-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the old (well, current) schema, there are two types of file references: untagged and tagged (the latter references the former). !0 = !{!"filename", !"/directory"} !1 = !{!"0x29", !1} ; DW_TAG_file_type [filename] [/directory] The interface to `DIBuilder` universally takes the tagged version, described by `DIFile`. However, most `file:` references actually use the untagged version directly. In the new hierarchy, I'm merging this into a single node: `MDFile`. Originally I'd planned to keep the old schema unchanged until after I moved the new hierarchy into place. However, it turns out to be trivial to make `MDFile` match both nodes at the same time. - Anyone referencing !1 does so through `DIFile`, whose implementation I need to gut anyway (as I do the rest of the `DIDescriptor`s). - Anyone referencing !0 just references an `MDNode`, and expects a node with two `MDString` operands. This commit achieves that, and updates all the testcases for the parts of the new hierarchy that used the two-node schema (I've replaced the untagged nodes with `distinct !{}` to make the diff clear (otherwise the metadata all gets renumbered); it might be worthwhile to come back and delete those nodes and renumber the world, not sure). llvm-svn: 230057
* IR: Fix MDType fields from unsigned to uint64_tDuncan P. N. Exon Smith2015-02-191-6/+6
| | | | | | | | | When trying to match the current schema with the new debug info hierarchy, I downgraded `SizeInBits`, `AlignInBits` and `OffsetInBits` to 32-bits (oops!). Caught this while testing my upgrade script to move the hierarchy into place. Bump it back up to 64-bits and update tests. llvm-svn: 229933
* IR: Add missing null operand to MDSubroutineTypeDuncan P. N. Exon Smith2015-02-191-1/+1
| | | | | | | | | Add missing `nullptr` from `MDSubroutineType`'s operands for `MDCompositeTypeBase::getIdentifier()` (and add tests for all the other unused fields). This highlights just how crazy it is that `MDSubroutineType` inherits from `MDCompositeTypeBase`. llvm-svn: 229926
* IR: Drop scope from MDTemplateParameterDuncan P. N. Exon Smith2015-02-191-11/+11
| | | | | | | | | | Follow-up to r229740, which removed `DITemplate*::getContext()` after my upgrade script revealed that scopes are always `nullptr` for template parameters. This is the other shoe: drop `scope:` from `MDTemplateParameter` and its two subclasses. (Note: a bitcode upgrade would be pointless, since the hierarchy hasn't been moved into place.) llvm-svn: 229791
* IR: Add MDSubprogram::replaceFunction()Duncan P. N. Exon Smith2015-02-181-0/+6
| | | | llvm-svn: 229742
* AsmWriter/Bitcode: MDLocalVariableDuncan P. N. Exon Smith2015-02-131-0/+6
| | | | llvm-svn: 229022
* IR: Add MDExpression::ExprOperandDuncan P. N. Exon Smith2015-02-131-0/+32
| | | | | | | | Port `DIExpression::Operand` over to `MDExpression::ExprOperand`. The logic is needed directly in `MDExpression` to support printing in assembly. llvm-svn: 229002
* IR: Remove unnecessary fields from MDTemplateParameterDuncan P. N. Exon Smith2015-02-101-12/+13
| | | | | | | | I noticed this fields were never used in r228607, but I neglected to propagate that into `MDTemplateParameter` until now. This really should have been done before commit in r228640; sorry for the churn. llvm-svn: 228652
* IR: Add specialized debug info metadata nodesDuncan P. N. Exon Smith2015-02-101-0/+271
| | | | | | | | | | | | | | | Add specialized debug info metadata nodes that match the `DIDescriptor` wrappers (used by `DIBuilder`) closely. Assembly and bitcode support to follow soon (it'll mostly just be obvious), but this sketches in today's schema. This is the first big commit (well, the only *big* one aside from the testcase changes that'll come when I move this into place) for PR22464. I've marked a bunch of obvious changes as `TODO`s in the source; I plan to make those changes promptly after this hierarchy is moved underneath `DIDescriptor`, but for now I'm aiming mostly to match the status quo. llvm-svn: 228640
* IR: Allow 32-bits for lines in debug locationDuncan P. N. Exon Smith2015-02-061-9/+1
| | | | | | | | | | | | Remove unnecessary restriction of 24-bits for line numbers in `MDLocation`. The rest of the debug info schema (with the exception of local variables) uses 32-bits for line numbers. As I introduce the specialized nodes, it makes sense to canonicalize on one size or the other. llvm-svn: 228455
* Fix the -Werror build, NFCDuncan P. N. Exon Smith2015-02-021-0/+2
| | | | llvm-svn: 227849
* IR: Allow GenericDebugNode construction from MDStringDuncan P. N. Exon Smith2015-02-021-8/+12
| | | | | | | | | | | | | | | | Allow `GenericDebugNode` construction directly from `MDString`, rather than requiring `StringRef`s. I've refactored the `StringRef` constructors to use these. There's no real functionality change here, except for exposing the lower-level API. The purpose of this is to simplify construction of string operands when reading bitcode. It's unnecessarily indirect to parse an `MDString` ID, lookup the `MDString` in the bitcode reader list, get the `StringRef` out of that, and then have `GenericDebugNode::getImpl()` use `MDString::get()` to acquire the original `MDString`. Instead, this allows the bitcode reader to directly pass in the `MDString`. llvm-svn: 227848
* IR: Separate helpers for string operands, NFCDuncan P. N. Exon Smith2015-02-021-2/+8
| | | | llvm-svn: 227846
* IR: Split out DebugInfoMetadata.h, NFCDuncan P. N. Exon Smith2015-02-021-0/+101
Move debug-info-centred `Metadata` subclasses into their own header/source file. A couple of private template functions are needed from both `Metadata.cpp` and `DebugInfoMetadata.cpp`, so I've moved them to `lib/IR/MetadataImpl.h`. llvm-svn: 227835
OpenPOWER on IntegriCloud