History log of /llvm-project/llvm/lib/IR/DebugLoc.cpp (Results 26 – 50 of 52)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-3.8.0-rc1, llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1, llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1, llvmorg-3.6.1, llvmorg-3.6.1-rc1
# a9308c49 29-Apr-2015 Duncan P. N. Exon Smith <dexonsmith@apple.com>

IR: Give 'DI' prefix to debug info metadata

Finish off PR23080 by renaming the debug info IR constructs from `MD*`
to `DI*`. The last of the `DIDescriptor` classes were deleted in
r235356, and the

IR: Give 'DI' prefix to debug info metadata

Finish off PR23080 by renaming the debug info IR constructs from `MD*`
to `DI*`. The last of the `DIDescriptor` classes were deleted in
r235356, and the last of the related typedefs removed in r235413, so
this has all baked for about a week.

Note: If you have out-of-tree code (like a frontend), I recommend that
you get everything compiling and tests passing with the *previous*
commit before updating to this one. It'll be easier to keep track of
what code is using the `DIDescriptor` hierarchy and what you've already
updated, and I think you're extremely unlikely to insert bugs. YMMV of
course.

Back to *this* commit: I did this using the rename-md-di-nodes.sh
upgrade script I've attached to PR23080 (both code and testcases) and
filtered through clang-format-diff.py. I edited the tests for
test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns
were off-by-three. It should work on your out-of-tree testcases (and
code, if you've followed the advice in the previous paragraph).

Some of the tests are in badly named files now (e.g.,
test/Assembler/invalid-mdcompositetype-missing-tag.ll should be
'dicompositetype'); I'll come back and move the files in a follow-up
commit.

llvm-svn: 236120

show more ...


# 2fbe1354 20-Apr-2015 Duncan P. N. Exon Smith <dexonsmith@apple.com>

DebugInfo: Delete subclasses of DIScope

Delete subclasses of (the already defunct) `DIScope`, updating users to
use the raw pointers from the `Metadata` hierarchy directly.

llvm-svn: 235356


# 5c8f1dc2 16-Apr-2015 Duncan P. N. Exon Smith <dexonsmith@apple.com>

DebugInfo: Allow DebugLocs to be constructed from const

Allow `const`-qualified pointers to be used to construct `DebugLoc`s, as
a convenience.

llvm-svn: 235115


# b273d06b 16-Apr-2015 Duncan P. N. Exon Smith <dexonsmith@apple.com>

DebugInfo: Gut DIScope, DIEnumerator and DISubrange

The only class the still has API left is `DIDescriptor` itself.

llvm-svn: 235067


# 537b4a81 14-Apr-2015 Duncan P. N. Exon Smith <dexonsmith@apple.com>

DebugInfo: Gut DISubprogram and DILexicalBlock*

Gut the `DIDescriptor` wrappers around `MDLocalScope` subclasses. Note
that `DILexicalBlock` wraps `MDLexicalBlockBase`, not `MDLexicalBlock`.

llvm-

DebugInfo: Gut DISubprogram and DILexicalBlock*

Gut the `DIDescriptor` wrappers around `MDLocalScope` subclasses. Note
that `DILexicalBlock` wraps `MDLexicalBlockBase`, not `MDLexicalBlock`.

llvm-svn: 234850

show more ...


# 9d1cf4c1 06-Apr-2015 Duncan P. N. Exon Smith <dexonsmith@apple.com>

IR: Stop using DIDescriptor::is*() and auto-casting

`DIDescriptor`'s subclasses allow construction from incompatible
pointers, and `DIDescriptor` defines a series of `isa<>`-like functions
(e.g., `i

IR: Stop using DIDescriptor::is*() and auto-casting

`DIDescriptor`'s subclasses allow construction from incompatible
pointers, and `DIDescriptor` defines a series of `isa<>`-like functions
(e.g., `isCompileUnit()` instead of `isa<MDCompileUnit>()`) that clients
tend to use like this:

if (DICompileUnit(N).isCompileUnit())
foo(DICompileUnit(N));

These construction patterns work together to make `DIDescriptor` behave
differently from normal pointers.

Instead, use built-in `isa<>`, `dyn_cast<>`, etc., and only build
`DIDescriptor`s from pointers that are valid for their type.

I've split this into a few commits for different parts of LLVM and clang
(to decrease the patch size and increase the chance of review).
Generally the changes I made were NFC, but in a few places I made things
stricter if it made sense from the surrounded code.

Eventually a follow-up commit will remove the API for the "old" way.

llvm-svn: 234255

show more ...


# 82eba746 30-Mar-2015 Duncan P. N. Exon Smith <dexonsmith@apple.com>

DebugLoc: Remove getFromDILexicalBlock()

The only user of `DebugLoc::getFromDILexicalBlock()` was creating a new
`MDLocation` as convenient API for passing an `MDScope`. Stop doing
that, and remove

DebugLoc: Remove getFromDILexicalBlock()

The only user of `DebugLoc::getFromDILexicalBlock()` was creating a new
`MDLocation` as convenient API for passing an `MDScope`. Stop doing
that, and remove the API. If in the future we actually *want* to create
new DebugLocs, calling `MDLexicalBlock::get()` makes more sense.

llvm-svn: 233643

show more ...


# 1ceb0d2f 30-Mar-2015 Duncan P. N. Exon Smith <dexonsmith@apple.com>

DebugInfo: Remove dead code from old DebugLoc API

Remove old API for `DebugLoc` now that all the callers have been
updated. If this broke your out-of-tree build, here's a quick map from
the old API

DebugInfo: Remove dead code from old DebugLoc API

Remove old API for `DebugLoc` now that all the callers have been
updated. If this broke your out-of-tree build, here's a quick map from
the old API to the new one:

DebugLoc DebugLoc::getFromMDLocation(MDNode *)
=> DebugLoc::DebugLoc(MDLocation *)
=> explicit DebugLoc::DebugLoc(MDNode *) // works with broken code

MDNode *DebugLoc::getAsMDNode(LLVMContext &)
=> MDLocation *DebugLoc::get()
=> DebugLoc::operator MDLocation *()
=> MDNode *DebugLoc::getAsMDNode() // works with broken code

bool DebugLoc::isUnknown()
=> DebugLoc::operator MDLocation *()
i.e.: if (MDLocation *DL = ...)
=> DebugLoc::operator bool() // works with broken code
i.e.: if (DebugLoc DL = ...)

void DebugLoc::getScopeAndInlinedAt(MDNode *&, MDNode *&)
=> use: MDNode *DebugLoc::getScope()
and: MDLocation *DebugLoc::getInlinedAt()

MDNode *DebugLoc::getScopeNode(LLVMContext &)
=> MDNode *DebugLoc::getInlinedAtScope()

void DebugLoc::dump(LLVMContext &)
=> void DebugLoc::dump()

void DebugLoc::getFnDebugLoc(LLVMContext &)
=> void DebugLoc::getFnDebugLoc()

MDNode *DebugLoc::getScope(LLVMContext &)
=> MDNode *DebugLoc::getScope()

MDNode *DebugLoc::getInlinedAt(LLVMContext &)
=> MDLocation *DebugLoc::getInlinedAt()

I've noted above the only functions that won't crash on broken code (due
to downcasting to `MDLocation`). If your code could be dealing with
broken IR (i.e., you haven't run the verifier yet, or you've used a
temporary node that will eventually (but not yet) get RAUW'ed to an
`MDLocation`), you need to restrict yourself to those.

llvm-svn: 233599

show more ...


# 86b0db42 30-Mar-2015 Duncan P. N. Exon Smith <dexonsmith@apple.com>

DebugInfo: Write new DebugLoc API

Rewrite `DebugLoc` with a cleaner API that reflects its current status
as a wrapper around an `MDLocation` pointer.

- Add accessors/constructors to/from `MDLocat

DebugInfo: Write new DebugLoc API

Rewrite `DebugLoc` with a cleaner API that reflects its current status
as a wrapper around an `MDLocation` pointer.

- Add accessors/constructors to/from `MDLocation`.
- Simplify construction from `MDNode`.
- Remove unnecessary `LLVMContext` from APIs.
- Drop some API that isn't useful any more.
- Rewrite documentation.

Actually, I've left the old API behind temporarily at the bottom of the
class so that I can update callers in separate commits. I'll remove it
once the callers are updated.

llvm-svn: 233573

show more ...


# 8f7bc791 30-Mar-2015 Duncan P. N. Exon Smith <dexonsmith@apple.com>

DebugInfo: Implement MDLocation::getInlinedAtScope()

Write `MDLocation::getInlinedAtScope()` and use it to re-implement
`DebugLoc::getScopeNode()` (and simplify `DISubprogram::Verify()`).
This follo

DebugInfo: Implement MDLocation::getInlinedAtScope()

Write `MDLocation::getInlinedAtScope()` and use it to re-implement
`DebugLoc::getScopeNode()` (and simplify `DISubprogram::Verify()`).
This follows the inlined-at linked list and returns the scope of the
deepest/last location.

llvm-svn: 233568

show more ...


Revision tags: llvmorg-3.5.2, llvmorg-3.5.2-rc1, llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2
# c9cddb08 16-Jan-2015 Duncan P. N. Exon Smith <dexonsmith@apple.com>

IR: Cleanup dead code, NFC

Line/column fixups already exist in `MDLocation`. Delete the duplicated
logic in `DebugLoc`.

llvm-svn: 226290


Revision tags: llvmorg-3.6.0-rc1
# 98854699 14-Jan-2015 Duncan P. N. Exon Smith <dexonsmith@apple.com>

IR: Move MDLocation into place

This commit moves `MDLocation`, finishing off PR21433. There's an
accompanying clang commit for frontend testcases. I'll attach the
testcase upgrade script I used to

IR: Move MDLocation into place

This commit moves `MDLocation`, finishing off PR21433. There's an
accompanying clang commit for frontend testcases. I'll attach the
testcase upgrade script I used to PR21433 to help out-of-tree
frontends/backends.

This changes the schema for `DebugLoc` and `DILocation` from:

!{i32 3, i32 7, !7, !8}

to:

!MDLocation(line: 3, column: 7, scope: !7, inlinedAt: !8)

Note that empty fields (line/column: 0 and inlinedAt: null) don't get
printed by the assembly writer.

llvm-svn: 226048

show more ...


Revision tags: llvmorg-3.5.1, llvmorg-3.5.1-rc2
# 5bf8fef5 09-Dec-2014 Duncan P. N. Exon Smith <dexonsmith@apple.com>

IR: Split Metadata from Value

Split `Metadata` away from the `Value` class hierarchy, as part of
PR21532. Assembly and bitcode changes are in the wings, but this is the
bulk of the change for the I

IR: Split Metadata from Value

Split `Metadata` away from the `Value` class hierarchy, as part of
PR21532. Assembly and bitcode changes are in the wings, but this is the
bulk of the change for the IR C++ API.

I have a follow-up patch prepared for `clang`. If this breaks other
sub-projects, I apologize in advance :(. Help me compile it on Darwin
I'll try to fix it. FWIW, the errors should be easy to fix, so it may
be simpler to just fix it yourself.

This breaks the build for all metadata-related code that's out-of-tree.
Rest assured the transition is mechanical and the compiler should catch
almost all of the problems.

Here's a quick guide for updating your code:

- `Metadata` is the root of a class hierarchy with three main classes:
`MDNode`, `MDString`, and `ValueAsMetadata`. It is distinct from
the `Value` class hierarchy. It is typeless -- i.e., instances do
*not* have a `Type`.

- `MDNode`'s operands are all `Metadata *` (instead of `Value *`).

- `TrackingVH<MDNode>` and `WeakVH` referring to metadata can be
replaced with `TrackingMDNodeRef` and `TrackingMDRef`, respectively.

If you're referring solely to resolved `MDNode`s -- post graph
construction -- just use `MDNode*`.

- `MDNode` (and the rest of `Metadata`) have only limited support for
`replaceAllUsesWith()`.

As long as an `MDNode` is pointing at a forward declaration -- the
result of `MDNode::getTemporary()` -- it maintains a side map of its
uses and can RAUW itself. Once the forward declarations are fully
resolved RAUW support is dropped on the ground. This means that
uniquing collisions on changing operands cause nodes to become
"distinct". (This already happened fairly commonly, whenever an
operand went to null.)

If you're constructing complex (non self-reference) `MDNode` cycles,
you need to call `MDNode::resolveCycles()` on each node (or on a
top-level node that somehow references all of the nodes). Also,
don't do that. Metadata cycles (and the RAUW machinery needed to
construct them) are expensive.

- An `MDNode` can only refer to a `Constant` through a bridge called
`ConstantAsMetadata` (one of the subclasses of `ValueAsMetadata`).

As a side effect, accessing an operand of an `MDNode` that is known
to be, e.g., `ConstantInt`, takes three steps: first, cast from
`Metadata` to `ConstantAsMetadata`; second, extract the `Constant`;
third, cast down to `ConstantInt`.

The eventual goal is to introduce `MDInt`/`MDFloat`/etc. and have
metadata schema owners transition away from using `Constant`s when
the type isn't important (and they don't care about referring to
`GlobalValue`s).

In the meantime, I've added transitional API to the `mdconst`
namespace that matches semantics with the old code, in order to
avoid adding the error-prone three-step equivalent to every call
site. If your old code was:

MDNode *N = foo();
bar(isa <ConstantInt>(N->getOperand(0)));
baz(cast <ConstantInt>(N->getOperand(1)));
bak(cast_or_null <ConstantInt>(N->getOperand(2)));
bat(dyn_cast <ConstantInt>(N->getOperand(3)));
bay(dyn_cast_or_null<ConstantInt>(N->getOperand(4)));

you can trivially match its semantics with:

MDNode *N = foo();
bar(mdconst::hasa <ConstantInt>(N->getOperand(0)));
baz(mdconst::extract <ConstantInt>(N->getOperand(1)));
bak(mdconst::extract_or_null <ConstantInt>(N->getOperand(2)));
bat(mdconst::dyn_extract <ConstantInt>(N->getOperand(3)));
bay(mdconst::dyn_extract_or_null<ConstantInt>(N->getOperand(4)));

and when you transition your metadata schema to `MDInt`:

MDNode *N = foo();
bar(isa <MDInt>(N->getOperand(0)));
baz(cast <MDInt>(N->getOperand(1)));
bak(cast_or_null <MDInt>(N->getOperand(2)));
bat(dyn_cast <MDInt>(N->getOperand(3)));
bay(dyn_cast_or_null<MDInt>(N->getOperand(4)));

- A `CallInst` -- specifically, intrinsic instructions -- can refer to
metadata through a bridge called `MetadataAsValue`. This is a
subclass of `Value` where `getType()->isMetadataTy()`.

`MetadataAsValue` is the *only* class that can legally refer to a
`LocalAsMetadata`, which is a bridged form of non-`Constant` values
like `Argument` and `Instruction`. It can also refer to any other
`Metadata` subclass.

(I'll break all your testcases in a follow-up commit, when I propagate
this change to assembly.)

llvm-svn: 223802

show more ...


Revision tags: llvmorg-3.5.1-rc1
# 176b691d 03-Oct-2014 Duncan P. N. Exon Smith <dexonsmith@apple.com>

Revert "Revert "DI: Fold constant arguments into a single MDString""

This reverts commit r218918, effectively reapplying r218914 after fixing
an Ocaml bindings test and an Asan crash. The root caus

Revert "Revert "DI: Fold constant arguments into a single MDString""

This reverts commit r218918, effectively reapplying r218914 after fixing
an Ocaml bindings test and an Asan crash. The root cause of the latter
was a tightened-up check in `DILexicalBlock::Verify()`, so I'll file a
PR to investigate who requires the loose check (and why).

Original commit message follows.

--

This patch addresses the first stage of PR17891 by folding constant
arguments together into a single MDString. Integers are stringified and
a `\0` character is used as a separator.

Part of PR17891.

Note: I've attached my testcases upgrade scripts to the PR. If I've
just broken your out-of-tree testcases, they might help.

llvm-svn: 219010

show more ...


# 786cd049 02-Oct-2014 Duncan P. N. Exon Smith <dexonsmith@apple.com>

Revert "DI: Fold constant arguments into a single MDString"

This reverts commit r218914 while I investigate some bots.

llvm-svn: 218918


# 571f97bd 02-Oct-2014 Duncan P. N. Exon Smith <dexonsmith@apple.com>

DI: Fold constant arguments into a single MDString

This patch addresses the first stage of PR17891 by folding constant
arguments together into a single MDString. Integers are stringified and
a `\0`

DI: Fold constant arguments into a single MDString

This patch addresses the first stage of PR17891 by folding constant
arguments together into a single MDString. Integers are stringified and
a `\0` character is used as a separator.

Part of PR17891.

Note: I've attached my testcases upgrade scripts to the PR. If I've
just broken your out-of-tree testcases, they might help.

llvm-svn: 218914

show more ...


Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2, llvmorg-3.5.0-rc1
# bec9dedf 05-Jun-2014 Evgeniy Stepanov <eugeni.stepanov@gmail.com>

Add missing const specifier to a const method.

llvm-svn: 210265


Revision tags: llvmorg-3.4.2, llvmorg-3.4.2-rc1
# da925c0d 07-May-2014 Zinovy Nis <zinovy.nis@gmail.com>

[BUG][REFACTOR]
1) Fix for printing debug locations for absolute paths.
2) Location printing is moved into public method DebugLoc::print() to avoid re-inventing the wheel.

