1*9880d681SAndroid Build Coastguard Worker //===-- llvm/CodeGen/DwarfStringPool.h - Dwarf Debug Framework -*- C++ -*--===// 2*9880d681SAndroid Build Coastguard Worker // 3*9880d681SAndroid Build Coastguard Worker // The LLVM Compiler Infrastructure 4*9880d681SAndroid Build Coastguard Worker // 5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source 6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details. 7*9880d681SAndroid Build Coastguard Worker // 8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===// 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFSTRINGPOOL_H 11*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFSTRINGPOOL_H 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Worker #include "llvm/ADT/StringMap.h" 14*9880d681SAndroid Build Coastguard Worker #include "llvm/CodeGen/DwarfStringPoolEntry.h" 15*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Allocator.h" 16*9880d681SAndroid Build Coastguard Worker #include <utility> 17*9880d681SAndroid Build Coastguard Worker 18*9880d681SAndroid Build Coastguard Worker namespace llvm { 19*9880d681SAndroid Build Coastguard Worker 20*9880d681SAndroid Build Coastguard Worker class AsmPrinter; 21*9880d681SAndroid Build Coastguard Worker class MCSymbol; 22*9880d681SAndroid Build Coastguard Worker class MCSection; 23*9880d681SAndroid Build Coastguard Worker class StringRef; 24*9880d681SAndroid Build Coastguard Worker 25*9880d681SAndroid Build Coastguard Worker // Collection of strings for this unit and assorted symbols. 26*9880d681SAndroid Build Coastguard Worker // A String->Symbol mapping of strings used by indirect 27*9880d681SAndroid Build Coastguard Worker // references. 28*9880d681SAndroid Build Coastguard Worker class DwarfStringPool { 29*9880d681SAndroid Build Coastguard Worker typedef DwarfStringPoolEntry EntryTy; 30*9880d681SAndroid Build Coastguard Worker StringMap<EntryTy, BumpPtrAllocator &> Pool; 31*9880d681SAndroid Build Coastguard Worker StringRef Prefix; 32*9880d681SAndroid Build Coastguard Worker unsigned NumBytes = 0; 33*9880d681SAndroid Build Coastguard Worker bool ShouldCreateSymbols; 34*9880d681SAndroid Build Coastguard Worker 35*9880d681SAndroid Build Coastguard Worker public: 36*9880d681SAndroid Build Coastguard Worker typedef DwarfStringPoolEntryRef EntryRef; 37*9880d681SAndroid Build Coastguard Worker 38*9880d681SAndroid Build Coastguard Worker DwarfStringPool(BumpPtrAllocator &A, AsmPrinter &Asm, StringRef Prefix); 39*9880d681SAndroid Build Coastguard Worker 40*9880d681SAndroid Build Coastguard Worker void emit(AsmPrinter &Asm, MCSection *StrSection, 41*9880d681SAndroid Build Coastguard Worker MCSection *OffsetSection = nullptr); 42*9880d681SAndroid Build Coastguard Worker empty()43*9880d681SAndroid Build Coastguard Worker bool empty() const { return Pool.empty(); } 44*9880d681SAndroid Build Coastguard Worker 45*9880d681SAndroid Build Coastguard Worker /// Get a reference to an entry in the string pool. 46*9880d681SAndroid Build Coastguard Worker EntryRef getEntry(AsmPrinter &Asm, StringRef Str); 47*9880d681SAndroid Build Coastguard Worker }; 48*9880d681SAndroid Build Coastguard Worker } 49*9880d681SAndroid Build Coastguard Worker #endif 50