[lld] r275500 - COFF: Rename noreturn error -> fatal.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 16:37:14 PDT 2016


Author: ruiu
Date: Thu Jul 14 18:37:14 2016
New Revision: 275500

URL: http://llvm.org/viewvc/llvm-project?rev=275500&view=rev
Log:
COFF: Rename noreturn error -> fatal.

This new name is also consistent with ELF.

Modified:
    lld/trunk/COFF/Chunks.cpp
    lld/trunk/COFF/Driver.cpp
    lld/trunk/COFF/DriverUtils.cpp
    lld/trunk/COFF/Error.cpp
    lld/trunk/COFF/Error.h
    lld/trunk/COFF/InputFiles.cpp
    lld/trunk/COFF/InputFiles.h
    lld/trunk/COFF/ModuleDef.cpp
    lld/trunk/COFF/SymbolTable.cpp
    lld/trunk/COFF/Symbols.cpp
    lld/trunk/COFF/Writer.cpp

Modified: lld/trunk/COFF/Chunks.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Chunks.cpp?rev=275500&r1=275499&r2=275500&view=diff
==============================================================================
--- lld/trunk/COFF/Chunks.cpp (original)
+++ lld/trunk/COFF/Chunks.cpp Thu Jul 14 18:37:14 2016
@@ -61,7 +61,7 @@ void SectionChunk::applyRelX64(uint8_t *
   case IMAGE_REL_AMD64_SECTION:  add16(Off, Sym->getSectionIndex()); break;
   case IMAGE_REL_AMD64_SECREL:   add32(Off, Sym->getSecrel()); break;
   default:
-    error("Unsupported relocation type");
+    fatal("Unsupported relocation type");
   }
 }
 
@@ -76,7 +76,7 @@ void SectionChunk::applyRelX86(uint8_t *
   case IMAGE_REL_I386_SECTION:  add16(Off, Sym->getSectionIndex()); break;
   case IMAGE_REL_I386_SECREL:   add32(Off, Sym->getSecrel()); break;
   default:
-    error("Unsupported relocation type");
+    fatal("Unsupported relocation type");
   }
 }
 
@@ -120,7 +120,7 @@ void SectionChunk::applyRelARM(uint8_t *
   case IMAGE_REL_ARM_BRANCH24T: applyBranch24T(Off, S - P - 4); break;
   case IMAGE_REL_ARM_BLX23T:    applyBranch24T(Off, S - P - 4); break;
   default:
-    error("Unsupported relocation type");
+    fatal("Unsupported relocation type");
   }
 }
 

Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=275500&r1=275499&r2=275500&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Thu Jul 14 18:37:14 2016
@@ -128,7 +128,7 @@ void LinkerDriver::parseDirectives(Strin
     case OPT_throwingnew:
       break;
     default:
-      error(Twine(Arg->getSpelling()) + " is not allowed in .drectve");
+      fatal(Twine(Arg->getSpelling()) + " is not allowed in .drectve");
     }
   }
 }
