mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	IR: Add getRaw() helper, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -928,26 +928,28 @@ public: | ||||
| /// | ||||
| /// This object is not associated with any DWARF tag. | ||||
| class DILocation : public DIDescriptor { | ||||
|   MDLocation *getRaw() const { return dyn_cast_or_null<MDLocation>(get()); } | ||||
|  | ||||
| public: | ||||
|   explicit DILocation(const MDNode *N) : DIDescriptor(N) {} | ||||
|  | ||||
|   unsigned getLineNumber() const { | ||||
|     if (auto *L = dyn_cast_or_null<MDLocation>(DbgNode)) | ||||
|     if (auto *L = getRaw()) | ||||
|       return L->getLine(); | ||||
|     return 0; | ||||
|   } | ||||
|   unsigned getColumnNumber() const { | ||||
|     if (auto *L = dyn_cast_or_null<MDLocation>(DbgNode)) | ||||
|     if (auto *L = getRaw()) | ||||
|       return L->getColumn(); | ||||
|     return 0; | ||||
|   } | ||||
|   DIScope getScope() const { | ||||
|     if (auto *L = dyn_cast_or_null<MDLocation>(DbgNode)) | ||||
|     if (auto *L = getRaw()) | ||||
|       return DIScope(dyn_cast_or_null<MDNode>(L->getScope())); | ||||
|     return DIScope(nullptr); | ||||
|   } | ||||
|   DILocation getOrigLocation() const { | ||||
|     if (auto *L = dyn_cast_or_null<MDLocation>(DbgNode)) | ||||
|     if (auto *L = getRaw()) | ||||
|       return DILocation(dyn_cast_or_null<MDNode>(L->getInlinedAt())); | ||||
|     return DILocation(nullptr); | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user