[PATCH] D135906: Fix llvm/lib/ObjCopy, llvm/llvm-ifs: c++20 compatibility

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 14 10:28:59 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGccde601f140c: Fix llvm/lib/ObjCopy, llvm/llvm-ifs: c++20 compatibility (authored by angelomatnigoogle, committed by MaskRay).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135906/new/

https://reviews.llvm.org/D135906

Files:
  llvm/lib/ObjCopy/MachO/MachOObject.cpp
  llvm/lib/ObjCopy/MachO/MachOObject.h
  llvm/tools/llvm-ifs/ErrorCollector.h


Index: llvm/tools/llvm-ifs/ErrorCollector.h
===================================================================
--- llvm/tools/llvm-ifs/ErrorCollector.h
+++ llvm/tools/llvm-ifs/ErrorCollector.h
@@ -21,13 +21,12 @@
 #ifndef LLVM_TOOLS_LLVM_IFS_ERRORCOLLECTOR_H
 #define LLVM_TOOLS_LLVM_IFS_ERRORCOLLECTOR_H
 
+#include "llvm/Support/Error.h"
 #include "llvm/Support/raw_ostream.h"
 #include <vector>
 
 namespace llvm {
 
-class Error;
-
 namespace ifs {
 
 class ErrorCollector {
Index: llvm/lib/ObjCopy/MachO/MachOObject.h
===================================================================
--- llvm/lib/ObjCopy/MachO/MachOObject.h
+++ llvm/lib/ObjCopy/MachO/MachOObject.h
@@ -57,14 +57,9 @@
   StringRef Content;
   std::vector<RelocationInfo> Relocations;
 
-  Section(StringRef SegName, StringRef SectName)
-      : Segname(std::string(SegName)), Sectname(std::string(SectName)),
-        CanonicalName((Twine(SegName) + Twine(',') + SectName).str()) {}
-
-  Section(StringRef SegName, StringRef SectName, StringRef Content)
-      : Segname(std::string(SegName)), Sectname(std::string(SectName)),
-        CanonicalName((Twine(SegName) + Twine(',') + SectName).str()),
-        Content(Content) {}
+  Section(StringRef SegName, StringRef SectName);
+
+  Section(StringRef SegName, StringRef SectName, StringRef Content);
 
   MachO::SectionType getType() const {
     return static_cast<MachO::SectionType>(Flags & MachO::SECTION_TYPE);
Index: llvm/lib/ObjCopy/MachO/MachOObject.cpp
===================================================================
--- llvm/lib/ObjCopy/MachO/MachOObject.cpp
+++ llvm/lib/ObjCopy/MachO/MachOObject.cpp
@@ -13,6 +13,15 @@
 using namespace llvm;
 using namespace llvm::objcopy::macho;
 
+Section::Section(StringRef SegName, StringRef SectName)
+    : Segname(std::string(SegName)), Sectname(std::string(SectName)),
+      CanonicalName((Twine(SegName) + Twine(',') + SectName).str()) {}
+
+Section::Section(StringRef SegName, StringRef SectName, StringRef Content)
+    : Segname(std::string(SegName)), Sectname(std::string(SectName)),
+      CanonicalName((Twine(SegName) + Twine(',') + SectName).str()),
+      Content(Content) {}
+
 const SymbolEntry *SymbolTable::getSymbolByIndex(uint32_t Index) const {
   assert(Index < Symbols.size() && "invalid symbol index");
   return Symbols[Index].get();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135906.467831.patch
Type: text/x-patch
Size: 2340 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221014/c9e56288/attachment.bin>


More information about the llvm-commits mailing list