@@ -253,7 +253,7 @@ void LinkerDriver::link(llvm::ArrayRef<c
   // We call our own implementation of lib.exe that understands bitcode files.
   if (ArgsArr.size() > 1 && StringRef(ArgsArr[1]).equals_lower("/lib")) {
     if (llvm::libDriverMain(ArgsArr.slice(1)) != 0)
-      error("lib failed");
+      fatal("lib failed");
     return;
   }
 
@@ -275,7 +275,7 @@ void LinkerDriver::link(llvm::ArrayRef<c
   }
 
   if (Args.filtered_begin(OPT_INPUT) == Args.filtered_end())
-    error("no input files.");
+    fatal("no input files.");
 
   // Construct search path list.
   SearchPaths.push_back("");
@@ -302,7 +302,7 @@ void LinkerDriver::link(llvm::ArrayRef<c
   // Handle /noentry
   if (Args.hasArg(OPT_noentry)) {
     if (!Args.hasArg(OPT_dll))
-      error("/noentry must be specified with /dll");
+      fatal("/noentry must be specified with /dll");
     Config->NoEntry = true;
   }
 
@@ -315,7 +315,7 @@ void LinkerDriver::link(llvm::ArrayRef<c
   // Handle /fixed
   if (Args.hasArg(OPT_fixed)) {
     if (Args.hasArg(OPT_dynamicbase))
-      error("/fixed must not be specified with /dynamicbase");
+      fatal("/fixed must not be specified with /dynamicbase");
     Config->Relocatable = false;
     Config->DynamicBase = false;
   }
@@ -389,17 +389,17 @@ void LinkerDriver::link(llvm::ArrayRef<c
         StringRef OptLevel = StringRef(S).substr(7);
         if (OptLevel.getAsInteger(10, Config->LTOOptLevel) ||
             Config->LTOOptLevel > 3)
-          error("/opt:lldlto: invalid optimization level: " + OptLevel);
+          fatal("/opt:lldlto: invalid optimization level: " + OptLevel);
         continue;
       }
       if (StringRef(S).startswith("lldltojobs=")) {
         StringRef Jobs = StringRef(S).substr(11);
         if (Jobs.getAsInteger(10, Config->LTOJobs) || Config->LTOJobs == 0)
-          error("/opt:lldltojobs: invalid job count: " + Jobs);
+          fatal("/opt:lldltojobs: invalid job count: " + Jobs);
         continue;
       }
       if (S != "ref" && S != "lbr" && S != "nolbr")
-        error(Twine("/opt: unknown option: ") + S);
+        fatal(Twine("/opt: unknown option: ") + S);
     }
   }
 
@@ -500,7 +500,7 @@ void LinkerDriver::link(llvm::ArrayRef<c
       continue;
     }
     if (Config->Machine != MT)
-      error(Twine(File->getShortName()) + ": machine type " + machineToStr(MT) +
+      fatal(Twine(File->getShortName()) + ": machine type " + machineToStr(MT) +
             " conflicts with " + machineToStr(Config->Machine));
   }
   if (Config->Machine == IMAGE_FILE_MACHINE_UNKNOWN) {
@@ -535,7 +535,7 @@ void LinkerDriver::link(llvm::ArrayRef<c
     // infer that from user-defined entry name.
     StringRef S = findDefaultEntry();
     if (S.empty())
-      error("entry point must be defined");
+      fatal("entry point must be defined");
     Config->Entry = addUndefined(S);
     if (Config->Verbose)
       llvm::outs() << "Entry name inferred: " << S << "\n";
@@ -642,14 +642,14 @@ void LinkerDriver::link(llvm::ArrayRef<c
   if (Config->Subsystem == IMAGE_SUBSYSTEM_UNKNOWN) {
     Config->Subsystem = inferSubsystem();
     if (Config->Subsystem == IMAGE_SUBSYSTEM_UNKNOWN)
-      error("subsystem must be defined");
+      fatal("subsystem must be defined");
   }
 
   // Handle /safeseh.
   if (Args.hasArg(OPT_safeseh))
     for (ObjectFile *File : Symtab.ObjectFiles)
       if (!File->SEHCompat)
-        error("/safeseh: " + File->getName() + " is not compatible with SEH");
+        fatal("/safeseh: " + File->getName() + " is not compatible with SEH");
 
   // Windows specific -- when we are creating a .dll file, we also
   // need to create a .lib file.

Modified: lld/trunk/COFF/DriverUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/DriverUtils.cpp?rev=275500&r1=275499&r2=275500&view=diff
==============================================================================
--- lld/trunk/COFF/DriverUtils.cpp (original)
+++ lld/trunk/COFF/DriverUtils.cpp Thu Jul 14 18:37:14 2016
@@ -58,7 +58,7 @@ public:
       for (const char *S : Args)
         if (S)
           llvm::errs() << S << " ";
-      error("failed");
+      fatal("failed");
     }
   }
 
@@ -82,7 +82,7 @@ MachineTypes getMachineType(StringRef S)
                         .Default(IMAGE_FILE_MACHINE_UNKNOWN);
   if (MT != IMAGE_FILE_MACHINE_UNKNOWN)
     return MT;
-  error(Twine("unknown /machine argument: ") + S);
+  fatal(Twine("unknown /machine argument: ") + S);
 }
 
 StringRef machineToStr(MachineTypes MT) {
@@ -103,9 +103,9 @@ void parseNumbers(StringRef Arg, uint64_
   StringRef S1, S2;
   std::tie(S1, S2) = Arg.split(',');
   if (S1.getAsInteger(0, *Addr))
-    error(Twine("invalid number: ") + S1);
+    fatal(Twine("invalid number: ") + S1);
   if (Size && !S2.empty() && S2.getAsInteger(0, *Size))
-    error(Twine("invalid number: ") + S2);
+    fatal(Twine("invalid number: ") + S2);
 }
 
 // Parses a string in the form of "<integer>[.<integer>]".
@@ -114,10 +114,10 @@ void parseVersion(StringRef Arg, uint32_
   StringRef S1, S2;
   std::tie(S1, S2) = Arg.split('.');
   if (S1.getAsInteger(0, *Major))
-    error(Twine("invalid number: ") + S1);
+    fatal(Twine("invalid number: ") + S1);
   *Minor = 0;
   if (!S2.empty() && S2.getAsInteger(0, *Minor))
-    error(Twine("invalid number: ") + S2);
+    fatal(Twine("invalid number: ") + S2);
 }
 
 // Parses a string in the form of "<subsystem>[,<integer>[.<integer>]]".
@@ -137,7 +137,7 @@ void parseSubsystem(StringRef Arg, Windo
     .Case("windows", IMAGE_SUBSYSTEM_WINDOWS_GUI)
     .Default(IMAGE_SUBSYSTEM_UNKNOWN);
   if (*Sys == IMAGE_SUBSYSTEM_UNKNOWN)
-    error(Twine("unknown subsystem: ") + SysStr);
+    fatal(Twine("unknown subsystem: ") + SysStr);
   if (!Ver.empty())
     parseVersion(Ver, Major, Minor);
 }
@@ -148,10 +148,10 @@ void parseAlternateName(StringRef S) {
   StringRef From, To;
   std::tie(From, To) = S.split('=');
   if (From.empty() || To.empty())
-    error(Twine("/alternatename: invalid argument: ") + S);
+    fatal(Twine("/alternatename: invalid argument: ") + S);
   auto It = Config->AlternateNames.find(From);
   if (It != Config->AlternateNames.end() && It->second != To)
-    error(Twine("/alternatename: conflicts: ") + S);
+    fatal(Twine("/alternatename: conflicts: ") + S);
   Config->AlternateNames.insert(It, std::make_pair(From, To));
 }
 
@@ -161,7 +161,7 @@ void parseMerge(StringRef S) {
   StringRef From, To;
   std::tie(From, To) = S.split('=');
   if (From.empty() || To.empty())
-    error(Twine("/merge: invalid argument: ") + S);
+    fatal(Twine("/merge: invalid argument: ") + S);
   auto Pair = Config->Merge.insert(std::make_pair(From, To));
   bool Inserted = Pair.second;
   if (!Inserted) {
@@ -198,7 +198,7 @@ static uint32_t parseSectionAttributes(S
       Ret |= IMAGE_SCN_MEM_WRITE;
       break;
     default:
-      error(Twine("/section: invalid argument: ") + S);
+      fatal(Twine("/section: invalid argument: ") + S);
     }
   }
   return Ret;
@@ -209,7 +209,7 @@ void parseSection(StringRef S) {
   StringRef Name, Attrs;
   std::tie(Name, Attrs) = S.split(',');
   if (Name.empty() || Attrs.empty())
-    error(Twine("/section: invalid argument: ") + S);
+    fatal(Twine("/section: invalid argument: ") + S);
   Config->Section[Name] = parseSectionAttributes(Attrs);
 }
 
@@ -221,16 +221,16 @@ void parseManifest(StringRef Arg) {
     return;
   }
   if (!Arg.startswith_lower("embed"))
-    error(Twine("Invalid option ") + Arg);
+    fatal(Twine("Invalid option ") + Arg);
   Config->Manifest = Configuration::Embed;
   Arg = Arg.substr(strlen("embed"));
   if (Arg.empty())
     return;
   if (!Arg.startswith_lower(",id="))
-    error(Twine("Invalid option ") + Arg);
+    fatal(Twine("Invalid option ") + Arg);
   Arg = Arg.substr(strlen(",id="));
   if (Arg.getAsInteger(0, Config->ManifestID))
-    error(Twine("Invalid option ") + Arg);
+    fatal(Twine("Invalid option ") + Arg);
 }
 
 // Parses a string in the form of "level=<string>|uiAccess=<string>|NO".
@@ -254,7 +254,7 @@ void parseManifestUAC(StringRef Arg) {
       std::tie(Config->ManifestUIAccess, Arg) = Arg.split(" ");
       continue;
     }
-    error(Twine("Invalid option ") + Arg);
+    fatal(Twine("Invalid option ") + Arg);
   }
 }
 
