mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-19 10:53:55 +00:00
[ThinLTO] Support cloning of temporary DILocation metadata
This is needed to support linking of module-level metadata as a postpass after function importing, where we will be leaving temporary metadata on imported instructions until the postpass metadata import. Also added unittest. Split from D14838. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254914 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3b45f263c3
commit
fda49fdbc8
@ -1118,8 +1118,10 @@ class DILocation : public MDNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TempDILocation cloneImpl() const {
|
TempDILocation cloneImpl() const {
|
||||||
return getTemporary(getContext(), getLine(), getColumn(), getScope(),
|
// Get the raw scope/inlinedAt since it is possible to invoke this on
|
||||||
getInlinedAt());
|
// a DILocation containing temporary metadata.
|
||||||
|
return getTemporary(getContext(), getLine(), getColumn(), getRawScope(),
|
||||||
|
getRawInlinedAt());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disallow replacing operands.
|
// Disallow replacing operands.
|
||||||
|
@ -813,6 +813,14 @@ TEST_F(DILocationTest, getTemporary) {
|
|||||||
EXPECT_FALSE(L->isResolved());
|
EXPECT_FALSE(L->isResolved());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(DILocationTest, cloneTemporary) {
|
||||||
|
MDNode *N = MDNode::get(Context, None);
|
||||||
|
auto L = DILocation::getTemporary(Context, 2, 7, N);
|
||||||
|
EXPECT_TRUE(L->isTemporary());
|
||||||
|
auto L2 = L->clone();
|
||||||
|
EXPECT_TRUE(L2->isTemporary());
|
||||||
|
}
|
||||||
|
|
||||||
typedef MetadataTest GenericDINodeTest;
|
typedef MetadataTest GenericDINodeTest;
|
||||||
|
|
||||||
TEST_F(GenericDINodeTest, get) {
|
TEST_F(GenericDINodeTest, get) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user