mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 06:10:48 +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. llvm-svn: 254914
This commit is contained in:
parent
80454cacaf
commit
4789ea589d
@ -1118,8 +1118,10 @@ class DILocation : public MDNode {
|
||||
}
|
||||
|
||||
TempDILocation cloneImpl() const {
|
||||
return getTemporary(getContext(), getLine(), getColumn(), getScope(),
|
||||
getInlinedAt());
|
||||
// Get the raw scope/inlinedAt since it is possible to invoke this on
|
||||
// a DILocation containing temporary metadata.
|
||||
return getTemporary(getContext(), getLine(), getColumn(), getRawScope(),
|
||||
getRawInlinedAt());
|
||||
}
|
||||
|
||||
// Disallow replacing operands.
|
||||
|
@ -813,6 +813,14 @@ TEST_F(DILocationTest, getTemporary) {
|
||||
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;
|
||||
|
||||
TEST_F(GenericDINodeTest, get) {
|
||||
|
Loading…
Reference in New Issue
Block a user