aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-ml/llvm-ml.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2025-09-08 12:41:22 +0900
committerGitHub <noreply@github.com>2025-09-08 03:41:22 +0000
commit67823469bd1c5f5416c4b009a895dcaffa971b69 (patch)
treeb44e387020fdd5d9f269db179f6dad6e3b6a4737 /llvm/tools/llvm-ml/llvm-ml.cpp
parent727e9f5ea5b2bb9d2fa37619ad2f19b21af7ce4d (diff)
downloadllvm-67823469bd1c5f5416c4b009a895dcaffa971b69.zip
llvm-67823469bd1c5f5416c4b009a895dcaffa971b69.tar.gz
llvm-67823469bd1c5f5416c4b009a895dcaffa971b69.tar.bz2
MC: Add Triple overloads for more MC constructors (#157321)
Avoids more Triple->string->Triple round trip. This is a continuation of f137c3d592e96330e450a8fd63ef7e8877fc1908
Diffstat (limited to 'llvm/tools/llvm-ml/llvm-ml.cpp')
-rw-r--r--llvm/tools/llvm-ml/llvm-ml.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/tools/llvm-ml/llvm-ml.cpp b/llvm/tools/llvm-ml/llvm-ml.cpp
index c8e49ed..ae58b0d 100644
--- a/llvm/tools/llvm-ml/llvm-ml.cpp
+++ b/llvm/tools/llvm-ml/llvm-ml.cpp
@@ -277,8 +277,6 @@ int llvm_ml_main(int Argc, char **Argv, const llvm::ToolContext &) {
WithColor::error(errs(), ProgName) << Error;
return 1;
}
- const std::string &TripleName = TheTriple.getTriple();
-
bool SafeSEH = InputArgs.hasArg(OPT_safeseh);
if (SafeSEH && !(TheTriple.isArch32Bit() && TheTriple.isX86())) {
WithColor::warning()
@@ -316,17 +314,17 @@ int llvm_ml_main(int Argc, char **Argv, const llvm::ToolContext &) {
}
SrcMgr.setIncludeDirs(IncludeDirs);
- std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
+ std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TheTriple));
assert(MRI && "Unable to create target register info!");
std::unique_ptr<MCAsmInfo> MAI(
- TheTarget->createMCAsmInfo(*MRI, TripleName, MCOptions));
+ TheTarget->createMCAsmInfo(*MRI, TheTriple, MCOptions));
assert(MAI && "Unable to create target asm info!");
MAI->setPreserveAsmComments(InputArgs.hasArg(OPT_preserve_comments));
- std::unique_ptr<MCSubtargetInfo> STI(TheTarget->createMCSubtargetInfo(
- TripleName, /*CPU=*/"", /*Features=*/""));
+ std::unique_ptr<MCSubtargetInfo> STI(
+ TheTarget->createMCSubtargetInfo(TheTriple, /*CPU=*/"", /*Features=*/""));
assert(STI && "Unable to create subtarget info!");
// FIXME: This is not pretty. MCContext has a ptr to MCObjectFileInfo and