Skip to content

Update to LLVM 20 #135763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
[submodule "src/llvm-project"]
path = src/llvm-project
url = https://github.com/rust-lang/llvm-project.git
branch = rustc/19.1-2024-12-03
branch = rustc/20.1-2025-02-13
shallow = true
[submodule "src/doc/embedded-book"]
path = src/doc/embedded-book
Expand Down
20 changes: 12 additions & 8 deletions compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "llvm/Passes/StandardInstrumentations.h"
#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Target/TargetMachine.h"
Expand Down Expand Up @@ -472,16 +473,19 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
assert(ArgsCstrBuff[ArgsCstrBuffLen - 1] == '\0');
auto Arg0 = std::string(ArgsCstrBuff);
buffer_offset = Arg0.size() + 1;
auto ArgsCppStr = std::string(ArgsCstrBuff + buffer_offset,
ArgsCstrBuffLen - buffer_offset);
auto i = 0;
while (i != std::string::npos) {
i = ArgsCppStr.find('\0', i + 1);
if (i != std::string::npos)
ArgsCppStr.replace(i, 1, " ");

std::string CommandlineArgs;
raw_string_ostream OS(CommandlineArgs);
ListSeparator LS(" ");
for (StringRef Arg : split(StringRef(ArgsCstrBuff + buffer_offset,
ArgsCstrBuffLen - buffer_offset),
'\0')) {
OS << LS;
sys::printArg(OS, Arg, /*Quote=*/true);
}
OS.flush();
Options.MCOptions.Argv0 = Arg0;
Options.MCOptions.CommandlineArgs = ArgsCppStr;
Options.MCOptions.CommandlineArgs = CommandlineArgs;
#else
int buffer_offset = 0;
assert(ArgsCstrBuff[ArgsCstrBuffLen - 1] == '\0');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ CT_ARCH_LOONGARCH=y
# CT_DEMULTILIB is not set
CT_ARCH_USE_MMU=y
CT_ARCH_ARCH="loongarch64"
CT_TARGET_CFLAGS="-mcmodel=medium"
CT_TARGET_LDFLAGS="-mcmodel=medium"
CT_KERNEL_LINUX=y
CT_LINUX_V_5_19=y
CT_GLIBC_V_2_36=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ CT_ARCH_LOONGARCH=y
# CT_DEMULTILIB is not set
CT_ARCH_USE_MMU=y
CT_ARCH_ARCH="loongarch64"
CT_TARGET_CFLAGS="-mcmodel=medium"
CT_TARGET_LDFLAGS="-mcmodel=medium"
CT_KERNEL_LINUX=y
CT_LINUX_V_5_19=y
CT_LIBC_MUSL=y
Expand Down
2 changes: 1 addition & 1 deletion src/llvm-project
Loading