Differential Revision: htt

[BUG][REFACTOR]
1) Fix for printing debug locations for absolute paths.
2) Location printing is moved into public method DebugLoc::print() to avoid re-inventing the wheel.

Differential Revision: http://reviews.llvm.org/D3513

llvm-svn: 208177

show more ...


Revision tags: llvmorg-3.4.1, llvmorg-3.4.1-rc2
# 2617dcce 15-Apr-2014 Craig Topper <craig.topper@gmail.com>

[C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.

llvm-svn: 206252


Revision tags: llvmorg-3.4.1-rc1
# c620761c 09-Apr-2014 Craig Topper <craig.topper@gmail.com>

[C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr.

llvm-svn: 205831


# 9a4c9e59 06-Mar-2014 Chandler Carruth <chandlerc@gmail.com>

[Layering] Move DebugInfo.h into the IR library where its implementation
already lives.

llvm-svn: 203046


# 92051407 05-Mar-2014 Chandler Carruth <chandlerc@gmail.com>

[Layering] Move DebugLoc.h into the IR library. The implementation
already lived there and it is where it belongs -- this is the in-memory
debug location representation.

This is just cleanup -- Modu

[Layering] Move DebugLoc.h into the IR library. The implementation
already lived there and it is where it belongs -- this is the in-memory
debug location representation.

This is just cleanup -- Modules can actually cope with this, but that
doesn't make it right. After chatting with folks that have out-of-tree
stuff, going ahead and moving the rest of the headers seems preferable.

llvm-svn: 202960

show more ...


# 0394c1e6 05-Feb-2014 Alon Mishne <alon.mishne@intel.com>

Test commit

llvm-svn: 200843


# f166f6c8 30-Jan-2014 Timur Iskhodzhanov <timurrrr@google.com>

Reland r200340 - 'Add line table debug info to COFF files when using a win32 triple'

This incorporates a couple of fixes reviewed at http://llvm-reviews.chandlerc.com/D2651

llvm-svn: 200440


# b366f01f 29-Jan-2014 NAKAMURA Takumi <geek4civic@gmail.com>

Revert r200340, "Add line table debug info to COFF files when using a win32 triple."

It was incompatible with --target=i686-win32.

llvm-svn: 200375


123