From d31e13f2877b5ecbc1df7d20912967aa01f5eef8 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 29 Sep 2016 21:00:23 +0000 Subject: [PATCH] Rename warning -> warn. It's better because it's a verb. llvm-svn: 282763 --- lld/ELF/Driver.cpp | 4 ++-- lld/ELF/Error.cpp | 2 +- lld/ELF/Error.h | 2 +- lld/ELF/InputFiles.cpp | 8 ++++---- lld/ELF/LTO.cpp | 2 +- lld/ELF/Mips.cpp | 4 ++-- lld/ELF/Relocations.cpp | 2 +- lld/ELF/SymbolTable.cpp | 10 +++++----- lld/ELF/Writer.cpp | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 996bd58fb4bb..6460e49d98c3 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -655,7 +655,7 @@ template void LinkerDriver::link(opt::InputArgList &Args) { if (S.getAsInteger(0, Config->ImageBase)) error(Arg->getSpelling() + ": number expected, but got " + S); else if ((Config->ImageBase % Target->MaxPageSize) != 0) - warning(Arg->getSpelling() + ": address isn't multiple of page size"); + warn(Arg->getSpelling() + ": address isn't multiple of page size"); } else { Config->ImageBase = Config->Pic ? 0 : Target->DefaultImageBase; } @@ -689,7 +689,7 @@ template void LinkerDriver::link(opt::InputArgList &Args) { if (Symtab.find(Config->Entry)) Config->EntrySym = Symtab.addUndefined(Config->Entry); else - warning("entry symbol " + Config->Entry + " not found, assuming 0"); + warn("entry symbol " + Config->Entry + " not found, assuming 0"); } if (HasError) diff --git a/lld/ELF/Error.cpp b/lld/ELF/Error.cpp index 776fc72a25ce..07e99b63b2e7 100644 --- a/lld/ELF/Error.cpp +++ b/lld/ELF/Error.cpp @@ -26,7 +26,7 @@ void elf::log(const Twine &Msg) { outs() << Msg << "\n"; } -void elf::warning(const Twine &Msg) { +void elf::warn(const Twine &Msg) { if (Config->FatalWarnings) error(Msg); else diff --git a/lld/ELF/Error.h b/lld/ELF/Error.h index 17dffaa84ea6..d0c22f6a5c5e 100644 --- a/lld/ELF/Error.h +++ b/lld/ELF/Error.h @@ -35,7 +35,7 @@ extern bool HasError; extern llvm::raw_ostream *ErrorOS; void log(const Twine &Msg); -void warning(const Twine &Msg); +void warn(const Twine &Msg); void error(const Twine &Msg); void error(std::error_code EC, const Twine &Prefix); diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index cc6d1892d955..01dc5dff4ea5 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -433,10 +433,10 @@ template void ArchiveFile::parse() { } if (IsEmpty) - warning(getName() + " has no symbol. Chances are you are doing " - "an LTO build and forgot to use an ar command that can create " - "a symbol table for LLVM bitcode files. If so, use llvm-ar or " - "GNU ar + plugin."); + warn(getName() + " has no symbol. Chances are you are doing " + "an LTO build and forgot to use an ar command that can create " + "a symbol table for LLVM bitcode files. If so, use llvm-ar or " + "GNU ar + plugin."); } // Returns a buffer pointing to a member file containing a given symbol. diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp index 6b9696b4100d..6b1192022a56 100644 --- a/lld/ELF/LTO.cpp +++ b/lld/ELF/LTO.cpp @@ -37,7 +37,7 @@ static void diagnosticHandler(const DiagnosticInfo &DI) { raw_svector_ostream OS(ErrStorage); DiagnosticPrinterRawOStream DP(OS); DI.print(DP); - warning(ErrStorage); + warn(ErrStorage); } static std::unique_ptr createLTO() { diff --git a/lld/ELF/Mips.cpp b/lld/ELF/Mips.cpp index 599e3f4e1d64..23adb5356887 100644 --- a/lld/ELF/Mips.cpp +++ b/lld/ELF/Mips.cpp @@ -102,9 +102,9 @@ static uint32_t getPicFlags(ArrayRef Files) { for (const FileFlags &F : Files.slice(1)) { bool IsPic2 = F.Flags & (EF_MIPS_PIC | EF_MIPS_CPIC); if (IsPic && !IsPic2) - warning("linking abicalls code with non-abicalls file: " + F.Filename); + warn("linking abicalls code with non-abicalls file: " + F.Filename); if (!IsPic && IsPic2) - warning("linking non-abicalls code with abicalls file: " + F.Filename); + warn("linking non-abicalls code with abicalls file: " + F.Filename); } // Compute the result PIC/non-PIC flag. diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 61fb1dd3f1b7..3f58f95461e4 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -269,7 +269,7 @@ static int32_t findMipsPairedAddend(const uint8_t *Buf, const uint8_t *BufLoc, return ((read32(BufLoc) & 0xffff) << 16) + readSignedLo16(Buf + RI->r_offset); } - warning("can't find matching " + getRelName(Type) + " relocation for " + + warn("can't find matching " + getRelName(Type) + " relocation for " + getRelName(Rel->getType(Config->Mips64EL))); return 0; } diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index ac6a91a2654b..339f99c07fee 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -328,7 +328,7 @@ static int compareDefinedNonCommon(Symbol *S, bool WasInserted, if (isa(S->body())) { // Non-common symbols take precedence over common symbols. if (Config->WarnCommon) - warning("common " + S->body()->getName() + " is overridden"); + warn("common " + S->body()->getName() + " is overridden"); return 1; } return 0; @@ -352,12 +352,12 @@ Symbol *SymbolTable::addCommon(StringRef N, uint64_t Size, if (!C) { // Non-common symbols take precedence over common symbols. if (Config->WarnCommon) - warning("common " + S->body()->getName() + " is overridden"); + warn("common " + S->body()->getName() + " is overridden"); return S; } if (Config->WarnCommon) - warning("multiple common of " + S->body()->getName()); + warn("multiple common of " + S->body()->getName()); Alignment = C->Alignment = std::max(C->Alignment, Alignment); if (Size > C->Size) @@ -371,7 +371,7 @@ void SymbolTable::reportDuplicate(SymbolBody *Existing, InputFile *NewFile) { std::string Msg = "duplicate symbol: " + conflictMsg(Existing, NewFile); if (Config->AllowMultipleDefinition) - warning(Msg); + warn(Msg); else error(Msg); } @@ -576,7 +576,7 @@ static void setVersionId(SymbolBody *Body, StringRef VersionName, Symbol *Sym = Body->symbol(); if (Sym->VersionId != Config->DefaultSymbolVersion) - warning("duplicate symbol " + Name + " in version script"); + warn("duplicate symbol " + Name + " in version script"); Sym->VersionId = Version; } diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 9f1346c090be..d926ca120cc6 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -320,7 +320,7 @@ template static void reportUndefined(SymbolBody *Sym) { if (Sym->File) Msg += " in " + getFilename(Sym->File); if (Config->UnresolvedSymbols == UnresolvedPolicy::Warn) - warning(Msg); + warn(Msg); else error(Msg); }