[lld] ce13dd1 - [ELF] Replace fatal with Fatal(ctx)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 16 15:24:58 PST 2024


Author: Fangrui Song
Date: 2024-11-16T15:24:53-08:00
New Revision: ce13dd1f7e5a86dc2a60e12f90e958fb0c7daec0

URL: https://github.com/llvm/llvm-project/commit/ce13dd1f7e5a86dc2a60e12f90e958fb0c7daec0
DIFF: https://github.com/llvm/llvm-project/commit/ce13dd1f7e5a86dc2a60e12f90e958fb0c7daec0.diff

LOG: [ELF] Replace fatal with Fatal(ctx)

Added: 
    

Modified: 
    lld/ELF/InputFiles.h

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h
index 1dff172c901045..70cdfc071382ec 100644
--- a/lld/ELF/InputFiles.h
+++ b/lld/ELF/InputFiles.h
@@ -37,6 +37,7 @@ class Symbol;
 
 // Returns "<internal>", "foo.a(bar.o)" or "baz.o".
 std::string toStr(Ctx &, const InputFile *f);
+const ELFSyncStream &operator<<(const ELFSyncStream &, const InputFile *);
 
 // Opens a given file.
 std::optional<MemoryBufferRef> readFile(Ctx &, StringRef path);
@@ -101,7 +102,7 @@ class InputFile {
   Symbol &getSymbol(uint32_t symbolIndex) const {
     assert(fileKind == ObjKind);
     if (symbolIndex >= numSymbols)
-      fatal(toStr(ctx, this) + ": invalid symbol index");
+      Fatal(ctx) << this << ": invalid symbol index";
     return *this->symbols[symbolIndex];
   }
 
@@ -386,8 +387,6 @@ ELFFileBase *createObjFile(Ctx &, MemoryBufferRef mb,
 
 std::string replaceThinLTOSuffix(Ctx &, StringRef path);
 
-const ELFSyncStream &operator<<(const ELFSyncStream &, const InputFile *);
-
 } // namespace elf
 } // namespace lld
 


        


More information about the llvm-commits mailing list