lint: Fix style for backend Relocators
diff --git a/include/mcld/LD/LDSection.h b/include/mcld/LD/LDSection.h
index c77a31b..a607873 100644
--- a/include/mcld/LD/LDSection.h
+++ b/include/mcld/LD/LDSection.h
@@ -170,7 +170,7 @@
void setIndex(size_t pIndex) { m_Index = pIndex; }
-private:
+ private:
union Data {
SectionData* sect_data;
RelocData* reloc_data;
diff --git a/include/mcld/LD/Relocator.h b/include/mcld/LD/Relocator.h
index 62a529c..497d55f 100644
--- a/include/mcld/LD/Relocator.h
+++ b/include/mcld/LD/Relocator.h
@@ -117,10 +117,10 @@
/// This is used to set the debug string offset.
virtual void applyDebugStringOffset(Relocation& pReloc, uint32_t pOffset) = 0;
-protected:
+ protected:
const LinkerConfig& config() const { return m_Config; }
-private:
+ private:
const LinkerConfig& m_Config;
};
diff --git a/lib/Core/IRBuilder.cpp b/lib/Core/IRBuilder.cpp
index 910d6aa..cba42ef 100644
--- a/lib/Core/IRBuilder.cpp
+++ b/lib/Core/IRBuilder.cpp
@@ -308,8 +308,7 @@
}
/// CreateDebugString - To create a DebugString for given pSection
-DebugString* IRBuilder::CreateDebugString(LDSection& pSection)
-{
+DebugString* IRBuilder::CreateDebugString(LDSection& pSection) {
assert(!pSection.hasDebugString() && "pSection already has debug_str.");
DebugString* debug_str = DebugString::Create(pSection);
diff --git a/lib/Object/ObjectLinker.cpp b/lib/Object/ObjectLinker.cpp
index 7a77a51..e5bcb9a 100644
--- a/lib/Object/ObjectLinker.cpp
+++ b/lib/Object/ObjectLinker.cpp
@@ -791,9 +791,10 @@
// apply the relocation aginst symbol on DebugString
if (info->outSymbol()->hasFragRef() &&
- info->outSymbol()->fragRef()->frag()->getKind() == Fragment::Region &&
- info->outSymbol()->fragRef()->frag()->getParent()->getSection().kind() ==
- LDFileFormat::DebugString) {
+ info->outSymbol()->fragRef()->frag()->getKind()
+ == Fragment::Region &&
+ info->outSymbol()->fragRef()->frag()->getParent()->getSection()
+ .kind() == LDFileFormat::DebugString) {
assert(debug_str_sect != NULL);
assert(debug_str_sect->hasDebugString());
debug_str_sect->getDebugString()->applyOffset(*relocation,
diff --git a/lib/Target/AArch64/AArch64Relocator.cpp b/lib/Target/AArch64/AArch64Relocator.cpp
index 7c277be..0458b2b 100644
--- a/lib/Target/AArch64/AArch64Relocator.cpp
+++ b/lib/Target/AArch64/AArch64Relocator.cpp
@@ -397,21 +397,20 @@
issueUndefRef(pReloc, pSection, pInput);
}
-uint32_t AArch64Relocator::getDebugStringOffset(Relocation& pReloc) const
-{
+uint32_t AArch64Relocator::getDebugStringOffset(Relocation& pReloc) const {
if (pReloc.type() != llvm::ELF::R_AARCH64_ABS32)
- error(diag::unsupport_reloc_for_debug_string) << getName(pReloc.type())
- << "mclinker@googlegroups.com";
+ error(diag::unsupport_reloc_for_debug_string)
+ << getName(pReloc.type()) << "mclinker@googlegroups.com";
+
if (pReloc.symInfo()->type() == ResolveInfo::Section)
return pReloc.target();
else
return pReloc.symInfo()->outSymbol()->fragRef()->offset() +
- pReloc.target() + pReloc.addend();
+ pReloc.target() + pReloc.addend();
}
void AArch64Relocator::applyDebugStringOffset(Relocation& pReloc,
- uint32_t pOffset)
-{
+ uint32_t pOffset) {
pReloc.target() = pOffset;
}
diff --git a/lib/Target/AArch64/AArch64Relocator.h b/lib/Target/AArch64/AArch64Relocator.h
index 1b97765..46931a9 100644
--- a/lib/Target/AArch64/AArch64Relocator.h
+++ b/lib/Target/AArch64/AArch64Relocator.h
@@ -119,7 +119,7 @@
/// This is used to set the debug string offset.
void applyDebugStringOffset(Relocation& pReloc, uint32_t pOffset);
-private:
+ private:
void scanLocalReloc(Relocation& pReloc, const LDSection& pSection);
void scanGlobalReloc(Relocation& pReloc,
diff --git a/lib/Target/ARM/ARMRelocator.cpp b/lib/Target/ARM/ARMRelocator.cpp
index 1dc05e5..d3e358a 100644
--- a/lib/Target/ARM/ARMRelocator.cpp
+++ b/lib/Target/ARM/ARMRelocator.cpp
@@ -757,20 +757,20 @@
issueUndefRef(pReloc, pSection, pInput);
}
-uint32_t ARMRelocator::getDebugStringOffset(Relocation& pReloc) const
-{
+uint32_t ARMRelocator::getDebugStringOffset(Relocation& pReloc) const {
if (pReloc.type() != llvm::ELF::R_ARM_ABS32)
- error(diag::unsupport_reloc_for_debug_string) << getName(pReloc.type())
- << "mclinker@googlegroups.com";
+ error(diag::unsupport_reloc_for_debug_string)
+ << getName(pReloc.type()) << "mclinker@googlegroups.com";
+
if (pReloc.symInfo()->type() == ResolveInfo::Section)
return pReloc.target();
else
return pReloc.symInfo()->outSymbol()->fragRef()->offset() +
- pReloc.target() + pReloc.addend();
+ pReloc.target() + pReloc.addend();
}
-void ARMRelocator::applyDebugStringOffset(Relocation& pReloc, uint32_t pOffset)
-{
+void ARMRelocator::applyDebugStringOffset(Relocation& pReloc,
+ uint32_t pOffset) {
pReloc.target() = pOffset;
}
diff --git a/lib/Target/ARM/ARMRelocator.h b/lib/Target/ARM/ARMRelocator.h
index 37ca0f0..597d563 100644
--- a/lib/Target/ARM/ARMRelocator.h
+++ b/lib/Target/ARM/ARMRelocator.h
@@ -104,7 +104,7 @@
/// This is used to set the debug string offset.
void applyDebugStringOffset(Relocation& pReloc, uint32_t pOffset);
-private:
+ private:
void scanLocalReloc(Relocation& pReloc, const LDSection& pSection);
void scanGlobalReloc(Relocation& pReloc,
diff --git a/lib/Target/Hexagon/HexagonRelocator.h b/lib/Target/Hexagon/HexagonRelocator.h
index 9f6bae7..1136edb 100644
--- a/lib/Target/Hexagon/HexagonRelocator.h
+++ b/lib/Target/Hexagon/HexagonRelocator.h
@@ -114,7 +114,7 @@
/// This is used to set the debug string offset.
void applyDebugStringOffset(Relocation& pReloc, uint32_t pOffset) {}
-protected:
+ protected:
/// addCopyReloc - add a copy relocation into .rela.dyn for pSym
/// @param pSym - A resolved copy symbol that defined in BSS section
void addCopyReloc(ResolveInfo& pSym, HexagonLDBackend& pTarget);
diff --git a/lib/Target/Mips/MipsRelocator.cpp b/lib/Target/Mips/MipsRelocator.cpp
index 0067572..50d3241 100644
--- a/lib/Target/Mips/MipsRelocator.cpp
+++ b/lib/Target/Mips/MipsRelocator.cpp
@@ -682,21 +682,19 @@
return getTarget().getPLT().addr() + plt->getOffset();
}
-uint32_t MipsRelocator::getDebugStringOffset(Relocation& pReloc) const
-{
+uint32_t MipsRelocator::getDebugStringOffset(Relocation& pReloc) const {
if (pReloc.type() != llvm::ELF::R_MIPS_32)
- error(diag::unsupport_reloc_for_debug_string) << getName(pReloc.type())
- << "mclinker@googlegroups.com";
+ error(diag::unsupport_reloc_for_debug_string)
+ << getName(pReloc.type()) << "mclinker@googlegroups.com";
if (pReloc.symInfo()->type() == ResolveInfo::Section)
return pReloc.target();
else
return pReloc.symInfo()->outSymbol()->fragRef()->offset() +
- pReloc.target() + pReloc.addend();
+ pReloc.target() + pReloc.addend();
}
void MipsRelocator::applyDebugStringOffset(Relocation& pReloc,
- uint32_t pOffset)
-{
+ uint32_t pOffset) {
pReloc.target() = pOffset;
}
diff --git a/lib/Target/Mips/MipsRelocator.h b/lib/Target/Mips/MipsRelocator.h
index 97f19a5..be3b398 100644
--- a/lib/Target/Mips/MipsRelocator.h
+++ b/lib/Target/Mips/MipsRelocator.h
@@ -176,7 +176,7 @@
public:
Mips32Relocator(Mips32GNULDBackend& pParent, const LinkerConfig& pConfig);
-private:
+ private:
// MipsRelocator
void setupRelDynEntry(FragmentRef& pFragRef, ResolveInfo* pSym);
};
diff --git a/lib/Target/X86/X86Relocator.cpp b/lib/Target/X86/X86Relocator.cpp
index 9ce1c09..05198cc 100644
--- a/lib/Target/X86/X86Relocator.cpp
+++ b/lib/Target/X86/X86Relocator.cpp
@@ -830,21 +830,20 @@
pReloc.setType(llvm::ELF::R_386_TLS_LE);
}
-uint32_t X86_32Relocator::getDebugStringOffset(Relocation& pReloc) const
-{
+uint32_t X86_32Relocator::getDebugStringOffset(Relocation& pReloc) const {
if (pReloc.type() != llvm::ELF::R_386_32)
- error(diag::unsupport_reloc_for_debug_string) << getName(pReloc.type())
- << "mclinker@googlegroups.com";
+ error(diag::unsupport_reloc_for_debug_string)
+ << getName(pReloc.type()) << "mclinker@googlegroups.com";
+
if (pReloc.symInfo()->type() == ResolveInfo::Section)
return pReloc.target();
else
return pReloc.symInfo()->outSymbol()->fragRef()->offset() +
- pReloc.target() + pReloc.addend();
+ pReloc.target() + pReloc.addend();
}
void X86_32Relocator::applyDebugStringOffset(Relocation& pReloc,
- uint32_t pOffset)
-{
+ uint32_t pOffset) {
pReloc.target() = pOffset;
}
@@ -1500,21 +1499,20 @@
} // end switch
}
-uint32_t X86_64Relocator::getDebugStringOffset(Relocation& pReloc) const
-{
+uint32_t X86_64Relocator::getDebugStringOffset(Relocation& pReloc) const {
if (pReloc.type() != llvm::ELF::R_X86_64_32)
- error(diag::unsupport_reloc_for_debug_string) << getName(pReloc.type())
- << "mclinker@googlegroups.com";
+ error(diag::unsupport_reloc_for_debug_string)
+ << getName(pReloc.type()) << "mclinker@googlegroups.com";
+
if (pReloc.symInfo()->type() == ResolveInfo::Section)
return pReloc.target();
else
return pReloc.symInfo()->outSymbol()->fragRef()->offset() +
- pReloc.target() + pReloc.addend();
+ pReloc.target() + pReloc.addend();
}
void X86_64Relocator::applyDebugStringOffset(Relocation& pReloc,
- uint32_t pOffset)
-{
+ uint32_t pOffset) {
pReloc.target() = pOffset;
}
diff --git a/lib/Target/X86/X86Relocator.h b/lib/Target/X86/X86Relocator.h
index 3c6ce7e..06c401d 100644
--- a/lib/Target/X86/X86Relocator.h
+++ b/lib/Target/X86/X86Relocator.h
@@ -156,7 +156,7 @@
/// This is used to set the debug string offset.
void applyDebugStringOffset(Relocation& pReloc, uint32_t pOffset);
-private:
+ private:
void scanLocalReloc(Relocation& pReloc,
IRBuilder& pBuilder,
Module& pModule,
@@ -221,7 +221,7 @@
/// This is used to set the debug string offset.
void applyDebugStringOffset(Relocation& pReloc, uint32_t pOffset);
-private:
+ private:
void scanLocalReloc(Relocation& pReloc,
IRBuilder& pBuilder,
Module& pModule,