Skip to content
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
15 changes: 9 additions & 6 deletions third-party/llvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ifeq ($(CHPL_LLVM_ASSERTS),1)
endif

ifdef CHPL_RV
CHPL_RV_CMAKE = -DRV_ENABLE_CRT=on -DLLVM_ENABLE_CXX1Y=on -DLLVM_CXX_STD:STRING=c++14
CHPL_RV_CMAKE = -DLLVM_EXTERNAL_PROJECTS="rv" -DLLVM_EXTERNAL_RV_SOURCE_DIR=$(LLVM_SRC_DIR)/../rv -DRV_ENABLE_CRT=on
endif

ifneq ($(LLVM_SUBDIR),llvm-src)
Expand Down Expand Up @@ -106,7 +106,13 @@ clobber: FORCE
$(LLVM_CONFIGURED_HEADER_FILE): $(LLVM_SRC_FILE)
mkdir -p $(LLVM_BUILD_DIR)
@if ./cmake-ok.sh $(CMAKE); then \
cd $(LLVM_BUILD_DIR) && cmake \
echo ; \
else \
echo Error: LLVM requires cmake 3.4.3 or later to build; \
exit 1; \
fi

cd $(LLVM_BUILD_DIR) && cmake \
-DCMAKE_INSTALL_PREFIX=$(LLVM_INSTALL_DIR) \
-DCMAKE_C_COMPILER='$(CC)' \
-DCMAKE_CXX_COMPILER='$(CXX)' \
Expand All @@ -117,6 +123,7 @@ $(LLVM_CONFIGURED_HEADER_FILE): $(LLVM_SRC_FILE)
-DLLVM_ENABLE_WARNINGS=0 \
-DLLVM_ENABLE_PEDANTIC=0 \
-DCLANG_ENABLE_ARCMT=0 \
-DCLANG_ANALYZER_ENABLE_Z3_SOLVER=0 \
-DCLANG_ENABLE_STATIC_ANALYZER=0 \
-DLLVM_TARGETS_TO_BUILD="host;X86;AArch64" \
-DLLVM_INSTALL_UTILS=ON \
Expand All @@ -126,10 +133,6 @@ $(LLVM_CONFIGURED_HEADER_FILE): $(LLVM_SRC_FILE)
$(CHPL_RV_CMAKE) \
-Wno-dev \
$(LLVM_SRC_DIR) ; \
else \
echo Error: LLVM requires cmake 3.4.3 or later to build; \
exit 1; \
fi


$(LLVM_HEADER_FILE):
Expand Down
6 changes: 6 additions & 0 deletions third-party/llvm/Makefile.include-llvm
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ include $(THIRD_PARTY_DIR)/llvm/Makefile.share-included

# Enable RV and Polly if they are in the source directory
LLVM_RV_FILE = $(LLVM_DIR)/$(LLVM_SUBDIR)/tools/rv/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we keeping this for backwards compatibility?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it in because I'm not sure if it will be needed or not in the future if we start to bundle RV.

LLVM_RV_FILE2 = $(LLVM_DIR)/$(LLVM_SUBDIR)/../rv/
LLVM_POLLY_FILE = $(LLVM_DIR)/$(LLVM_SUBDIR)/tools/polly/

ifneq ("$(wildcard $(LLVM_RV_FILE))","")
CHPL_RV := 1
endif

ifneq ("$(wildcard $(LLVM_RV_FILE2))","")
CHPL_RV := 1
endif

ifneq ("$(wildcard $(LLVM_POLLY_FILE))","")
CHPL_POLLY := 1
endif
Expand Down
16 changes: 8 additions & 8 deletions third-party/llvm/update-llvm.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

BRANCH=unknown
ENABLE_RV=0
ENABLE_RV=1

if [ "$#" -eq 0 ]
then
Expand Down Expand Up @@ -29,27 +29,27 @@ echo Updating LLVM
cd llvm-project
git pull --rebase
echo Updating RV
if [ -d llvm/tools/rv ]
if [ -d llvm-project/rv ]
then
cd llvm/tools/rv
cd llvm-project/rv
git pull --rebase
cd ../../..
cd ../..
fi

cd ..

else

echo Checking out LLVM monorepo $BRANCH
git clone https://github.com/llvm/llvm-project.git llvm-project
git clone $CLONEARGS https://github.com/llvm/llvm-project.git llvm-project

if [ "$ENABLE_RV" -ne 0 ]
then
echo Checking out RV $BRANCH
git clone $CLONEARGS https://github.com/cdl-saarland/rv llvm-project/llvm/tools/rv
cd llvm-project/llvm/tools/rv
git clone $CLONEARGS https://github.com/cdl-saarland/rv llvm-project/rv
cd llvm-project/rv
git submodule update --init
cd ../../../..
cd ../..
fi

fi