1 //===- MCDwarf.h - Machine Code Dwarf support -------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declaration of the MCDwarfFile to support the dwarf
12 // TODO: add the support needed for the .loc directive.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_MC_MCDWARF_H
17 #define LLVM_MC_MCDWARF_H
19 #include "llvm/ADT/StringRef.h"
25 /// MCDwarfFile - Instances of this class represent the name of the dwarf
26 /// .file directive and its associated dwarf file number in the MC file,
27 /// and MCDwarfFile's are created and unique'd by the MCContext class where
28 /// the file number for each is its index into the vector of DwarfFiles (note
29 /// index 0 is not used and not a valid dwarf file number).
31 // Name - the base name of the file without its directory path.
32 // The StringRef references memory allocated in the MCContext.
35 // DirIndex - the index into the list of directory names for this file name.
38 private: // MCContext creates and uniques these.
39 friend class MCContext;
40 MCDwarfFile(StringRef name, unsigned dirIndex)
41 : Name(name), DirIndex(dirIndex) {}
43 MCDwarfFile(const MCDwarfFile&); // DO NOT IMPLEMENT
44 void operator=(const MCDwarfFile&); // DO NOT IMPLEMENT
46 /// getName - Get the base name of this MCDwarfFile.
47 StringRef getName() const { return Name; }
49 /// getDirIndex - Get the dirIndex of this MCDwarfFile.
50 unsigned getDirIndex() const { return DirIndex; }
53 /// print - Print the value to the stream \arg OS.
54 void print(raw_ostream &OS) const;
56 /// dump - Print the value to stderr.
60 inline raw_ostream &operator<<(raw_ostream &OS, const MCDwarfFile &DwarfFile){
64 } // end namespace llvm