- 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(); }
- 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;
- }
-
- unsigned getDebugInfoOffset() const { return DebugInfoOffset; }
- 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(); }
-
- /// getParentContextString - Get a string containing the language specific
- /// context for a global name.
- std::string getParentContextString(DIScope Context) const;
-
- /// addGlobalName - Add a new global entity to the compile unit.
- ///
- void addGlobalName(StringRef Name, DIE *Die, DIScope Context);
-
- /// addGlobalType - Add a new global type to the compile unit.
- ///
- void addGlobalType(DIType Ty);
-
- /// addPubTypes - Add a set of types from the subprogram to the global types.
- void addPubTypes(DISubprogram SP);
-
- /// addAccelName - Add a new name to the name accelerator table.
- void addAccelName(StringRef Name, DIE *Die);
-
- /// addAccelObjC - Add a new name to the ObjC accelerator table.
- void addAccelObjC(StringRef Name, DIE *Die);
-
- /// addAccelNamespace - Add a new name to the namespace accelerator table.
- void addAccelNamespace(StringRef Name, DIE *Die);
-
- /// addAccelType - Add a new type to the type accelerator table.
- void addAccelType(StringRef Name, std::pair<DIE *, unsigned> Die);
-
- /// getDIE - Returns the debug information entry map slot for the
- /// specified debug variable. We delegate the request to DwarfDebug
- /// when the MDNode can be part of the type system, since DIEs for
- /// the type system can be shared across CUs and the mappings are
- /// kept in DwarfDebug.
- DIE *getDIE(const MDNode *N) const;
-
- DIEBlock *getDIEBlock() { return new (DIEValueAllocator) DIEBlock(); }
-
- /// insertDIE - Insert DIE into the map. We delegate the request to DwarfDebug
- /// when the MDNode can be part of the type system, since DIEs for
- /// the type system can be shared across CUs and the mappings are
- /// kept in DwarfDebug.
- void insertDIE(const MDNode *N, DIE *D);
-
- /// addDie - Adds or interns the DIE to the compile unit.
- ///
- void addDie(DIE *Buffer) { CUDie->addChild(Buffer); }