- CompileUnit(unsigned UID, DIE *D, const MDNode *N, AsmPrinter *A,
- DwarfDebug *DW, DwarfUnits *DWU);
- ~CompileUnit();
-
- // Accessors.
- unsigned getUniqueID() const { return UniqueID; }
- uint16_t getLanguage() const { return DICompileUnit(Node).getLanguage(); }
- const MDNode *getNode() const { return Node; }
- 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) const { 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) const {
- return MDNodeToDIEEntryMap.lookup(N);
- }
-
- /// insertDIEEntry - Insert debug information entry into the map.
- void insertDIEEntry(const MDNode *N, DIEEntry *E) {
- MDNodeToDIEEntryMap.insert(std::make_pair(N, E));
- }
-
- /// addDie - Adds or interns the DIE to the compile unit.
- ///
- void addDie(DIE *Buffer) {
- this->CUDie->addChild(Buffer);
- }
-
- // getIndexTyDie - Get an anonymous type for index type.
- DIE *getIndexTyDie() {
- return IndexTyDie;
- }
-
- // setIndexTyDie - Set D as anonymous type for index which can be reused
- // later.
- void setIndexTyDie(DIE *D) {
- IndexTyDie = D;
- }
-
- /// addFlag - Add a flag that is true to the DIE.
- void addFlag(DIE *Die, uint16_t Attribute);