Skip to content
Closed
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
4 changes: 2 additions & 2 deletions cmake/LLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function(fetch_or_build_slang_llvm)
endif()
endif()
elseif(SLANG_SLANG_LLVM_FLAVOR STREQUAL "USE_SYSTEM_LLVM")
find_package(LLVM 13.0 REQUIRED CONFIG)
find_package(LLVM 17.0 REQUIRED CONFIG)
find_package(Clang REQUIRED CONFIG)

llvm_target_from_components(llvm-dep filecheck native orcjit)
Expand Down Expand Up @@ -104,7 +104,7 @@ function(fetch_or_build_slang_llvm)
endif()

# TODO: Put a check here that libslang-llvm.so doesn't have a 'NEEDED'
# directive for libLLVM-13.so, it's almost certainly going to break at
# directive for libLLVM-17.so, it's almost certainly going to break at
# runtime in surprising ways when linked alongside Mesa (or anything else
# pulling in libLLVM.so)
endif()
Expand Down
2 changes: 1 addition & 1 deletion docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ There are several options for getting llvm-support:
the case that a prebuilt binary can't be found then the build will proceed
as though `DISABLE` was chosen
- Use a system supplied LLVM: `-DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM`, you
must have llvm-13.0 and a matching libclang installed. It's important that
must have llvm-17.0 and a matching libclang installed. It's important that
either:
- You don't end up linking to a dynamic libllvm.so, this will almost
certainly cause multiple versions of LLVM to be loaded at runtime,
Expand Down
2 changes: 1 addition & 1 deletion external/build-llvm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $null = Register-EngineEvent PowerShell.Exiting -Action $cleanup

# Default values
$repo = "https://github.com/llvm/llvm-project"
$branch = "llvmorg-13.0.1"
$branch = "llvmorg-17.0.6"
$sourceDir = $tempDir.FullName
$installPrefix = ""
$config = "Release"
Expand Down
2 changes: 1 addition & 1 deletion external/build-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ trap cleanup EXIT SIGHUP SIGINT SIGTERM
# Options and parsing
#
repo=https://github.com/llvm/llvm-project
branch=llvmorg-13.0.1
branch=llvmorg-17.0.6
source_dir=$temp_dir
install_prefix=
config=Release
Expand Down
1 change: 1 addition & 0 deletions source/slang-llvm/slang-llvm-filecheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <core/slang-com-object.h>
#include <llvm/ADT/SmallString.h>
#include <llvm/FileCheck/FileCheck.h>
#include <llvm/Support/SourceMgr.h>
#include <llvm/Support/raw_ostream.h>
#include <slang-test/filecheck.h>

Expand Down
15 changes: 8 additions & 7 deletions source/slang-llvm/slang-llvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/Timer.h"
Expand Down Expand Up @@ -231,20 +230,20 @@ void* LLVMJITSharedLibrary::findSymbolAddressByName(char const* name)
if (fnExpected)
{
auto fn = std::move(*fnExpected);
return (void*)fn.getAddress();
return (void*)fn.getValue();
}
return nullptr;
}


static void _ensureSufficientStack() {}

static void _llvmErrorHandler(void* userData, const std::string& message, bool genCrashDiag)
static void _llvmErrorHandler(void* userData, const char* message, bool genCrashDiag)
{
// DiagnosticsEngine& diags = *static_cast<DiagnosticsEngine*>(userData);
// diags.Report(diag::err_fe_error_backend) << message;

printf("Clang/LLVM fatal error: %s\n", message.c_str());
printf("Clang/LLVM fatal error: %s\n", message);

// Run the interrupt handlers to make sure any special cleanups get done, in
// particular that we remove files registered with RemoveFileOnSignal.
Expand Down Expand Up @@ -785,9 +784,9 @@ SlangResult LLVMDownstreamCompiler::compile(
includes.push_back(includePath.begin());
}

clang::CompilerInvocation::setLangDefaults(
clang::LangOptions::setLangDefaults(
*opts,
inputKind,
inputKind.getLanguage(),
targetTriple,
includes,
langStd);
Expand Down Expand Up @@ -1049,7 +1048,9 @@ SlangResult LLVMDownstreamCompiler::compile(
{
symbolMap.insert(std::make_pair(
mangler(func.name),
JITEvaluatedSymbol::fromPointer(func.func)));
ExecutorSymbolDef(
ExecutorAddr::fromPtr(func.func),
JITSymbolFlags::Exported)));
}
}

Expand Down
Loading