Category: Raising an exception

Adding debug support to tinylang – Advanced IR Generation-1Adding debug support to tinylang – Advanced IR Generation-1

We encapsulate the generation of debug metadata in the new CGDebugInfo class. Additionally, we place the declaration in the tinylang/CodeGen/CGDebugInfo.h header file and the definition in the tinylang/CodeGen/CGDebugInfo.cpp file.The CGDebugInfo [...]

Adding TBAA metadata to tinylang – Advanced IR Generation-2Adding TBAA metadata to tinylang – Advanced IR Generation-2

llvm::MDNode *CGTBAA::getTypeInfo(TypeDeclaration *Ty) {if (llvm::MDNode *N = MetadataCache[Ty])return N;if (auto *Pervasive =llvm::dyn_cast(Ty)) {StringRef Name = Pervasive->getName();return createScalarTypeNode(Pervasive, Name, getRoot());}if (auto *Pointer =llvm::dyn_cast(Ty)) {StringRef Name = “any pointer”;return createScalarTypeNode(Pointer, Name, getRoot());}if [...]