X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=include%2Fllvm%2FIR%2FDebugInfoMetadata.h;h=d7563fce940a21851929154dc370712abf53ac91;hp=5d8df102c190f86c94ef0a1b7a90e969ff9f7e6b;hb=c4eafd24f28b676ed7f605cda1fe42da6d34b81f;hpb=337bd191d23e54c34b7d3942828409d6cb2c10b7 diff --git a/include/llvm/IR/DebugInfoMetadata.h b/include/llvm/IR/DebugInfoMetadata.h index 5d8df102c19..d7563fce940 100644 --- a/include/llvm/IR/DebugInfoMetadata.h +++ b/include/llvm/IR/DebugInfoMetadata.h @@ -882,6 +882,13 @@ class MDLocation : public MDNode { unsigned Column, Metadata *Scope, Metadata *InlinedAt, StorageType Storage, bool ShouldCreate = true); + static MDLocation *getImpl(LLVMContext &Context, unsigned Line, + unsigned Column, MDLocalScope *Scope, + MDLocation *InlinedAt, StorageType Storage, + bool ShouldCreate = true) { + return getImpl(Context, Line, Column, static_cast(Scope), + static_cast(InlinedAt), Storage, ShouldCreate); + } TempMDLocation cloneImpl() const { return getTemporary(getContext(), getLine(), getColumn(), getScope(), @@ -896,14 +903,25 @@ public: (unsigned Line, unsigned Column, Metadata *Scope, Metadata *InlinedAt = nullptr), (Line, Column, Scope, InlinedAt)) + DEFINE_MDNODE_GET(MDLocation, + (unsigned Line, unsigned Column, MDLocalScope *Scope, + MDLocation *InlinedAt = nullptr), + (Line, Column, Scope, InlinedAt)) /// \brief Return a (temporary) clone of this. TempMDLocation clone() const { return cloneImpl(); } unsigned getLine() const { return SubclassData32; } unsigned getColumn() const { return SubclassData16; } - Metadata *getScope() const { return getOperand(0); } - Metadata *getInlinedAt() const { + MDLocalScope *getScope() const { + return cast_or_null(getRawScope()); + } + MDLocation *getInlinedAt() const { + return cast_or_null(getRawInlinedAt()); + } + + Metadata *getRawScope() const { return getOperand(0); } + Metadata *getRawInlinedAt() const { if (getNumOperands() == 2) return getOperand(1); return nullptr;