//===--- DebugInfo.cpp - Debug Information Helper Classes -----------------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file implements the helper classes used to build and interpret debug// information in LLVM IR form.////===----------------------------------------------------------------------===//#include"llvm/DebugInfo.h"#include"llvm/ADT/STLExtras.h"#include"llvm/ADT/SmallPtrSet.h"#include"llvm/ADT/SmallString.h"#include"llvm/Analysis/ValueTracking.h"#include"llvm/IR/Constants.h"#include"llvm/IR/DerivedTypes.h"#include"llvm/IR/Instructions.h"#include"llvm/IR/IntrinsicInst.h"#include"llvm/IR/Intrinsics.h"#include"llvm/IR/Module.h"#include"llvm/Support/Debug.h"#include"llvm/Support/Dwarf.h"#include"llvm/Support/ValueHandle.h"#include"llvm/Support/raw_ostream.h"usingnamespacellvm;usingnamespacellvm::dwarf;//===----------------------------------------------------------------------===//// DIDescriptor//===----------------------------------------------------------------------===//DIDescriptor::DIDescriptor(constDIFileF):DbgNode(F.DbgNode){}DIDescriptor::DIDescriptor(constDISubprogramF):DbgNode(F.DbgNode){}DIDescriptor::DIDescriptor(constDILexicalBlockFileF):DbgNode(F.DbgNode){}DIDescriptor::DIDescriptor(constDILexicalBlockF):DbgNode(F.DbgNode){}DIDescriptor::DIDescriptor(constDIVariableF):DbgNode(F.DbgNode){}DIDescriptor::DIDescriptor(constDITypeF):DbgNode(F.DbgNode){}boolDIDescriptor::Verify()const{returnDbgNode&&(DIDerivedType(DbgNode).Verify()||DICompositeType(DbgNode).Verify()||DIBasicType(DbgNode).Verify()||DIVariable(DbgNode).Verify()||DISubprogram(DbgNode).Verify()||DIGlobalVariable(DbgNode).Verify()||DIFile(DbgNode).Verify()||DICompileUnit(DbgNode).Verify()||DINameSpace(DbgNode).Verify()||DILexicalBlock(DbgNode).Verify()||DILexicalBlockFile(DbgNode).Verify()||DISubrange(DbgNode).Verify()||DIEnumerator(DbgNode).Verify()||DIObjCProperty(DbgNode).Verify()||DITemplateTypeParameter(DbgNode).Verify()||DITemplateValueParameter(DbgNode).Verify()||DIImportedEntity(DbgNode).Verify());}staticValue*getField(constMDNode*DbgNode,unsignedElt){if(DbgNode==0||Elt>=DbgNode->getNumOperands())return0;returnDbgNode->getOperand(Elt);}staticconstMDNode*getNodeField(constMDNode*DbgNode,unsigned