Tidy up. Trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156602 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach 2012-05-11 01:41:30 +00:00
parent 639aa87bee
commit 2684d9e3c7
12 changed files with 35 additions and 35 deletions

View File

@ -627,7 +627,7 @@ void ELFObjectWriter::WriteSymbolTable(MCDataFragment *SymtabF,
const MCSymbol *ELFObjectWriter::SymbolToReloc(const MCAssembler &Asm, const MCSymbol *ELFObjectWriter::SymbolToReloc(const MCAssembler &Asm,
const MCValue &Target, const MCValue &Target,
const MCFragment &F, const MCFragment &F,
const MCFixup &Fixup, const MCFixup &Fixup,
bool IsPCRel) const { bool IsPCRel) const {
const MCSymbol &Symbol = Target.getSymA()->getSymbol(); const MCSymbol &Symbol = Target.getSymA()->getSymbol();

View File

@ -39,7 +39,7 @@ MCAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
{ "FK_SecRel_4", 0, 32, 0 }, { "FK_SecRel_4", 0, 32, 0 },
{ "FK_SecRel_8", 0, 64, 0 } { "FK_SecRel_8", 0, 64, 0 }
}; };
assert((size_t)Kind <= sizeof(Builtins) / sizeof(Builtins[0]) && assert((size_t)Kind <= sizeof(Builtins) / sizeof(Builtins[0]) &&
"Unknown fixup kind"); "Unknown fixup kind");
return Builtins[Kind]; return Builtins[Kind];

View File

@ -26,7 +26,7 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() {
PrivateGlobalPrefix = "L"; // Prefix for private global symbols PrivateGlobalPrefix = "L"; // Prefix for private global symbols
WeakRefDirective = "\t.weak\t"; WeakRefDirective = "\t.weak\t";
LinkOnceDirective = "\t.linkonce discard\n"; LinkOnceDirective = "\t.linkonce discard\n";
// Doesn't support visibility: // Doesn't support visibility:
HiddenVisibilityAttr = HiddenDeclarationVisibilityAttr = MCSA_Invalid; HiddenVisibilityAttr = HiddenDeclarationVisibilityAttr = MCSA_Invalid;
ProtectedVisibilityAttr = MCSA_Invalid; ProtectedVisibilityAttr = MCSA_Invalid;

View File

@ -18,7 +18,7 @@
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
using namespace llvm; using namespace llvm;
void MCAsmInfoDarwin::anchor() { } void MCAsmInfoDarwin::anchor() { }
MCAsmInfoDarwin::MCAsmInfoDarwin() { MCAsmInfoDarwin::MCAsmInfoDarwin() {
// Common settings for all Darwin targets. // Common settings for all Darwin targets.
@ -61,7 +61,7 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
// Doesn't support protected visibility. // Doesn't support protected visibility.
ProtectedVisibilityAttr = MCSA_Invalid; ProtectedVisibilityAttr = MCSA_Invalid;
HasDotTypeDotSizeDirective = false; HasDotTypeDotSizeDirective = false;
HasNoDeadStrip = true; HasNoDeadStrip = true;
HasSymbolResolver = true; HasSymbolResolver = true;

View File

@ -826,7 +826,7 @@ void MCAsmStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
if (IsVerboseAsm) { if (IsVerboseAsm) {
OS.PadToColumn(MAI.getCommentColumn()); OS.PadToColumn(MAI.getCommentColumn());
OS << MAI.getCommentString() << ' ' << FileName << ':' OS << MAI.getCommentString() << ' ' << FileName << ':'
<< Line << ':' << Column; << Line << ':' << Column;
} }
EmitEOL(); EmitEOL();

View File

@ -36,7 +36,7 @@ using namespace llvm;
// First special line opcode - leave room for the standard opcodes. // First special line opcode - leave room for the standard opcodes.
// Note: If you want to change this, you'll have to update the // Note: If you want to change this, you'll have to update the
// "standard_opcode_lengths" table that is emitted in DwarfFileTable::Emit(). // "standard_opcode_lengths" table that is emitted in DwarfFileTable::Emit().
#define DWARF2_LINE_OPCODE_BASE 13 #define DWARF2_LINE_OPCODE_BASE 13
// Minimum line offset in a special line info. opcode. This value // Minimum line offset in a special line info. opcode. This value
@ -105,7 +105,7 @@ void MCLineEntry::Make(MCStreamer *MCOS, const MCSection *Section) {
// //
// This helper routine returns an expression of End - Start + IntVal . // This helper routine returns an expression of End - Start + IntVal .
// //
static inline const MCExpr *MakeStartMinusEndExpr(const MCStreamer &MCOS, static inline const MCExpr *MakeStartMinusEndExpr(const MCStreamer &MCOS,
const MCSymbol &Start, const MCSymbol &Start,
const MCSymbol &End, const MCSymbol &End,
@ -310,7 +310,7 @@ const MCSymbol *MCDwarfFileTable::Emit(MCStreamer *MCOS) {
if (MCOS->getContext().getAsmInfo().getLinkerRequiresNonEmptyDwarfLines() if (MCOS->getContext().getAsmInfo().getLinkerRequiresNonEmptyDwarfLines()
&& MCLineSectionOrder.begin() == MCLineSectionOrder.end()) { && MCLineSectionOrder.begin() == MCLineSectionOrder.end()) {
// The darwin9 linker has a bug (see PR8715). For for 32-bit architectures // The darwin9 linker has a bug (see PR8715). For for 32-bit architectures
// it requires: // it requires:
// total_length >= prologue_length + 10 // total_length >= prologue_length + 10
// We are 4 bytes short, since we have total_length = 51 and // We are 4 bytes short, since we have total_length = 51 and
// prologue_length = 45 // prologue_length = 45
@ -354,7 +354,7 @@ void MCDwarfLineAddr::Encode(int64_t LineDelta, uint64_t AddrDelta,
AddrDelta = ScaleAddrDelta(AddrDelta); AddrDelta = ScaleAddrDelta(AddrDelta);
// A LineDelta of INT64_MAX is a signal that this is actually a // A LineDelta of INT64_MAX is a signal that this is actually a
// DW_LNE_end_sequence. We cannot use special opcodes here, since we want the // DW_LNE_end_sequence. We cannot use special opcodes here, since we want the
// end_sequence to emit the matrix entry. // end_sequence to emit the matrix entry.
if (LineDelta == INT64_MAX) { if (LineDelta == INT64_MAX) {
if (AddrDelta == MAX_SPECIAL_ADDR_DELTA) if (AddrDelta == MAX_SPECIAL_ADDR_DELTA)
@ -552,7 +552,7 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
const MCSymbol *LineSectionSymbol) { const MCSymbol *LineSectionSymbol) {
MCContext &context = MCOS->getContext(); MCContext &context = MCOS->getContext();
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection());
// Create a symbol at the start and end of this section used in here for the // Create a symbol at the start and end of this section used in here for the
// expression to calculate the length in the header. // expression to calculate the length in the header.
@ -766,7 +766,7 @@ void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS,
MCOS->EmitLabel(Label); MCOS->EmitLabel(Label);
// Create and entry for the info and add it to the other entries. // Create and entry for the info and add it to the other entries.
MCGenDwarfLabelEntry *Entry = MCGenDwarfLabelEntry *Entry =
new MCGenDwarfLabelEntry(Name, FileNumber, LineNumber, Label); new MCGenDwarfLabelEntry(Name, FileNumber, LineNumber, Label);
MCOS->getContext().addMCGenDwarfLabelEntry(Entry); MCOS->getContext().addMCGenDwarfLabelEntry(Entry);
} }

View File

@ -82,7 +82,7 @@ namespace {
virtual bool EmitValueToOffset(const MCExpr *Offset, virtual bool EmitValueToOffset(const MCExpr *Offset,
unsigned char Value = 0) { return false; } unsigned char Value = 0) { return false; }
virtual void EmitFileDirective(StringRef Filename) {} virtual void EmitFileDirective(StringRef Filename) {}
virtual bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory, virtual bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
StringRef Filename) { StringRef Filename) {
@ -99,12 +99,12 @@ namespace {
virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) { virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) {
RecordProcEnd(Frame); RecordProcEnd(Frame);
} }
/// @} /// @}
}; };
} }
MCStreamer *llvm::createNullStreamer(MCContext &Context) { MCStreamer *llvm::createNullStreamer(MCContext &Context) {
return new MCNullStreamer(Context); return new MCNullStreamer(Context);
} }

View File

@ -169,7 +169,7 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) {
Ctx->getMachOSection("__DWARF", "__apple_types", Ctx->getMachOSection("__DWARF", "__apple_types",
MCSectionMachO::S_ATTR_DEBUG, MCSectionMachO::S_ATTR_DEBUG,
SectionKind::getMetadata()); SectionKind::getMetadata());
DwarfAbbrevSection = DwarfAbbrevSection =
Ctx->getMachOSection("__DWARF", "__debug_abbrev", Ctx->getMachOSection("__DWARF", "__debug_abbrev",
MCSectionMachO::S_ATTR_DEBUG, MCSectionMachO::S_ATTR_DEBUG,

View File

@ -20,7 +20,7 @@ MCSectionCOFF::~MCSectionCOFF() {} // anchor.
// should be printed before the section name // should be printed before the section name
bool MCSectionCOFF::ShouldOmitSectionDirective(StringRef Name, bool MCSectionCOFF::ShouldOmitSectionDirective(StringRef Name,
const MCAsmInfo &MAI) const { const MCAsmInfo &MAI) const {
// FIXME: Does .section .bss/.data/.text work everywhere?? // FIXME: Does .section .bss/.data/.text work everywhere??
if (Name == ".text" || Name == ".data" || Name == ".bss") if (Name == ".text" || Name == ".data" || Name == ".bss")
return true; return true;
@ -30,7 +30,7 @@ bool MCSectionCOFF::ShouldOmitSectionDirective(StringRef Name,
void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &MAI,
raw_ostream &OS) const { raw_ostream &OS) const {
// standard sections don't require the '.section' // standard sections don't require the '.section'
if (ShouldOmitSectionDirective(SectionName, MAI)) { if (ShouldOmitSectionDirective(SectionName, MAI)) {
OS << '\t' << getSectionName() << '\n'; OS << '\t' << getSectionName() << '\n';
@ -47,7 +47,7 @@ void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &MAI,
if (getCharacteristics() & COFF::IMAGE_SCN_MEM_DISCARDABLE) if (getCharacteristics() & COFF::IMAGE_SCN_MEM_DISCARDABLE)
OS << 'n'; OS << 'n';
OS << "\"\n"; OS << "\"\n";
if (getCharacteristics() & COFF::IMAGE_SCN_LNK_COMDAT) { if (getCharacteristics() & COFF::IMAGE_SCN_LNK_COMDAT) {
switch (Selection) { switch (Selection) {
case COFF::IMAGE_COMDAT_SELECT_NODUPLICATES: case COFF::IMAGE_COMDAT_SELECT_NODUPLICATES:

View File

@ -22,7 +22,7 @@ MCSectionELF::~MCSectionELF() {} // anchor.
// should be printed before the section name // should be printed before the section name
bool MCSectionELF::ShouldOmitSectionDirective(StringRef Name, bool MCSectionELF::ShouldOmitSectionDirective(StringRef Name,
const MCAsmInfo &MAI) const { const MCAsmInfo &MAI) const {
// FIXME: Does .section .bss/.data/.text work everywhere?? // FIXME: Does .section .bss/.data/.text work everywhere??
if (Name == ".text" || Name == ".data" || if (Name == ".text" || Name == ".data" ||
(Name == ".bss" && !MAI.usesELFSectionDirectiveForBSS())) (Name == ".bss" && !MAI.usesELFSectionDirectiveForBSS()))
@ -33,7 +33,7 @@ bool MCSectionELF::ShouldOmitSectionDirective(StringRef Name,
void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI, void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI,
raw_ostream &OS) const { raw_ostream &OS) const {
if (ShouldOmitSectionDirective(SectionName, MAI)) { if (ShouldOmitSectionDirective(SectionName, MAI)) {
OS << '\t' << getSectionName() << '\n'; OS << '\t' << getSectionName() << '\n';
return; return;
@ -62,7 +62,7 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI,
} }
// Handle the weird solaris syntax if desired. // Handle the weird solaris syntax if desired.
if (MAI.usesSunStyleELFSectionSwitchSyntax() && if (MAI.usesSunStyleELFSectionSwitchSyntax() &&
!(Flags & ELF::SHF_MERGE)) { !(Flags & ELF::SHF_MERGE)) {
if (Flags & ELF::SHF_ALLOC) if (Flags & ELF::SHF_ALLOC)
OS << ",#alloc"; OS << ",#alloc";
@ -75,7 +75,7 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI,
OS << '\n'; OS << '\n';
return; return;
} }
OS << ",\""; OS << ",\"";
if (Flags & ELF::SHF_ALLOC) if (Flags & ELF::SHF_ALLOC)
OS << 'a'; OS << 'a';
@ -91,13 +91,13 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI,
OS << 'S'; OS << 'S';
if (Flags & ELF::SHF_TLS) if (Flags & ELF::SHF_TLS)
OS << 'T'; OS << 'T';
// If there are target-specific flags, print them. // If there are target-specific flags, print them.
if (Flags & ELF::XCORE_SHF_CP_SECTION) if (Flags & ELF::XCORE_SHF_CP_SECTION)
OS << 'c'; OS << 'c';
if (Flags & ELF::XCORE_SHF_DP_SECTION) if (Flags & ELF::XCORE_SHF_DP_SECTION)
OS << 'd'; OS << 'd';
OS << '"'; OS << '"';
OS << ','; OS << ',';

View File

@ -30,7 +30,7 @@ static bool isAcceptableChar(char C) {
/// syntactically correct. /// syntactically correct.
static bool NameNeedsQuoting(StringRef Str) { static bool NameNeedsQuoting(StringRef Str) {
assert(!Str.empty() && "Cannot create an empty MCSymbol"); assert(!Str.empty() && "Cannot create an empty MCSymbol");
// If any of the characters in the string is an unacceptable character, force // If any of the characters in the string is an unacceptable character, force
// quotes. // quotes.
for (unsigned i = 0, e = Str.size(); i != e; ++i) for (unsigned i = 0, e = Str.size(); i != e; ++i)
@ -72,7 +72,7 @@ void MCSymbol::print(raw_ostream &OS) const {
OS << getName(); OS << getName();
return; return;
} }
OS << '"' << getName() << '"'; OS << '"' << getName() << '"';
} }

View File

@ -92,7 +92,7 @@ static void Split(std::vector<std::string> &V, const StringRef S) {
static std::string Join(const std::vector<std::string> &V) { static std::string Join(const std::vector<std::string> &V) {
// Start with empty string. // Start with empty string.
std::string Result; std::string Result;
// If the vector is not empty // If the vector is not empty
if (!V.empty()) { if (!V.empty()) {
// Start with the first feature // Start with the first feature
Result = V[0]; Result = V[0];
@ -104,7 +104,7 @@ static std::string Join(const std::vector<std::string> &V) {
Result += V[i]; Result += V[i];
} }
} }
// Return the features string // Return the features string
return Result; return Result;
} }
@ -205,7 +205,7 @@ void SetImpliedBits(uint64_t &Bits, const SubtargetFeatureKV *FeatureEntry,
/// ClearImpliedBits - For each feature that (transitively) implies this /// ClearImpliedBits - For each feature that (transitively) implies this
/// feature, clear it. /// feature, clear it.
/// ///
static static
void ClearImpliedBits(uint64_t &Bits, const SubtargetFeatureKV *FeatureEntry, void ClearImpliedBits(uint64_t &Bits, const SubtargetFeatureKV *FeatureEntry,
const SubtargetFeatureKV *FeatureTable, const SubtargetFeatureKV *FeatureTable,
@ -252,7 +252,7 @@ SubtargetFeatures::ToggleFeature(uint64_t Bits, const StringRef Feature,
return Bits; return Bits;
} }
/// getFeatureBits - Get feature bits a CPU. /// getFeatureBits - Get feature bits a CPU.
/// ///
@ -279,7 +279,7 @@ uint64_t SubtargetFeatures::getFeatureBits(const StringRef CPU,
// Check if help is needed // Check if help is needed
if (CPU == "help") if (CPU == "help")
Help(CPUTable, CPUTableSize, FeatureTable, FeatureTableSize); Help(CPUTable, CPUTableSize, FeatureTable, FeatureTableSize);
// Find CPU entry if CPU name is specified. // Find CPU entry if CPU name is specified.
if (!CPU.empty()) { if (!CPU.empty()) {
const SubtargetFeatureKV *CPUEntry = Find(CPU, CPUTable, CPUTableSize); const SubtargetFeatureKV *CPUEntry = Find(CPU, CPUTable, CPUTableSize);
@ -304,11 +304,11 @@ uint64_t SubtargetFeatures::getFeatureBits(const StringRef CPU,
// Iterate through each feature // Iterate through each feature
for (size_t i = 0, E = Features.size(); i < E; i++) { for (size_t i = 0, E = Features.size(); i < E; i++) {
const StringRef Feature = Features[i]; const StringRef Feature = Features[i];
// Check for help // Check for help
if (Feature == "+help") if (Feature == "+help")
Help(CPUTable, CPUTableSize, FeatureTable, FeatureTableSize); Help(CPUTable, CPUTableSize, FeatureTable, FeatureTableSize);
// Find feature in table. // Find feature in table.
const SubtargetFeatureKV *FeatureEntry = const SubtargetFeatureKV *FeatureEntry =
Find(StripFlag(Feature), FeatureTable, FeatureTableSize); Find(StripFlag(Feature), FeatureTable, FeatureTableSize);
@ -349,7 +349,7 @@ void *SubtargetFeatures::getItinerary(const StringRef CPU,
// Find entry // Find entry
const SubtargetInfoKV *Entry = Find(CPU, Table, TableSize); const SubtargetInfoKV *Entry = Find(CPU, Table, TableSize);
if (Entry) { if (Entry) {
return Entry->Value; return Entry->Value;
} else { } else {