//===--- 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/Analysis/DebugInfo.h"#include"llvm/Target/TargetMachine.h" // FIXME: LAYERING VIOLATION!#include"llvm/Constants.h"#include"llvm/DerivedTypes.h"#include"llvm/Intrinsics.h"#include"llvm/IntrinsicInst.h"#include"llvm/Instructions.h"#include"llvm/Module.h"#include"llvm/Analysis/ValueTracking.h"#include"llvm/ADT/SmallPtrSet.h"#include"llvm/Support/Debug.h"#include"llvm/Support/Dwarf.h"#include"llvm/Support/DebugLoc.h"#include"llvm/Support/raw_ostream.h"usingnamespacellvm;usingnamespacellvm::dwarf;//===----------------------------------------------------------------------===//// DIDescriptor//===----------------------------------------------------------------------===///// ValidDebugInfo - Return true if V represents valid debug info value./// FIXME : Add DIDescriptor.isValid()boolDIDescriptor::ValidDebugInfo(MDNode*N,unsignedOptLevel){if(!N)returnfalse;DIDescriptorDI(N);// Check current version. Allow Version7 for now.unsignedVersion=DI.getVersion();if(Version!=LLVMDebugVersion&&Version!=LLVMDebugVersion7)returnfalse;switch(DI.getTag()){caseDW_TAG_variable:assert(DIVariable(N).Verify()&&"Invalid DebugInfo value");break;caseDW_TAG_compile_unit:assert(DICompileUnit(N).Verify()&&"Invalid DebugInfo value");break;caseDW_TAG_subprogram:assert(DISubprogram(N).Verify()&&"Invalid DebugInfo value");break;caseDW_TAG_lexical_block:// FIXME: This interfers with the quality of generated code during// optimization.if(OptLevel!=