Skip to content
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

Only support LLVM 16 #168

Merged
merged 2 commits into from
Jul 19, 2023
Merged
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
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -15,10 +15,8 @@ if (NOT DEFINED LLVM_VERSION_MAJOR)
set (CMAKE_CXX_STANDARD 17)
endif()

if(LLVM_VERSION_MAJOR LESS 8)
message(FATAL_ERROR "This project isn't buldable with LLVM < 8.0.0.")
elseif(LLVM_VERSION_MAJOR LESS 10)
message(WARNING "Building with LLVM < 10.0.0 is at your own risk.")
if(NOT LLVM_VERSION_MAJOR EQUAL 16)
message(FATAL_ERROR "This project only supports LLVM 16. For older versions of LLVM please check https://github.com/JuliaHubOSS/llvm-cbe/tags")
endif()

add_subdirectory(lib)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ This LLVM C backend has been resurrected by Julia Computing with various improve
Installation instructions
=========================

This version of the LLVM C backend works with LLVM 10.0 and 16.0, other version of LLVM may work but are untested.
This version of the LLVM C backend works with LLVM 16, for older versions please check the [tags](https://github.com/JuliaHubOSS/llvm-cbe/tags).

Step 1: Installing LLVM
=======================
328 changes: 7 additions & 321 deletions lib/Target/CBackend/CBackend.cpp

Large diffs are not rendered by default.

13 changes: 2 additions & 11 deletions lib/Target/CBackend/CBackend.h
Original file line number Diff line number Diff line change
@@ -6,13 +6,9 @@
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/AbstractCallSite.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/CFG.h"
#if LLVM_VERSION_MAJOR > 10
#include "llvm/IR/AbstractCallSite.h"
#else
#include "llvm/IR/CallSite.h"
#endif
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
@@ -334,12 +330,7 @@ class CWriter : public FunctionPass, public InstVisitor<CWriter> {
errorWithMessage("unsupported LLVM instruction");
}

#if LLVM_VERSION_MAJOR >= 16
[[noreturn]]
#else
LLVM_ATTRIBUTE_NORETURN
#endif
void errorWithMessage(const char *message);
[[noreturn]] void errorWithMessage(const char *message);

bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To);
bool canDeclareLocalLate(Instruction &I);