llvm/mlir/lib/Target/LLVMIR/DebugTranslation.cpp

//===- DebugTranslation.cpp - MLIR to LLVM Debug conversion ---------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "DebugTranslation.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"

usingnamespacemlir;
usingnamespacemlir::LLVM;
usingnamespacemlir::LLVM::detail;

/// A utility walker that interrupts if the operation has valid debug
/// information.
static WalkResult interruptIfValidLocation(Operation *op) {}

DebugTranslation::DebugTranslation(Operation *module, llvm::Module &llvmModule)
    :{}

/// Finalize the translation of debug information.
void DebugTranslation::finalize() {}

/// Translate the debug information for the given function.
void DebugTranslation::translate(LLVMFuncOp func, llvm::Function &llvmFunc) {}

//===----------------------------------------------------------------------===//
// Attributes
//===----------------------------------------------------------------------===//

llvm::DIType *DebugTranslation::translateImpl(DINullTypeAttr attr) {}

llvm::DIExpression *
DebugTranslation::getExpressionAttrOrNull(DIExpressionAttr attr) {}

llvm::MDString *DebugTranslation::getMDStringOrNull(StringAttr stringAttr) {}

llvm::MDTuple *
DebugTranslation::getMDTupleOrNull(ArrayRef<DINodeAttr> elements) {}

llvm::DIBasicType *DebugTranslation::translateImpl(DIBasicTypeAttr attr) {}

llvm::DICompileUnit *DebugTranslation::translateImpl(DICompileUnitAttr attr) {}

/// Returns a new `DINodeT` that is either distinct or not, depending on
/// `isDistinct`.
template <class DINodeT, class... Ts>
static DINodeT *getDistinctOrUnique(bool isDistinct, Ts &&...args) {}

llvm::TempDICompositeType
DebugTranslation::translateTemporaryImpl(DICompositeTypeAttr attr) {}

llvm::TempDISubprogram
DebugTranslation::translateTemporaryImpl(DISubprogramAttr attr) {}

llvm::DICompositeType *
DebugTranslation::translateImpl(DICompositeTypeAttr attr) {}

llvm::DIDerivedType *DebugTranslation::translateImpl(DIDerivedTypeAttr attr) {}

llvm::DIStringType *DebugTranslation::translateImpl(DIStringTypeAttr attr) {}

llvm::DIFile *DebugTranslation::translateImpl(DIFileAttr attr) {}

llvm::DILabel *DebugTranslation::translateImpl(DILabelAttr attr) {}

llvm::DILexicalBlock *DebugTranslation::translateImpl(DILexicalBlockAttr attr) {}

llvm::DILexicalBlockFile *
DebugTranslation::translateImpl(DILexicalBlockFileAttr attr) {}

llvm::DILocalScope *DebugTranslation::translateImpl(DILocalScopeAttr attr) {}

llvm::DIVariable *DebugTranslation::translateImpl(DIVariableAttr attr) {}

llvm::DILocalVariable *
DebugTranslation::translateImpl(DILocalVariableAttr attr) {}

llvm::DIGlobalVariable *
DebugTranslation::translateImpl(DIGlobalVariableAttr attr) {}

llvm::DINode *
DebugTranslation::translateRecursive(DIRecursiveTypeAttrInterface attr) {}

llvm::DIScope *DebugTranslation::translateImpl(DIScopeAttr attr) {}

llvm::DISubprogram *DebugTranslation::translateImpl(DISubprogramAttr attr) {}

llvm::DIModule *DebugTranslation::translateImpl(DIModuleAttr attr) {}

llvm::DINamespace *DebugTranslation::translateImpl(DINamespaceAttr attr) {}

llvm::DIImportedEntity *
DebugTranslation::translateImpl(DIImportedEntityAttr attr) {}

llvm::DISubrange *DebugTranslation::translateImpl(DISubrangeAttr attr) {}

llvm::DICommonBlock *DebugTranslation::translateImpl(DICommonBlockAttr attr) {}

llvm::DISubroutineType *
DebugTranslation::translateImpl(DISubroutineTypeAttr attr) {}

llvm::DIType *DebugTranslation::translateImpl(DITypeAttr attr) {}

llvm::DINode *DebugTranslation::translate(DINodeAttr attr) {}

//===----------------------------------------------------------------------===//
// Locations
//===----------------------------------------------------------------------===//

/// Translate the given location to an llvm debug location.
llvm::DILocation *DebugTranslation::translateLoc(Location loc,
                                                 llvm::DILocalScope *scope) {}

llvm::DIExpression *
DebugTranslation::translateExpression(LLVM::DIExpressionAttr attr) {}

llvm::DIGlobalVariableExpression *
DebugTranslation::translateGlobalVariableExpression(
    LLVM::DIGlobalVariableExpressionAttr attr) {}

/// Translate the given location to an llvm DebugLoc.
llvm::DILocation *DebugTranslation::translateLoc(Location loc,
                                                 llvm::DILocalScope *scope,
                                                 llvm::DILocation *inlinedAt) {}

/// Create an llvm debug file for the given file path.
llvm::DIFile *DebugTranslation::translateFile(StringRef fileName) {}