Skip to content

Commit

Permalink
Update to LLVM 5
Browse files Browse the repository at this point in the history
  • Loading branch information
hcorion committed Dec 14, 2017
1 parent a1fa10a commit 017958c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Expand Up @@ -30,7 +30,7 @@ git:

before_install:
- if [ "$CC" = "clang" ]; then
export CXX="clang++-4.0" CC="clang-4.0";
export CXX="clang++-5.0" CC="clang-5.0";
fi;
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CXX" = "g++" ]; then
export CXX="g++-5" CC="gcc-5" CXXFLAGS="-Wno-format-security";
Expand All @@ -51,7 +51,7 @@ before_install:
sudo dpkg -i libglew1.13_1.13.0-2_amd64.deb libglew-dev_1.13.0-2_amd64.deb libvulkan1_1.0.42.0+dfsg1-1ubuntu1~16.04.1_amd64.deb libvulkan-dev_1.0.42.0+dfsg1-1ubuntu1~16.04.1_amd64.deb;
else
brew update;
brew install ccache glew llvm40;
brew install ccache glew llvm50;
fi;

before_script:
Expand All @@ -67,7 +67,7 @@ before_script:
- cmake .. -DCMAKE_INSTALL_PREFIX=/usr -G Ninja;
- ninja
- # AppImage generation
- if [ -n "$UPLOAD_URL" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$CC" = "clang-4.0" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
- if [ "$TRAVIS_BRANCH" = "master" ] && [ "$CC" = "clang-5.0" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
export LD_LIBRARY_PATH=~/Qt/5.9.3/gcc_64/lib;
DESTDIR=appdir ninja install ; find appdir/ ;
find ../bin ;
Expand Down Expand Up @@ -98,7 +98,7 @@ addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- llvm-toolchain-trusty-5.0
- sourceline: 'ppa:jonathonf/binutils' # We need to update binutils to a newer version to link against the ffmpeg libs on.
packages:
- binutils
Expand All @@ -111,9 +111,9 @@ addons:
#- libvulkan1
#- libvulkan-dev
- libc6-dev
- llvm-4.0
- llvm-4.0-dev
- clang-4.0
- llvm-5.0
- llvm-5.0-dev
- clang-5.0
- libedit-dev
- g++-5
- gcc-5
Expand Down
4 changes: 2 additions & 2 deletions Utilities/JIT.cpp
Expand Up @@ -266,11 +266,11 @@ struct MemoryManager : llvm::RTDyldMemoryManager
return RTDyldMemoryManager::registerEHFrames(addr, load_addr, size);
}

void deregisterEHFrames(u8* addr, u64 load_addr, std::size_t size) override
virtual void deregisterEHFrames() override
{
LOG_ERROR(GENERAL, "deregisterEHFrames() called"); // Not expected

return RTDyldMemoryManager::deregisterEHFrames(addr, load_addr, size);
return RTDyldMemoryManager::deregisterEHFrames();
}
};

Expand Down
6 changes: 3 additions & 3 deletions rpcs3/CMakeLists.txt
Expand Up @@ -163,7 +163,7 @@ set(CMAKE_MODULE_PATH "${RPCS3_SRC_DIR}/cmake_modules")
find_package(OpenGL REQUIRED)
find_package(OpenAL REQUIRED)
if(NOT WITHOUT_LLVM)
find_package(LLVM 4.0 CONFIG)
find_package(LLVM 5.0 CONFIG)
if(NOT LLVM_FOUND)
message("System LLVM was not found, LLVM will be built from the submodule.")

Expand All @@ -182,7 +182,7 @@ if(NOT WITHOUT_LLVM)
set(LLVM_DIR "${CMAKE_CURRENT_BINARY_DIR}/../llvm_build/lib/cmake/llvm/")

# now tries to find LLVM again
find_package(LLVM 4.0 CONFIG)
find_package(LLVM 5.0 CONFIG)
if(NOT LLVM_FOUND)
message(WARNING "Couldn't build LLVM from the submodule. You might need to run `git submodule update --init`")
endif()
Expand Down Expand Up @@ -290,7 +290,7 @@ if(WIN32)
endif()

if(NOT LLVM_FOUND)
message("LLVM 4.0 not found. RPCS3 will be compiled without LLVM support.")
Message("LLVM 5.0 not found. RPCS3 will be compiled without LLVM support.")
else()
add_definitions(${LLVM_DEFINITIONS})
add_definitions(-DLLVM_AVAILABLE)
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/PPUTranslator.cpp
Expand Up @@ -16,7 +16,7 @@ PPUTranslator::PPUTranslator(LLVMContext& context, Module* module, const ppu_mod
, m_module(module)
, m_is_be(false)
, m_info(info)
, m_pure_attr(AttributeSet::get(m_context, AttributeSet::FunctionIndex, {Attribute::NoUnwind, Attribute::ReadNone}))
, m_pure_attr(AttributeList::get(m_context,AttributeList::FunctionIndex, AttrBuilder().addAttribute(Attribute::NoUnwind).addAttribute(Attribute::ReadNone)))
{
// There is no weak linkage on JIT, so let's create variables with different names for each module part
const u32 gsuffix = m_info.name.empty() ? info.funcs[0].addr : info.funcs[0].addr - m_info.segs[0].addr;
Expand Down
6 changes: 3 additions & 3 deletions rpcs3/Emu/Cell/PPUTranslator.h
Expand Up @@ -120,7 +120,7 @@ class PPUTranslator final //: public CPUTranslator
std::map<u64, const ppu_reloc*> m_relocs;

// Attributes for function calls which are "pure" and may be optimized away if their results are unused
const llvm::AttributeSet m_pure_attr;
const llvm::AttributeList m_pure_attr;

// IR builder
llvm::IRBuilder<>* m_ir;
Expand Down Expand Up @@ -404,7 +404,7 @@ class PPUTranslator final //: public CPUTranslator

// Call a function with attribute list
template<typename... Args>
llvm::CallInst* Call(llvm::Type* ret, llvm::AttributeSet attr, llvm::StringRef name, Args... args)
llvm::CallInst* Call(llvm::Type* ret, llvm::AttributeList attr, llvm::StringRef name, Args... args)
{
// Call the function
return m_ir->CreateCall(m_module->getOrInsertFunction(name, llvm::FunctionType::get(ret, {args->getType()...}, false), attr), {args...});
Expand All @@ -414,7 +414,7 @@ class PPUTranslator final //: public CPUTranslator
template<typename... Args>
llvm::CallInst* Call(llvm::Type* ret, llvm::StringRef name, Args... args)
{
return Call(ret, llvm::AttributeSet{}, name, args...);
return Call(ret, llvm::AttributeList{}, name, args...);
}

// Handle compilation errors
Expand Down

0 comments on commit 017958c

Please sign in to comment.