[llvm] 52b8845 - [JITLink] Use SubtargetFeatures to store features in LinkGraph
Job Noorman via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 27 00:34:56 PDT 2023
Author: Job Noorman
Date: 2023-06-27T09:34:46+02:00
New Revision: 52b88457baf81e531ecf0d218feabebeadfc1e84
URL: https://github.com/llvm/llvm-project/commit/52b88457baf81e531ecf0d218feabebeadfc1e84
DIFF: https://github.com/llvm/llvm-project/commit/52b88457baf81e531ecf0d218feabebeadfc1e84.diff
LOG: [JITLink] Use SubtargetFeatures to store features in LinkGraph
D149522 introduced target features to LinkGraph. However, to avoid a
public dependency on MC, the features were stored in a std::vector
instead of using SubtargetFeatures directly.
Since SubtargetFeatures was moved from MC to TargetParser (D150549), we
can now use it directly to store the features. This patch implements
that and removes the (private) dependency on MC.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D153749
Added:
Modified:
llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp
llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h
llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp
llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
llvm/lib/ExecutionEngine/JITLink/ELF_aarch32.cpp
llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
llvm/lib/ExecutionEngine/JITLink/ELF_i386.cpp
llvm/lib/ExecutionEngine/JITLink/ELF_loongarch.cpp
llvm/lib/ExecutionEngine/JITLink/ELF_ppc64.cpp
llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
index 59bd01b45a40e..568c9cf87f80e 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
@@ -29,6 +29,7 @@
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/TargetParser/SubtargetFeature.h"
#include "llvm/TargetParser/Triple.h"
#include <optional>
@@ -984,9 +985,7 @@ class LinkGraph {
using GetEdgeKindNameFunction = const char *(*)(Edge::Kind);
- using FeatureVector = std::vector<std::string>;
-
- LinkGraph(std::string Name, const Triple &TT, FeatureVector Features,
+ LinkGraph(std::string Name, const Triple &TT, SubtargetFeatures Features,
unsigned PointerSize, support::endianness Endianness,
GetEdgeKindNameFunction GetEdgeKindName)
: Name(std::move(Name)), TT(TT), Features(std::move(Features)),
@@ -996,8 +995,8 @@ class LinkGraph {
LinkGraph(std::string Name, const Triple &TT, unsigned PointerSize,
support::endianness Endianness,
GetEdgeKindNameFunction GetEdgeKindName)
- : LinkGraph(std::move(Name), TT, FeatureVector(), PointerSize, Endianness,
- GetEdgeKindName) {}
+ : LinkGraph(std::move(Name), TT, SubtargetFeatures(), PointerSize,
+ Endianness, GetEdgeKindName) {}
LinkGraph(const LinkGraph &) = delete;
LinkGraph &operator=(const LinkGraph &) = delete;
@@ -1012,7 +1011,7 @@ class LinkGraph {
const Triple &getTargetTriple() const { return TT; }
/// Return the subtarget features for this Graph.
- const FeatureVector &getFeatures() const { return Features; }
+ const SubtargetFeatures &getFeatures() const { return Features; }
/// Returns the pointer size for use in this graph.
unsigned getPointerSize() const { return PointerSize; }
@@ -1519,7 +1518,7 @@ class LinkGraph {
std::string Name;
Triple TT;
- FeatureVector Features;
+ SubtargetFeatures Features;
unsigned PointerSize;
support::endianness Endianness;
GetEdgeKindNameFunction GetEdgeKindName = nullptr;
diff --git a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
index 67e1d09f558ae..e5f5a99c39bc0 100644
--- a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
@@ -52,7 +52,6 @@ add_llvm_component_library(LLVMJITLink
LINK_COMPONENTS
BinaryFormat
- MC
Object
Option
OrcTargetProcess
diff --git a/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp b/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp
index 21ea5fc34f8dc..6668854e1a6a6 100644
--- a/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp
@@ -24,8 +24,7 @@ static Triple createTripleWithCOFFFormat(Triple T) {
}
COFFLinkGraphBuilder::COFFLinkGraphBuilder(
- const object::COFFObjectFile &Obj, Triple TT,
- LinkGraph::FeatureVector Features,
+ const object::COFFObjectFile &Obj, Triple TT, SubtargetFeatures Features,
LinkGraph::GetEdgeKindNameFunction GetEdgeKindName)
: Obj(Obj), G(std::make_unique<LinkGraph>(
Obj.getFileName().str(), createTripleWithCOFFFormat(TT),
diff --git a/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h b/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h
index d5f2c7a7f6748..e64823759540a 100644
--- a/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h
+++ b/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h
@@ -39,7 +39,7 @@ class COFFLinkGraphBuilder {
using COFFSymbolIndex = int32_t;
COFFLinkGraphBuilder(const object::COFFObjectFile &Obj, Triple TT,
- LinkGraph::FeatureVector Features,
+ SubtargetFeatures Features,
LinkGraph::GetEdgeKindNameFunction GetEdgeKindName);
LinkGraph &getGraph() const { return *G; }
diff --git a/llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp b/llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp
index b957d21a086c7..3257a2ae94f66 100644
--- a/llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp
@@ -182,7 +182,7 @@ class COFFLinkGraphBuilder_x86_64 : public COFFLinkGraphBuilder {
public:
COFFLinkGraphBuilder_x86_64(const object::COFFObjectFile &Obj, const Triple T,
- const LinkGraph::FeatureVector Features)
+ const SubtargetFeatures Features)
: COFFLinkGraphBuilder(Obj, std::move(T), std::move(Features),
getCOFFX86RelocationKindName) {}
};
@@ -321,7 +321,7 @@ createLinkGraphFromCOFFObject_x86_64(MemoryBufferRef ObjectBuffer) {
return Features.takeError();
return COFFLinkGraphBuilder_x86_64(**COFFObj, (*COFFObj)->makeTriple(),
- Features->getFeatures())
+ std::move(*Features))
.buildGraph();
}
diff --git a/llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h b/llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
index bd69838a50829..e726457983490 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
+++ b/llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
@@ -59,7 +59,7 @@ class ELFLinkGraphBuilder : public ELFLinkGraphBuilderBase {
public:
ELFLinkGraphBuilder(const object::ELFFile<ELFT> &Obj, Triple TT,
- LinkGraph::FeatureVector Features, StringRef FileName,
+ SubtargetFeatures Features, StringRef FileName,
LinkGraph::GetEdgeKindNameFunction GetEdgeKindName);
/// Debug sections are included in the graph by default. Use
@@ -189,7 +189,7 @@ class ELFLinkGraphBuilder : public ELFLinkGraphBuilderBase {
template <typename ELFT>
ELFLinkGraphBuilder<ELFT>::ELFLinkGraphBuilder(
- const ELFFile &Obj, Triple TT, LinkGraph::FeatureVector Features,
+ const ELFFile &Obj, Triple TT, SubtargetFeatures Features,
StringRef FileName, LinkGraph::GetEdgeKindNameFunction GetEdgeKindName)
: ELFLinkGraphBuilderBase(std::make_unique<LinkGraph>(
FileName.str(), Triple(std::move(TT)), std::move(Features),
diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_aarch32.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_aarch32.cpp
index 872f192633d31..a1bc4c8533231 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELF_aarch32.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/ELF_aarch32.cpp
@@ -191,7 +191,7 @@ class ELFLinkGraphBuilder_aarch32
public:
ELFLinkGraphBuilder_aarch32(StringRef FileName,
const llvm::object::ELFFile<ELFT> &Obj, Triple TT,
- LinkGraph::FeatureVector Features,
+ SubtargetFeatures Features,
aarch32::ArmConfig ArmCfg)
: ELFLinkGraphBuilder<ELFT>(Obj, std::move(TT), std::move(Features),
FileName, getELFAArch32EdgeKindName),
@@ -254,7 +254,7 @@ createLinkGraphFromELFObject_aarch32(MemoryBufferRef ObjectBuffer) {
case Triple::thumb: {
auto &ELFFile = cast<ELFObjectFile<ELF32LE>>(**ELFObj).getELFFile();
return ELFLinkGraphBuilder_aarch32<support::little>(
- (*ELFObj)->getFileName(), ELFFile, TT, Features->getFeatures(),
+ (*ELFObj)->getFileName(), ELFFile, TT, std::move(*Features),
ArmCfg)
.buildGraph();
}
@@ -262,7 +262,7 @@ createLinkGraphFromELFObject_aarch32(MemoryBufferRef ObjectBuffer) {
case Triple::thumbeb: {
auto &ELFFile = cast<ELFObjectFile<ELF32BE>>(**ELFObj).getELFFile();
return ELFLinkGraphBuilder_aarch32<support::big>(
- (*ELFObj)->getFileName(), ELFFile, TT, Features->getFeatures(),
+ (*ELFObj)->getFileName(), ELFFile, TT, std::move(*Features),
ArmCfg)
.buildGraph();
}
diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
index fac320773d6f8..652eb931190e3 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
@@ -429,7 +429,7 @@ class ELFLinkGraphBuilder_aarch64 : public ELFLinkGraphBuilder<ELFT> {
public:
ELFLinkGraphBuilder_aarch64(StringRef FileName,
const object::ELFFile<ELFT> &Obj, Triple TT,
- LinkGraph::FeatureVector Features)
+ SubtargetFeatures Features)
: ELFLinkGraphBuilder<ELFT>(Obj, std::move(TT), std::move(Features),
FileName, aarch64::getEdgeKindName) {}
};
@@ -589,7 +589,7 @@ createLinkGraphFromELFObject_aarch64(MemoryBufferRef ObjectBuffer) {
auto &ELFObjFile = cast<object::ELFObjectFile<object::ELF64LE>>(**ELFObj);
return ELFLinkGraphBuilder_aarch64<object::ELF64LE>(
(*ELFObj)->getFileName(), ELFObjFile.getELFFile(),
- (*ELFObj)->makeTriple(), Features->getFeatures())
+ (*ELFObj)->makeTriple(), std::move(*Features))
.buildGraph();
}
diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_i386.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_i386.cpp
index f17007f81e68e..860165365a7e4 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELF_i386.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/ELF_i386.cpp
@@ -210,7 +210,7 @@ class ELFLinkGraphBuilder_i386 : public ELFLinkGraphBuilder<ELFT> {
public:
ELFLinkGraphBuilder_i386(StringRef FileName, const object::ELFFile<ELFT> &Obj,
- Triple TT, LinkGraph::FeatureVector Features)
+ Triple TT, SubtargetFeatures Features)
: ELFLinkGraphBuilder<ELFT>(Obj, std::move(TT), std::move(Features),
FileName, i386::getEdgeKindName) {}
};
@@ -236,7 +236,7 @@ createLinkGraphFromELFObject_i386(MemoryBufferRef ObjectBuffer) {
auto &ELFObjFile = cast<object::ELFObjectFile<object::ELF32LE>>(**ELFObj);
return ELFLinkGraphBuilder_i386<object::ELF32LE>(
(*ELFObj)->getFileName(), ELFObjFile.getELFFile(),
- (*ELFObj)->makeTriple(), Features->getFeatures())
+ (*ELFObj)->makeTriple(), std::move(*Features))
.buildGraph();
}
diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_loongarch.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_loongarch.cpp
index 9945cd3a4639c..7f76b45aecbbe 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELF_loongarch.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/ELF_loongarch.cpp
@@ -130,7 +130,7 @@ class ELFLinkGraphBuilder_loongarch : public ELFLinkGraphBuilder<ELFT> {
public:
ELFLinkGraphBuilder_loongarch(StringRef FileName,
const object::ELFFile<ELFT> &Obj, Triple TT,
- LinkGraph::FeatureVector Features)
+ SubtargetFeatures Features)
: ELFLinkGraphBuilder<ELFT>(Obj, std::move(TT), std::move(Features),
FileName, loongarch::getEdgeKindName) {}
};
@@ -168,7 +168,7 @@ createLinkGraphFromELFObject_loongarch(MemoryBufferRef ObjectBuffer) {
auto &ELFObjFile = cast<object::ELFObjectFile<object::ELF64LE>>(**ELFObj);
return ELFLinkGraphBuilder_loongarch<object::ELF64LE>(
(*ELFObj)->getFileName(), ELFObjFile.getELFFile(),
- (*ELFObj)->makeTriple(), Features->getFeatures())
+ (*ELFObj)->makeTriple(), std::move(*Features))
.buildGraph();
}
@@ -177,7 +177,7 @@ createLinkGraphFromELFObject_loongarch(MemoryBufferRef ObjectBuffer) {
auto &ELFObjFile = cast<object::ELFObjectFile<object::ELF32LE>>(**ELFObj);
return ELFLinkGraphBuilder_loongarch<object::ELF32LE>(
(*ELFObj)->getFileName(), ELFObjFile.getELFFile(),
- (*ELFObj)->makeTriple(), Features->getFeatures())
+ (*ELFObj)->makeTriple(), std::move(*Features))
.buildGraph();
}
diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_ppc64.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_ppc64.cpp
index d1f957eafc02d..19b774d6598bf 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELF_ppc64.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/ELF_ppc64.cpp
@@ -63,7 +63,7 @@ class ELFLinkGraphBuilder_ppc64
public:
ELFLinkGraphBuilder_ppc64(StringRef FileName,
const object::ELFFile<ELFT> &Obj, Triple TT,
- LinkGraph::FeatureVector Features)
+ SubtargetFeatures Features)
: ELFLinkGraphBuilder<ELFT>(Obj, std::move(TT), std::move(Features),
FileName, ppc64::getEdgeKindName) {}
};
@@ -106,7 +106,7 @@ createLinkGraphFromELFObject_ppc64(MemoryBufferRef ObjectBuffer) {
auto &ELFObjFile = cast<object::ELFObjectFile<ELFT>>(**ELFObj);
return ELFLinkGraphBuilder_ppc64<Endianness>(
(*ELFObj)->getFileName(), ELFObjFile.getELFFile(),
- (*ELFObj)->makeTriple(), Features->getFeatures())
+ (*ELFObj)->makeTriple(), std::move(*Features))
.buildGraph();
}
diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
index 7438666f3b479..77dd68a848588 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
@@ -515,7 +515,7 @@ static bool isRelaxable(const Edge &E) {
static RelaxAux initRelaxAux(LinkGraph &G) {
RelaxAux Aux;
Aux.Config.IsRV32 = G.getTargetTriple().isRISCV32();
- const auto &Features = G.getFeatures();
+ const auto &Features = G.getFeatures().getFeatures();
Aux.Config.HasRVC =
std::find(Features.begin(), Features.end(), "+c") != Features.end();
@@ -919,7 +919,7 @@ class ELFLinkGraphBuilder_riscv : public ELFLinkGraphBuilder<ELFT> {
public:
ELFLinkGraphBuilder_riscv(StringRef FileName,
const object::ELFFile<ELFT> &Obj, Triple TT,
- LinkGraph::FeatureVector Features)
+ SubtargetFeatures Features)
: ELFLinkGraphBuilder<ELFT>(Obj, std::move(TT), std::move(Features),
FileName, riscv::getEdgeKindName) {}
};
@@ -943,7 +943,7 @@ createLinkGraphFromELFObject_riscv(MemoryBufferRef ObjectBuffer) {
auto &ELFObjFile = cast<object::ELFObjectFile<object::ELF64LE>>(**ELFObj);
return ELFLinkGraphBuilder_riscv<object::ELF64LE>(
(*ELFObj)->getFileName(), ELFObjFile.getELFFile(),
- (*ELFObj)->makeTriple(), Features->getFeatures())
+ (*ELFObj)->makeTriple(), std::move(*Features))
.buildGraph();
} else {
assert((*ELFObj)->getArch() == Triple::riscv32 &&
@@ -951,7 +951,7 @@ createLinkGraphFromELFObject_riscv(MemoryBufferRef ObjectBuffer) {
auto &ELFObjFile = cast<object::ELFObjectFile<object::ELF32LE>>(**ELFObj);
return ELFLinkGraphBuilder_riscv<object::ELF32LE>(
(*ELFObj)->getFileName(), ELFObjFile.getELFFile(),
- (*ELFObj)->makeTriple(), Features->getFeatures())
+ (*ELFObj)->makeTriple(), std::move(*Features))
.buildGraph();
}
}
diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
index d46e525704c80..1bdddd4c722bc 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
@@ -228,7 +228,7 @@ class ELFLinkGraphBuilder_x86_64 : public ELFLinkGraphBuilder<object::ELF64LE> {
public:
ELFLinkGraphBuilder_x86_64(StringRef FileName,
const object::ELFFile<object::ELF64LE> &Obj,
- LinkGraph::FeatureVector Features)
+ SubtargetFeatures Features)
: ELFLinkGraphBuilder(Obj, Triple("x86_64-unknown-linux"),
std::move(Features), FileName,
x86_64::getEdgeKindName) {}
@@ -338,7 +338,7 @@ createLinkGraphFromELFObject_x86_64(MemoryBufferRef ObjectBuffer) {
auto &ELFObjFile = cast<object::ELFObjectFile<object::ELF64LE>>(**ELFObj);
return ELFLinkGraphBuilder_x86_64((*ELFObj)->getFileName(),
ELFObjFile.getELFFile(),
- Features->getFeatures())
+ std::move(*Features))
.buildGraph();
}
diff --git a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
index aed28a3d4be17..c40e0f9ffc8d4 100644
--- a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
@@ -47,8 +47,7 @@ Expected<std::unique_ptr<LinkGraph>> MachOLinkGraphBuilder::buildGraph() {
}
MachOLinkGraphBuilder::MachOLinkGraphBuilder(
- const object::MachOObjectFile &Obj, Triple TT,
- LinkGraph::FeatureVector Features,
+ const object::MachOObjectFile &Obj, Triple TT, SubtargetFeatures Features,
LinkGraph::GetEdgeKindNameFunction GetEdgeKindName)
: Obj(Obj),
G(std::make_unique<LinkGraph>(std::string(Obj.getFileName()),
diff --git a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
index e0e581653c29d..2805c2960b9bd 100644
--- a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
+++ b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
@@ -84,7 +84,7 @@ class MachOLinkGraphBuilder {
using SectionParserFunction = std::function<Error(NormalizedSection &S)>;
MachOLinkGraphBuilder(const object::MachOObjectFile &Obj, Triple TT,
- LinkGraph::FeatureVector Features,
+ SubtargetFeatures Features,
LinkGraph::GetEdgeKindNameFunction GetEdgeKindName);
LinkGraph &getGraph() const { return *G; }
diff --git a/llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp b/llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
index 5598b57d7a048..dd0b5d37d1b7d 100644
--- a/llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
@@ -26,7 +26,7 @@ namespace {
class MachOLinkGraphBuilder_arm64 : public MachOLinkGraphBuilder {
public:
MachOLinkGraphBuilder_arm64(const object::MachOObjectFile &Obj,
- LinkGraph::FeatureVector Features)
+ SubtargetFeatures Features)
: MachOLinkGraphBuilder(Obj, Triple("arm64-apple-darwin"),
std::move(Features), aarch64::getEdgeKindName),
NumSymbols(Obj.getSymtabLoadCommand().nsyms) {}
@@ -547,7 +547,7 @@ createLinkGraphFromMachOObject_arm64(MemoryBufferRef ObjectBuffer) {
if (!Features)
return Features.takeError();
- return MachOLinkGraphBuilder_arm64(**MachOObj, Features->getFeatures())
+ return MachOLinkGraphBuilder_arm64(**MachOObj, std::move(*Features))
.buildGraph();
}
diff --git a/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp b/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
index a4606929d494e..4dba27bc61cb3 100644
--- a/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
@@ -26,7 +26,7 @@ namespace {
class MachOLinkGraphBuilder_x86_64 : public MachOLinkGraphBuilder {
public:
MachOLinkGraphBuilder_x86_64(const object::MachOObjectFile &Obj,
- LinkGraph::FeatureVector Features)
+ SubtargetFeatures Features)
: MachOLinkGraphBuilder(Obj, Triple("x86_64-apple-darwin"),
std::move(Features), x86_64::getEdgeKindName) {}
@@ -472,7 +472,7 @@ createLinkGraphFromMachOObject_x86_64(MemoryBufferRef ObjectBuffer) {
if (!Features)
return Features.takeError();
- return MachOLinkGraphBuilder_x86_64(**MachOObj, Features->getFeatures())
+ return MachOLinkGraphBuilder_x86_64(**MachOObj, std::move(*Features))
.buildGraph();
}
More information about the llvm-commits
mailing list