llvm.org GIT mirror llvm / a7852bf
IR: Add MDLocation::getTemporary() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226502 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 5 years ago
2 changed file(s) with 13 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
943943 unsigned Column, Metadata *Scope,
944944 Metadata *InlinedAt = nullptr) {
945945 return getImpl(Context, Line, Column, Scope, InlinedAt, Distinct);
946 }
947 static MDLocation *getTemporary(LLVMContext &Context, unsigned Line,
948 unsigned Column, Metadata *Scope,
949 Metadata *InlinedAt = nullptr) {
950 return getImpl(Context, Line, Column, Scope, InlinedAt, Temporary);
946951 }
947952
948953 unsigned getLine() const { return MDNodeSubclassData; }
482482 EXPECT_EQ(L1, MDLocation::get(Context, 2, 7, N));
483483 }
484484
485 TEST_F(MDLocationTest, getTemporary) {
486 MDNode *N = MDNode::get(Context, None);
487 MDLocation *L = MDLocation::getTemporary(Context, 2, 7, N);
488 EXPECT_TRUE(L->isTemporary());
489 EXPECT_FALSE(L->isResolved());
490 MDNode::deleteTemporary(L);
491 }
492
485493 typedef MetadataTest MetadataAsValueTest;
486494
487495 TEST_F(MetadataAsValueTest, MDNode) {