diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2008-08-17 18:44:35 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2008-08-17 18:44:35 +0000 |
commit | 5eca075b74d62c621b160aa216b4cd50829a2cc7 (patch) | |
tree | 5406e0182a3a20726e00eec044bbca1199e673b9 /lib/Bitcode | |
parent | 94fb5f2a7066c427a9d3dac10a33ccbd02aac467 (diff) |
Rename some GC classes so that their roll will hopefully be clearer.
In particular, Collector was confusing to implementors. Several
thought that this compile-time class was the place to implement
their runtime GC heap. Of course, it doesn't even exist at runtime.
Specifically, the renames are:
Collector -> GCStrategy
CollectorMetadata -> GCFunctionInfo
CollectorModuleMetadata -> GCModuleInfo
CollectorRegistry -> GCRegistry
Function::getCollector -> getGC (setGC, hasGC, clearGC)
Several accessors and nested types have also been renamed to be
consistent. These changes should be obvious.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 16 | ||||
-rw-r--r-- | lib/Bitcode/Writer/BitcodeWriter.cpp | 20 |
2 files changed, 18 insertions, 18 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index f7796a6f9f..a842bd3643 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -892,7 +892,7 @@ bool BitcodeReader::ParseModule(const std::string &ModuleID) { SmallVector<uint64_t, 64> Record; std::vector<std::string> SectionTable; - std::vector<std::string> CollectorTable; + std::vector<std::string> GCTable; // Read all the records for this module. while (!Stream.AtEndOfStream()) { @@ -1019,11 +1019,11 @@ bool BitcodeReader::ParseModule(const std::string &ModuleID) { SectionTable.push_back(S); break; } - case bitc::MODULE_CODE_COLLECTORNAME: { // SECTIONNAME: [strchr x N] + case bitc::MODULE_CODE_GCNAME: { // SECTIONNAME: [strchr x N] std::string S; if (ConvertToString(Record, 0, S)) - return Error("Invalid MODULE_CODE_COLLECTORNAME record"); - CollectorTable.push_back(S); + return Error("Invalid MODULE_CODE_GCNAME record"); + GCTable.push_back(S); break; } // GLOBALVAR: [pointer type, isconst, initid, @@ -1070,7 +1070,7 @@ bool BitcodeReader::ParseModule(const std::string &ModuleID) { break; } // FUNCTION: [type, callingconv, isproto, linkage, paramattr, - // alignment, section, visibility, collector] + // alignment, section, visibility, gc] case bitc::MODULE_CODE_FUNCTION: { if (Record.size() < 8) return Error("Invalid MODULE_CODE_FUNCTION record"); @@ -1098,9 +1098,9 @@ bool BitcodeReader::ParseModule(const std::string &ModuleID) { } Func->setVisibility(GetDecodedVisibility(Record[7])); if (Record.size() > 8 && Record[8]) { - if (Record[8]-1 > CollectorTable.size()) - return Error("Invalid collector ID"); - Func->setCollector(CollectorTable[Record[8]-1].c_str()); + if (Record[8]-1 > GCTable.size()) + return Error("Invalid GC ID"); + Func->setGC(GCTable[Record[8]-1].c_str()); } ValueList.push_back(Func); diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index 2c585b1370..b5fb60778a 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -303,10 +303,10 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE, WriteStringRecord(bitc::MODULE_CODE_ASM, M->getModuleInlineAsm(), 0/*TODO*/, Stream); - // Emit information about sections and collectors, computing how many there - // are. Also compute the maximum alignment value. + // Emit information about sections and GC, computing how many there are. Also + // compute the maximum alignment value. std::map<std::string, unsigned> SectionMap; - std::map<std::string, unsigned> CollectorMap; + std::map<std::string, unsigned> GCMap; unsigned MaxAlignment = 0; unsigned MaxGlobalType = 0; for (Module::const_global_iterator GV = M->global_begin(),E = M->global_end(); @@ -333,13 +333,13 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE, Entry = SectionMap.size(); } } - if (F->hasCollector()) { - // Same for collector names. - unsigned &Entry = CollectorMap[F->getCollector()]; + if (F->hasGC()) { + // Same for GC names. + unsigned &Entry = GCMap[F->getGC()]; if (!Entry) { - WriteStringRecord(bitc::MODULE_CODE_COLLECTORNAME, F->getCollector(), + WriteStringRecord(bitc::MODULE_CODE_GCNAME, F->getGC(), 0/*TODO*/, Stream); - Entry = CollectorMap.size(); + Entry = GCMap.size(); } } } @@ -401,7 +401,7 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE, // Emit the function proto information. for (Module::const_iterator F = M->begin(), E = M->end(); F != E; ++F) { // FUNCTION: [type, callingconv, isproto, paramattr, - // linkage, alignment, section, visibility, collector] + // linkage, alignment, section, visibility, gc] Vals.push_back(VE.getTypeID(F->getType())); Vals.push_back(F->getCallingConv()); Vals.push_back(F->isDeclaration()); @@ -410,7 +410,7 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE, Vals.push_back(Log2_32(F->getAlignment())+1); Vals.push_back(F->hasSection() ? SectionMap[F->getSection()] : 0); Vals.push_back(getEncodedVisibility(F)); - Vals.push_back(F->hasCollector() ? CollectorMap[F->getCollector()] : 0); + Vals.push_back(F->hasGC() ? GCMap[F->getGC()] : 0); unsigned AbbrevToUse = 0; Stream.EmitRecord(bitc::MODULE_CODE_FUNCTION, Vals, AbbrevToUse); |