//===-- llvm/CodeGen/DwarfWriter.cpp - Dwarf Framework ----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by James M. Laskey and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains support for writing dwarf debug info into asm files.
//
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/MachineDebugInfo.h"
#include "llvm/Support/CommandLine.h"
#include <iostream>
using namespace llvm;
static cl::opt<bool>
DwarfVerbose("dwarf-verbose", cl::Hidden,
cl::desc("Add comments to Dwarf directives."));
//===----------------------------------------------------------------------===//
// Dwarf abbreviations used by this emitter.
//
static const unsigned char AbbrevTAG_compile_unit[] = {
DW_TAG_compile_unit, DW_CHILDREN_yes,
DW_AT_stmt_list, DW_FORM_data4,
DW_AT_high_pc, DW_FORM_addr,
DW_AT_low_pc, DW_FORM_addr,
DW_AT_producer, DW_FORM_string,
DW_AT_language, DW_FORM_data1,
DW_AT_name, DW_FORM_string,
DW_AT_comp_dir, DW_FORM_string,
0, 0
};
static const unsigned char AbbrevTAG_subprogram[] = {
DW_TAG_subprogram, DW_CHILDREN_yes,
DW_AT_sibling, DW_FORM_ref4,
DW_AT_external, DW_FORM_flag,
DW_AT_name, DW_FORM_string,
DW_AT_decl_file, DW_FORM_data1,
DW_AT_decl_line, DW_FORM_data1,
DW_AT_prototyped, DW_FORM_flag,
DW_AT_type, DW_FORM_ref4,
DW_AT_low_pc, DW_FORM_addr,
DW_AT_high_pc, DW_FORM_addr,
DW_AT_frame_base, DW_FORM_block1,
0, 0
};
static