@@ -459,7 +459,7 @@ Export parseExport(StringRef Arg) {
   return E;
 
 err:
-  error(Twine("invalid /export: ") + Arg);
+  fatal(Twine("invalid /export: ") + Arg);
 }
 
 static StringRef undecorate(StringRef Sym) {
@@ -477,7 +477,7 @@ void fixupExports() {
     if (E.Ordinal == 0)
       continue;
     if (!Ords.insert(E.Ordinal).second)
-      error("duplicate export ordinal: " + E.Name);
+      fatal("duplicate export ordinal: " + E.Name);
   }
 
   for (Export &E : Config->Exports) {
@@ -538,10 +538,10 @@ void checkFailIfMismatch(StringRef Arg)
   StringRef K, V;
   std::tie(K, V) = Arg.split('=');
   if (K.empty() || V.empty())
-    error(Twine("/failifmismatch: invalid argument: ") + Arg);
+    fatal(Twine("/failifmismatch: invalid argument: ") + Arg);
   StringRef Existing = Config->MustMatch[K];
   if (!Existing.empty() && V != Existing)
-    error(Twine("/failifmismatch: mismatch detected: ") + Existing + " and " +
+    fatal(Twine("/failifmismatch: mismatch detected: ") + Existing + " and " +
           V + " for key " + K);
   Config->MustMatch[K] = V;
 }
@@ -553,7 +553,7 @@ convertResToCOFF(const std::vector<Memor
   // Create an output file path.
   SmallString<128> Path;
   if (llvm::sys::fs::createTemporaryFile("resource", "obj", Path))
-    error("Could not create temporary file");
+    fatal("Could not create temporary file");
 
   // Execute cvtres.exe.
   Executor E("cvtres.exe");
@@ -613,7 +613,7 @@ llvm::opt::InputArgList ArgParser::parse
   }
 
   if (MissingCount)
-    error(Twine("missing arg value for \"") + Args.getArgString(MissingIndex) +
+    fatal(Twine("missing arg value for \"") + Args.getArgString(MissingIndex) +
           "\", expected " + Twine(MissingCount) +
           (MissingCount == 1 ? " argument." : " arguments."));
   for (auto *Arg : Args.filtered(OPT_UNKNOWN))

Modified: lld/trunk/COFF/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Error.cpp?rev=275500&r1=275499&r2=275500&view=diff
==============================================================================
--- lld/trunk/COFF/Error.cpp (original)
+++ lld/trunk/COFF/Error.cpp Thu Jul 14 18:37:14 2016
@@ -15,7 +15,7 @@
 namespace lld {
 namespace coff {
 
-void error(const Twine &Msg) {
+void fatal(const Twine &Msg) {
   llvm::errs() << Msg << "\n";
   exit(1);
 }
@@ -23,14 +23,14 @@ void error(const Twine &Msg) {
 void check(std::error_code EC, const Twine &Prefix) {
   if (!EC)
     return;
-  error(Prefix + ": " + EC.message());
+  fatal(Prefix + ": " + EC.message());
 }
 
 void check(llvm::Error E, const Twine &Prefix) {
   if (!E)
     return;
   handleAllErrors(std::move(E), [&](const llvm::ErrorInfoBase &EIB) {
-    error(Prefix + ": " + EIB.message());
+    fatal(Prefix + ": " + EIB.message());
   });
 }
 

Modified: lld/trunk/COFF/Error.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Error.h?rev=275500&r1=275499&r2=275500&view=diff
==============================================================================
--- lld/trunk/COFF/Error.h (original)
+++ lld/trunk/COFF/Error.h Thu Jul 14 18:37:14 2016
@@ -16,7 +16,7 @@
 namespace lld {
 namespace coff {
 
-LLVM_ATTRIBUTE_NORETURN void error(const Twine &Msg);
+LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg);
 void check(std::error_code EC, const Twine &Prefix);
 void check(llvm::Error E, const Twine &Prefix);
 
@@ -27,7 +27,7 @@ template <typename T> void check(const E
 template <class T> T check(Expected<T> E, const Twine &Prefix) {
   if (E)
     return std::move(*E);
-  error(E.takeError(), Prefix);
+  fatal(E.takeError(), Prefix);
   return T();
 }
 

Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=275500&r1=275499&r2=275500&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Thu Jul 14 18:37:14 2016
@@ -113,7 +113,7 @@ void ObjectFile::parse() {
     Bin.release();
     COFFObj.reset(Obj);
   } else {
-    error(Twine(getName()) + " is not a COFF file.");
+    fatal(Twine(getName()) + " is not a COFF file.");
   }
 
   // Read section and symbol tables.
@@ -231,12 +231,12 @@ Defined *ObjectFile::createDefined(COFFS
 
   // Reserved sections numbers don't have contents.
   if (llvm::COFF::isReservedSectionNumber(SectionNumber))
-    error(Twine("broken object file: ") + getName());
+    fatal(Twine("broken object file: ") + getName());
 
   // This symbol references a section which is not present in the section
   // header.
   if ((uint32_t)SectionNumber >= SparseChunks.size())
-    error(Twine("broken object file: ") + getName());
+    fatal(Twine("broken object file: ") + getName());
 
   // Nothing else to do without a section chunk.
   auto *SC = cast_or_null<SectionChunk>(SparseChunks[SectionNumber]);
@@ -266,7 +266,7 @@ void ObjectFile::initializeSEH() {
   ArrayRef<uint8_t> A;
   COFFObj->getSectionContents(SXData, A);
   if (A.size() % 4 != 0)
-    error(".sxdata must be an array of symbol table indices");
+    fatal(".sxdata must be an array of symbol table indices");
   auto *I = reinterpret_cast<const ulittle32_t *>(A.data());
   auto *E = reinterpret_cast<const ulittle32_t *>(A.data() + A.size());
   for (; I != E; ++I)
@@ -292,7 +292,7 @@ void ImportFile::parse() {
 
   // Check if the total size is valid.
   if ((size_t)(End - Buf) != (sizeof(*Hdr) + Hdr->SizeOfData))
-    error("broken import library");
+    fatal("broken import library");
 
   // Read names and create an __imp_ symbol.
   StringRef Name = StringAlloc.save(StringRef(Buf + sizeof(*Hdr)));

Modified: lld/trunk/COFF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.h?rev=275500&r1=275499&r2=275500&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.h (original)
+++ lld/trunk/COFF/InputFiles.h Thu Jul 14 18:37:14 2016
@@ -104,7 +104,7 @@ public:
 
   // All symbols returned by ArchiveFiles are of Lazy type.
   std::vector<SymbolBody *> &getSymbols() override {
-    llvm_unreachable("internal error");
+    llvm_unreachable("internal fatal");
   }
 
 private:

Modified: lld/trunk/COFF/ModuleDef.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/ModuleDef.cpp?rev=275500&r1=275499&r2=275500&view=diff
==============================================================================
--- lld/trunk/COFF/ModuleDef.cpp (original)
+++ lld/trunk/COFF/ModuleDef.cpp Thu Jul 14 18:37:14 2016
@@ -134,13 +134,13 @@ private:
   void readAsInt(uint64_t *I) {
     read();
     if (Tok.K != Identifier || Tok.Value.getAsInteger(10, *I))
-      error("integer expected");
+      fatal("integer expected");
   }
 
   void expect(Kind Expected, StringRef Msg) {
     read();
     if (Tok.K != Expected)
-      error(Msg);
+      fatal(Msg);
   }
 
   void unget() { Stack.push_back(Tok); }
@@ -177,7 +177,7 @@ private:
       parseVersion(&Config->MajorImageVersion, &Config->MinorImageVersion);
       return;
     default:
-      error(Twine("unknown directive: ") + Tok.Value);
+      fatal(Twine("unknown directive: ") + Tok.Value);
     }
   }
 
@@ -188,7 +188,7 @@ private:
     if (Tok.K == Equal) {
       read();
       if (Tok.K != Identifier)
-        error(Twine("identifier expected, but got ") + Tok.Value);
+        fatal(Twine("identifier expected, but got ") + Tok.Value);
       E.ExtName = E.Name;
       E.Name = Tok.Value;
     } else {
@@ -264,15 +264,15 @@ private:
   void parseVersion(uint32_t *Major, uint32_t *Minor) {
     read();
     if (Tok.K != Identifier)
-      error(Twine("identifier expected, but got ") + Tok.Value);
+      fatal(Twine("identifier expected, but got ") + Tok.Value);
     StringRef V1, V2;
     std::tie(V1, V2) = Tok.Value.split('.');
     if (V1.getAsInteger(10, *Major))
-      error(Twine("integer expected, but got ") + Tok.Value);
+      fatal(Twine("integer expected, but got ") + Tok.Value);
     if (V2.empty())
       *Minor = 0;
     else if (V2.getAsInteger(10, *Minor))
-      error(Twine("integer expected, but got ") + Tok.Value);
+      fatal(Twine("integer expected, but got ") + Tok.Value);
   }
 
   Lexer Lex;

Modified: lld/trunk/COFF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/SymbolTable.cpp?rev=275500&r1=275499&r2=275500&view=diff
==============================================================================
--- lld/trunk/COFF/SymbolTable.cpp (original)
+++ lld/trunk/COFF/SymbolTable.cpp Thu Jul 14 18:37:14 2016
@@ -164,7 +164,7 @@ void SymbolTable::reportRemainingUndefin
           llvm::errs() << File->getShortName() << ": undefined symbol: "
                        << Sym->getName() << "\n";
   if (!Config->Force)
-    error("Link failed");
+    fatal("Link failed");
 }
 
 void SymbolTable::addLazy(Lazy *New, std::vector<Symbol *> *Accum) {
@@ -211,7 +211,7 @@ void SymbolTable::addSymbol(SymbolBody *
   // equivalent (conflicting), or more preferable, respectively.
   int Comp = Existing->compare(New);
   if (Comp == 0)
-    error(Twine("duplicate symbol: ") + Existing->getDebugName() + " and " +
+    fatal(Twine("duplicate symbol: ") + Existing->getDebugName() + " and " +
           New->getDebugName());
   if (Comp < 0)
     Sym->Body = New;
@@ -356,7 +356,7 @@ void SymbolTable::addCombinedLTOObject(O
 
     int Comp = Existing->compare(Body);
     if (Comp == 0)
-      error(Twine("LTO: unexpected duplicate symbol: ") + Name);
+      fatal(Twine("LTO: unexpected duplicate symbol: ") + Name);
     if (Comp < 0)
       Sym->Body = Body;
   }
@@ -383,7 +383,7 @@ void SymbolTable::addCombinedLTOObjects(
   size_t NumBitcodeFiles = BitcodeFiles.size();
   run();
   if (BitcodeFiles.size() != NumBitcodeFiles)
-    error("LTO: late loaded symbol created new bitcode reference");
+    fatal("LTO: late loaded symbol created new bitcode reference");
 }
 
 // Combine and compile bitcode files and then return the result
@@ -418,7 +418,7 @@ std::vector<ObjectFile *> SymbolTable::c
   DisableVerify = false;
 #endif
   if (!CG->optimize(DisableVerify, false, false, false))
-    error(""); // optimize() should have emitted any error message.
+    fatal(""); // optimize() should have emitted any error message.
 
   Objs.resize(Config->LTOJobs);
   // Use std::list to avoid invalidation of pointers in OSPtrs.
@@ -430,7 +430,7 @@ std::vector<ObjectFile *> SymbolTable::c
   }
 
   if (!CG->compileOptimized(OSPtrs))
-    error(""); // compileOptimized() should have emitted any error message.
+    fatal(""); // compileOptimized() should have emitted any error message.
 
   std::vector<ObjectFile *> ObjFiles;
   for (SmallString<0> &Obj : Objs) {

Modified: lld/trunk/COFF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Symbols.cpp?rev=275500&r1=275499&r2=275500&view=diff
==============================================================================
--- lld/trunk/COFF/Symbols.cpp (original)
+++ lld/trunk/COFF/Symbols.cpp Thu Jul 14 18:37:14 2016
@@ -199,7 +199,7 @@ std::unique_ptr<InputFile> Lazy::getMemb
   else if (Magic == file_magic::bitcode)
     Obj.reset(new BitcodeFile(MBRef));
   else
-    error(Twine(File->getName()) + ": unknown file type");
+    fatal(Twine(File->getName()) + ": unknown file type");
 
   Obj->setParentName(File->getName());
   return Obj;

Modified: lld/trunk/COFF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Writer.cpp?rev=275500&r1=275499&r2=275500&view=diff
==============================================================================
--- lld/trunk/COFF/Writer.cpp (original)
+++ lld/trunk/COFF/Writer.cpp Thu Jul 14 18:37:14 2016
@@ -199,13 +199,13 @@ void OutputSection::writeHeaderTo(uint8_
 uint64_t Defined::getSecrel() {
   if (auto *D = dyn_cast<DefinedRegular>(this))
     return getRVA() - D->getChunk()->getOutputSection()->getRVA();
-  error("SECREL relocation points to a non-regular symbol");
+  fatal("SECREL relocation points to a non-regular symbol");
 }
 
 uint64_t Defined::getSectionIndex() {
   if (auto *D = dyn_cast<DefinedRegular>(this))
     return D->getChunk()->getOutputSection()->SectionIndex;
-  error("SECTION relocation points to a non-regular symbol");
+  fatal("SECTION relocation points to a non-regular symbol");
 }
 
 bool Defined::isExecutable() {
@@ -614,13 +614,13 @@ template <typename PEHeaderTy> void Writ
       assert(B->getRVA() >= SC->getRVA());
       uint64_t OffsetInChunk = B->getRVA() - SC->getRVA();
       if (!SC->hasData() || OffsetInChunk + 4 > SC->getSize())
-        error("_load_config_used is malformed");
+        fatal("_load_config_used is malformed");
 
       ArrayRef<uint8_t> SecContents = SC->getContents();
       uint32_t LoadConfigSize =
           *reinterpret_cast<const ulittle32_t *>(&SecContents[OffsetInChunk]);
       if (OffsetInChunk + LoadConfigSize > SC->getSize())
-        error("_load_config_used is too large");
+        fatal("_load_config_used is too large");
       Dir[LOAD_CONFIG_TABLE].RelativeVirtualAddress = B->getRVA();
       Dir[LOAD_CONFIG_TABLE].Size = LoadConfigSize;
     }




More information about the llvm-commits mailing list