forked from OSchip/llvm-project
[COFF] Rename variale references in comments after VariableName -> variableName change
llvm-svn: 366193
This commit is contained in:
parent
33fdf82dda
commit
2e2038b647
|
@ -31,10 +31,10 @@ namespace coff {
|
|||
|
||||
SectionChunk::SectionChunk(ObjFile *f, const coff_section *h)
|
||||
: Chunk(SectionKind), file(f), header(h), repl(this) {
|
||||
// Initialize Relocs.
|
||||
// Initialize relocs.
|
||||
setRelocs(file->getCOFFObj()->getRelocations(header));
|
||||
|
||||
// Initialize SectionName.
|
||||
// Initialize sectionName.
|
||||
StringRef sectionName;
|
||||
if (Expected<StringRef> e = file->getCOFFObj()->getSectionName(header))
|
||||
sectionName = *e;
|
||||
|
@ -218,7 +218,7 @@ void applyArm64Addr(uint8_t *off, uint64_t s, uint64_t p, int shift) {
|
|||
|
||||
// Update the immediate field in a AARCH64 ldr, str, and add instruction.
|
||||
// Optionally limit the range of the written immediate by one or more bits
|
||||
// (RangeLimit).
|
||||
// (rangeLimit).
|
||||
void applyArm64Imm(uint8_t *off, uint64_t imm, uint32_t rangeLimit) {
|
||||
uint32_t orig = read32le(off);
|
||||
imm += (orig >> 10) & 0xFFF;
|
||||
|
@ -561,7 +561,7 @@ void SectionChunk::getRuntimePseudoRelocs(
|
|||
toString(file));
|
||||
continue;
|
||||
}
|
||||
// SizeInBits is used to initialize the Flags field; currently no
|
||||
// sizeInBits is used to initialize the Flags field; currently no
|
||||
// other flags are defined.
|
||||
res.emplace_back(
|
||||
RuntimePseudoReloc(target, this, rel.VirtualAddress, sizeInBits));
|
||||
|
|
|
@ -49,7 +49,7 @@ struct Export {
|
|||
|
||||
// If an export is a form of /export:foo=dllname.bar, that means
|
||||
// that foo should be exported as an alias to bar in the DLL.
|
||||
// ForwardTo is set to "dllname.bar" part. Usually empty.
|
||||
// forwardTo is set to "dllname.bar" part. Usually empty.
|
||||
StringRef forwardTo;
|
||||
StringChunk *forwardChunk = nullptr;
|
||||
|
||||
|
|
|
@ -567,7 +567,7 @@ void IdataContents::create() {
|
|||
// Create .idata contents for each DLL.
|
||||
for (std::vector<DefinedImportData *> &syms : v) {
|
||||
// Create lookup and address tables. If they have external names,
|
||||
// we need to create HintName chunks to store the names.
|
||||
// we need to create hintName chunks to store the names.
|
||||
// If they don't (if they are import-by-ordinals), we store only
|
||||
// ordinal values to the table.
|
||||
size_t base = lookups.size();
|
||||
|
|
|
@ -936,7 +936,7 @@ static void findKeepUniqueSections() {
|
|||
}
|
||||
}
|
||||
|
||||
// link.exe replaces each %foo% in AltPath with the contents of environment
|
||||
// link.exe replaces each %foo% in altPath with the contents of environment
|
||||
// variable foo, and adds the two magic env vars _PDB (expands to the basename
|
||||
// of pdb's output path) and _EXT (expands to the extension of the output
|
||||
// binary).
|
||||
|
@ -952,9 +952,9 @@ static void parsePDBAltPath(StringRef altPath) {
|
|||
binaryExtension = binaryExtension.substr(1); // %_EXT% does not include '.'.
|
||||
|
||||
// Invariant:
|
||||
// +--------- Cursor ('a...' might be the empty string).
|
||||
// | +----- FirstMark
|
||||
// | | +- SecondMark
|
||||
// +--------- cursor ('a...' might be the empty string).
|
||||
// | +----- firstMark
|
||||
// | | +- secondMark
|
||||
// v v v
|
||||
// a...%...%...
|
||||
size_t cursor = 0;
|
||||
|
|
|
@ -345,7 +345,7 @@ public:
|
|||
// so it is safe to remove the file immediately after this function
|
||||
// is called (you cannot remove an opened file on Windows.)
|
||||
std::unique_ptr<MemoryBuffer> getMemoryBuffer() {
|
||||
// IsVolatileSize=true forces MemoryBuffer to not use mmap().
|
||||
// IsVolatile=true forces MemoryBuffer to not use mmap().
|
||||
return CHECK(MemoryBuffer::getFile(path, /*FileSize=*/-1,
|
||||
/*RequiresNullTerminator=*/false,
|
||||
/*IsVolatile=*/true),
|
||||
|
|
|
@ -556,8 +556,8 @@ Optional<Symbol *> ObjFile::createDefined(
|
|||
// The second symbol entry has the name of the comdat symbol, called the
|
||||
// "comdat leader".
|
||||
// When this function is called for the first symbol entry of a comdat,
|
||||
// it sets ComdatDefs and returns None, and when it's called for the second
|
||||
// symbol entry it reads ComdatDefs and then sets it back to nullptr.
|
||||
// it sets comdatDefs and returns None, and when it's called for the second
|
||||
// symbol entry it reads comdatDefs and then sets it back to nullptr.
|
||||
|
||||
// Handle comdat leader.
|
||||
if (const coff_aux_section_definition *def = comdatDefs[sectionNumber]) {
|
||||
|
@ -626,7 +626,7 @@ ArrayRef<uint8_t> ObjFile::getDebugSection(StringRef secName) {
|
|||
// even if the TU was compiled with no debug info. At least two records are
|
||||
// always there. S_OBJNAME stores a 32-bit signature, which is loaded into the
|
||||
// PCHSignature member. S_COMPILE3 stores compile-time cmd-line flags. This is
|
||||
// currently used to initialize the HotPatchable member.
|
||||
// currently used to initialize the hotPatchable member.
|
||||
void ObjFile::initializeFlags() {
|
||||
ArrayRef<uint8_t> data = getDebugSection(".debug$S");
|
||||
if (data.empty())
|
||||
|
@ -764,7 +764,7 @@ void ImportFile::parse() {
|
|||
|
||||
impSym = symtab->addImportData(impName, this);
|
||||
// If this was a duplicate, we logged an error but may continue;
|
||||
// in this case, ImpSym is nullptr.
|
||||
// in this case, impSym is nullptr.
|
||||
if (!impSym)
|
||||
return;
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ public:
|
|||
|
||||
ArrayRef<uint8_t> getDebugSection(StringRef secName);
|
||||
|
||||
// Returns a Symbol object for the SymbolIndex'th symbol in the
|
||||
// Returns a Symbol object for the symbolIndex'th symbol in the
|
||||
// underlying object file.
|
||||
Symbol *getSymbol(uint32_t symbolIndex) {
|
||||
return symbols[symbolIndex];
|
||||
|
|
|
@ -119,7 +119,7 @@ public:
|
|||
///
|
||||
/// If the object does not use a type server PDB (compiled with /Z7), we merge
|
||||
/// all the type and item records from the .debug$S stream and fill in the
|
||||
/// caller-provided ObjectIndexMap.
|
||||
/// caller-provided objectIndexMap.
|
||||
Expected<const CVIndexMap &> mergeDebugT(ObjFile *file,
|
||||
CVIndexMap *objectIndexMap);
|
||||
|
||||
|
@ -683,7 +683,7 @@ static void translateIdSymbols(MutableArrayRef<uint8_t> &recordData,
|
|||
|
||||
TypeIndex *ti =
|
||||
reinterpret_cast<TypeIndex *>(content.data() + refs[0].Offset);
|
||||
// `TI` is the index of a FuncIdRecord or MemberFuncIdRecord which lives in
|
||||
// `ti` is the index of a FuncIdRecord or MemberFuncIdRecord which lives in
|
||||
// the IPI stream, whose `FunctionType` member refers to the TPI stream.
|
||||
// Note that LF_FUNC_ID and LF_MEMFUNC_ID have the same record layout, and
|
||||
// in both cases we just need the second type index.
|
||||
|
@ -1729,7 +1729,7 @@ static bool findLineTable(const SectionChunk *c, uint32_t addr,
|
|||
if (dbgC->getSectionName() != ".debug$S")
|
||||
continue;
|
||||
|
||||
// Build a mapping of SECREL relocations in DbgC that refer to C.
|
||||
// Build a mapping of SECREL relocations in dbgC that refer to `c`.
|
||||
DenseMap<uint32_t, uint32_t> secrels;
|
||||
for (const coff_relocation &r : dbgC->getRelocs()) {
|
||||
if (r.Type != secrelReloc)
|
||||
|
|
|
@ -192,7 +192,7 @@ bool SymbolTable::handleMinGWAutomaticImport(Symbol *sym, StringRef name) {
|
|||
|
||||
// Replace the reference directly to a variable with a reference
|
||||
// to the import address table instead. This obviously isn't right,
|
||||
// but we mark the symbol as IsRuntimePseudoReloc, and a later pass
|
||||
// but we mark the symbol as isRuntimePseudoReloc, and a later pass
|
||||
// will add runtime pseudo relocations for every relocation against
|
||||
// this Symbol. The runtime pseudo relocation framework expects the
|
||||
// reference itself to point at the IAT entry.
|
||||
|
|
|
@ -112,7 +112,7 @@ public:
|
|||
private:
|
||||
/// Inserts symbol if not already present.
|
||||
std::pair<Symbol *, bool> insert(StringRef name);
|
||||
/// Same as insert(Name), but also sets IsUsedInRegularObj.
|
||||
/// Same as insert(Name), but also sets isUsedInRegularObj.
|
||||
std::pair<Symbol *, bool> insert(StringRef name, InputFile *f);
|
||||
|
||||
std::vector<Symbol *> getSymsWithPrefix(StringRef prefix);
|
||||
|
|
|
@ -335,7 +335,7 @@ void OutputSection::addContributingPartialSection(PartialSection *sec) {
|
|||
} // namespace lld
|
||||
|
||||
// Check whether the target address S is in range from a relocation
|
||||
// of type RelType at address P.
|
||||
// of type relType at address P.
|
||||
static bool isInRange(uint16_t relType, uint64_t s, uint64_t p, int margin) {
|
||||
if (config->machine == ARMNT) {
|
||||
int64_t diff = AbsoluteDifference(s, p + 4) + margin;
|
||||
|
@ -427,7 +427,7 @@ static bool createThunks(OutputSection *os, int margin) {
|
|||
|
||||
// The estimate of the source address P should be pretty accurate,
|
||||
// but we don't know whether the target Symbol address should be
|
||||
// offset by ThunkSize or not (or by some of ThunksSize but not all of
|
||||
// offset by thunksSize or not (or by some of thunksSize but not all of
|
||||
// it), giving us some uncertainty once we have added one thunk.
|
||||
uint64_t p = sc->getRVA() + rel.VirtualAddress + thunksSize;
|
||||
|
||||
|
@ -1626,7 +1626,7 @@ void Writer::markSymbolsForRVATable(ObjFile *file,
|
|||
}
|
||||
|
||||
// Replace the absolute table symbol with a synthetic symbol pointing to
|
||||
// TableChunk so that we can emit base relocations for it and resolve section
|
||||
// tableChunk so that we can emit base relocations for it and resolve section
|
||||
// relative relocations.
|
||||
void Writer::maybeAddRVATable(SymbolRVASet tableSymbols, StringRef tableSym,
|
||||
StringRef countSym) {
|
||||
|
|
Loading…
Reference in New Issue