comparison lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp @ 33:e4204d083e25 LLVM3.5

LLVM 3.5
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Thu, 12 Dec 2013 14:32:10 +0900
parents 95c75e76d11b
children 54457678186b
comparison
equal deleted inserted replaced
1:f783a2dd24b1 33:e4204d083e25
29 : Header(8 + (atomList.size() * 4)), HeaderData(atomList), 29 : Header(8 + (atomList.size() * 4)), HeaderData(atomList),
30 Entries(Allocator) {} 30 Entries(Allocator) {}
31 31
32 DwarfAccelTable::~DwarfAccelTable() {} 32 DwarfAccelTable::~DwarfAccelTable() {}
33 33
34 void DwarfAccelTable::AddName(StringRef Name, DIE *die, char Flags) { 34 void DwarfAccelTable::AddName(StringRef Name, const DIE *die, char Flags) {
35 assert(Data.empty() && "Already finalized!"); 35 assert(Data.empty() && "Already finalized!");
36 // If the string is in the list already then add this die to the list 36 // If the string is in the list already then add this die to the list
37 // otherwise add a new one. 37 // otherwise add a new one.
38 DataArray &DIEs = Entries[Name]; 38 DataArray &DIEs = Entries[Name];
39 DIEs.push_back(new (Allocator) HashDataContents(die, Flags)); 39 DIEs.push_back(new (Allocator) HashDataContents(die, Flags));
170 } 170 }
171 171
172 // Walk through the buckets and emit the full data for each element in 172 // Walk through the buckets and emit the full data for each element in
173 // the bucket. For the string case emit the dies and the various offsets. 173 // the bucket. For the string case emit the dies and the various offsets.
174 // Terminate each HashData bucket with 0. 174 // Terminate each HashData bucket with 0.
175 void DwarfAccelTable::EmitData(AsmPrinter *Asm, DwarfUnits *D) { 175 void DwarfAccelTable::EmitData(AsmPrinter *Asm, DwarfFile *D) {
176 uint64_t PrevHash = UINT64_MAX; 176 uint64_t PrevHash = UINT64_MAX;
177 for (size_t i = 0, e = Buckets.size(); i < e; ++i) { 177 for (size_t i = 0, e = Buckets.size(); i < e; ++i) {
178 for (HashList::const_iterator HI = Buckets[i].begin(), 178 for (HashList::const_iterator HI = Buckets[i].begin(),
179 HE = Buckets[i].end(); 179 HE = Buckets[i].end();
180 HI != HE; ++HI) { 180 HI != HE; ++HI) {
205 } 205 }
206 } 206 }
207 } 207 }
208 208
209 // Emit the entire data structure to the output file. 209 // Emit the entire data structure to the output file.
210 void DwarfAccelTable::Emit(AsmPrinter *Asm, MCSymbol *SecBegin, DwarfUnits *D) { 210 void DwarfAccelTable::Emit(AsmPrinter *Asm, MCSymbol *SecBegin, DwarfFile *D) {
211 // Emit the header. 211 // Emit the header.
212 EmitHeader(Asm); 212 EmitHeader(Asm);
213 213
214 // Emit the buckets. 214 // Emit the buckets.
215 EmitBuckets(Asm); 215 EmitBuckets(Asm);