- CompileUnit(unsigned UID, unsigned L, DIE *D, const MDNode *N, AsmPrinter *A,
- DwarfDebug *DW, DwarfUnits *DWU);
- ~CompileUnit();
-
- // Accessors.
- unsigned getUniqueID() const { return UniqueID; }
- unsigned getLanguage() const { return Language; }
- DIE* getCUDie() const { return CUDie.get(); }
- unsigned getDebugInfoOffset() const { return DebugInfoOffset; }
- const StringMap<DIE*> &getGlobalNames() const { return GlobalNames; }
- const StringMap<DIE*> &getGlobalTypes() const { return GlobalTypes; }
-
- const StringMap<std::vector<DIE*> > &getAccelNames() const {
- return AccelNames;
- }
- const StringMap<std::vector<DIE*> > &getAccelObjC() const {
- return AccelObjC;
- }
- const StringMap<std::vector<DIE*> > &getAccelNamespace() const {
- return AccelNamespace;
- }
- const StringMap<std::vector<std::pair<DIE*, unsigned > > >
- &getAccelTypes() const {
- return AccelTypes;
- }
-
- void setDebugInfoOffset(unsigned DbgInfoOff) { DebugInfoOffset = DbgInfoOff; }
- /// hasContent - Return true if this compile unit has something to write out.
- ///
- bool hasContent() const { return !CUDie->getChildren().empty(); }
-
- /// addGlobalName - Add a new global entity to the compile unit.
- ///
- void addGlobalName(StringRef Name, DIE *Die) { GlobalNames[Name] = Die; }
-
- /// addGlobalType - Add a new global type to the compile unit.
- ///
- void addGlobalType(DIType Ty);
-
-
- /// addAccelName - Add a new name to the name accelerator table.
- void addAccelName(StringRef Name, DIE *Die) {
- std::vector<DIE*> &DIEs = AccelNames[Name];
- DIEs.push_back(Die);
- }
- void addAccelObjC(StringRef Name, DIE *Die) {
- std::vector<DIE*> &DIEs = AccelObjC[Name];
- DIEs.push_back(Die);
- }
- void addAccelNamespace(StringRef Name, DIE *Die) {
- std::vector<DIE*> &DIEs = AccelNamespace[Name];
- DIEs.push_back(Die);
- }
- void addAccelType(StringRef Name, std::pair<DIE *, unsigned> Die) {
- 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); }
-
- DIEBlock *getDIEBlock() {
- return new (DIEValueAllocator) DIEBlock();
- }
-
- /// insertDIE - Insert DIE into the map.
- void insertDIE(const MDNode *N, DIE *D) {
- MDNodeToDieMap.insert(std::make_pair(N, D));
- }
-
- /// 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;
- }