#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/DebugInfo.h"
+#include "llvm/MC/MCExpr.h"
namespace llvm {
public:
CompileUnit(unsigned UID, unsigned L, DIE *D, const MDNode *N, AsmPrinter *A,
- DwarfDebug *DW, DwarfUnits *DWU);
+ DwarfDebug *DW, DwarfUnits *DWU);
~CompileUnit();
// Accessors.
DIEs.push_back(Die);
}
void addAccelType(StringRef Name, std::pair<DIE *, unsigned> Die) {
- std::vector<std::pair<DIE*, unsigned > > &DIEs = AccelTypes[Name];
+ std::vector<std::pair<DIE *, unsigned> > &DIEs = AccelTypes[Name];
DIEs.push_back(Die);
}
/// getDIE - Returns the debug information entry map slot for the
/// specified debug variable.
- DIE *getDIE(const MDNode *N) { return MDNodeToDieMap.lookup(N); }
+ DIE *getDIE(const MDNode *N) const { return MDNodeToDieMap.lookup(N); }
DIEBlock *getDIEBlock() {
return new (DIEValueAllocator) DIEBlock();
/// getDIEEntry - Returns the debug information entry for the specified
/// debug variable.
- DIEEntry *getDIEEntry(const MDNode *N) {
- DenseMap<const MDNode *, DIEEntry *>::iterator I =
- MDNodeToDIEEntryMap.find(N);
- if (I == MDNodeToDIEEntryMap.end())
- return NULL;
- return I->second;
+ DIEEntry *getDIEEntry(const MDNode *N) const {
+ return MDNodeToDIEEntryMap.lookup(N);
}
/// insertDIEEntry - Insert debug information entry into the map.
///
void addLocalString(DIE *Die, unsigned Attribute, const StringRef Str);
+ /// addExpr - Add a Dwarf expression attribute data and value.
+ ///
+ void addExpr(DIE *Die, unsigned Attribute, unsigned Form,
+ const MCExpr *Expr);
+
/// addLabel - Add a Dwarf label attribute data and value.
///
void addLabel(DIE *Die, unsigned Attribute, unsigned Form,
/// addOpAddress - Add a dwarf op address data and value using the
/// form given and an op of either DW_FORM_addr or DW_FORM_GNU_addr_index.
///
- void addOpAddress(DIE *Die, MCSymbol *Label);
+ void addOpAddress(DIE *Die, const MCSymbol *Label);
+ void addOpAddress(DIE *Die, const MCSymbolRefExpr *Label);
/// addDelta - Add a label delta attribute data and value.
///
const MachineLocation &Location, bool Indirect = false);
/// addConstantValue - Add constant value entry in variable DIE.
- bool addConstantValue(DIE *Die, const MachineOperand &MO, DIType Ty);
- bool addConstantValue(DIE *Die, const ConstantInt *CI, bool Unsigned);
- bool addConstantValue(DIE *Die, const APInt &Val, bool Unsigned);
+ void addConstantValue(DIE *Die, const MachineOperand &MO, DIType Ty);
+ void addConstantValue(DIE *Die, const ConstantInt *CI, bool Unsigned);
+ void addConstantValue(DIE *Die, const APInt &Val, bool Unsigned);
/// addConstantFPValue - Add constant value entry in variable DIE.
- bool addConstantFPValue(DIE *Die, const MachineOperand &MO);
- bool addConstantFPValue(DIE *Die, const ConstantFP *CFP);
+ void addConstantFPValue(DIE *Die, const MachineOperand &MO);
+ void addConstantFPValue(DIE *Die, const ConstantFP *CFP);
/// addTemplateParams - Add template parameters in buffer.
void addTemplateParams(DIE &Buffer, DIArray TParams);
/// (navigating the extra location information encoded in the type) based on
/// the starting location. Add the DWARF information to the die.
///
- void addComplexAddress(DbgVariable *&DV, DIE *Die, unsigned Attribute,
+ void addComplexAddress(const DbgVariable &DV, DIE *Die, unsigned Attribute,
const MachineLocation &Location);
// FIXME: Should be reformulated in terms of addComplexAddress.
/// starting location. Add the DWARF information to the die. Obsolete,
/// please use addComplexAddress instead.
///
- void addBlockByrefAddress(DbgVariable *&DV, DIE *Die, unsigned Attribute,
+ void addBlockByrefAddress(const DbgVariable &DV, DIE *Die, unsigned Attribute,
const MachineLocation &Location);
/// addVariableAddress - Add DW_AT_location attribute for a
/// DbgVariable based on provided MachineLocation.
- void addVariableAddress(DbgVariable *&DV, DIE *Die, MachineLocation Location);
+ void addVariableAddress(const DbgVariable &DV, DIE *Die,
+ MachineLocation Location);
/// addToContextOwner - Add Die into the list of its context owner's children.
void addToContextOwner(DIE *Die, DIDescriptor Context);