Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
{getCTy -> containedType} + osx_image downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
artagnon committed Jul 4, 2016
1 parent fd7bae9 commit 1f15802
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -4,7 +4,7 @@ compiler:
- clang
os:
- osx
osx_image: xcode7.3
# osx_image: xcode7.3
before_install:
- ./scripts/install-git-lfs.sh # linux-only
- ./scripts/install-cmake-ninja-flex.sh # .tar.bz2 on linux, brew on mac
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Expand Up @@ -33,8 +33,7 @@ add_custom_target(valgrind
DEPENDS CLI
DEPENDS UnitTest)

add_custom_target(valgrind-all
COMMAND "${VALGRIND_EXE}" "${UNITTEST_EXE}"
add_custom_target(valgrind-all "${VALGRIND_EXE}" "${UNITTEST_EXE}"
COMMENT "Running valgrind comprehensive tests ..."
DEPENDS CLI
DEPENDS UnitTest)
2 changes: 1 addition & 1 deletion include/rhine/IR/Type.hpp
Expand Up @@ -224,7 +224,7 @@ class PointerType : public Type {
static bool classof(const Type *T);
static inline void Profile(FoldingSetNodeID &ID, const Type *CTy);
void Profile(FoldingSetNodeID &ID) const;
Type *getCTy();
Type *containedType();
size_t getSize();
virtual llvm::Type *toLL(llvm::Module *M) override;

Expand Down
1 change: 1 addition & 0 deletions scripts/install-cmake-ninja-flex.sh
Expand Up @@ -6,6 +6,7 @@ if [ $TRAVIS_OS_NAME == linux ] || [ "$(expr substr $(uname -s) 1 5)" == "Linux"
export PATH=$TOOLS_ROOT:$PATH
elif [ $TRAVIS_OS_NAME == osx ] || [ "$(uname)" == "Darwin" ]; then
brew update &&
brew unlink cmake &&
brew install cmake ninja flex &&
brew link --force flex
fi
2 changes: 1 addition & 1 deletion src/CodeGen/InstLowering.cpp
Expand Up @@ -11,7 +11,7 @@ namespace rhine {
llvm::Value *CallInst::toLL(llvm::Module *M) {
CHECK_LoweredValue;
auto K = context();
auto RTy = cast<FunctionType>(cast<PointerType>(VTy)->getCTy())->returnType();
auto RTy = cast<FunctionType>(cast<PointerType>(VTy)->containedType())->returnType();
auto CalleeFn = getCallee()->toLL(M);

// Prepare arguments to call
Expand Down
2 changes: 1 addition & 1 deletion src/CodeGen/TensorLowering.cpp
Expand Up @@ -7,7 +7,7 @@
namespace rhine {
llvm::Value *Tensor::toLL(llvm::Module *M) {
auto K = context();
auto ElTy = type()->getCTy()->toLL(M);
auto ElTy = type()->containedType()->toLL(M);
auto PElTy = llvm::PointerType::get(ElTy, 0);
auto Dims = type()->getDims();
auto NElements = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/CodeGen/TypeLowering.cpp
Expand Up @@ -46,6 +46,6 @@ llvm::Type *FunctionType::toLL(llvm::Module *M) {
}

llvm::Type *PointerType::toLL(llvm::Module *M) {
return llvm::PointerType::get(getCTy()->toLL(M), 0);
return llvm::PointerType::get(containedType()->toLL(M), 0);
}
}
2 changes: 1 addition & 1 deletion src/IR/Instruction.cpp
Expand Up @@ -79,7 +79,7 @@ bool CallInst::classof(const Value *V) { return V->op() == RT_CallInst; }
FunctionType *CallInst::getFTy() const {
auto PTy = cast<PointerType>(type());
assert(PTy && "Illegal call to getFTy() before type inference");
return cast<FunctionType>(PTy->getCTy());
return cast<FunctionType>(PTy->containedType());
}

std::vector<Type *> CallInst::getATys() const { return getFTy()->getATys(); }
Expand Down
2 changes: 1 addition & 1 deletion src/IR/Type.cpp
Expand Up @@ -204,7 +204,7 @@ void PointerType::Profile(FoldingSetNodeID &ID) const {
Profile(ID, ContainedType);
}

Type *PointerType::getCTy() { return ContainedType; }
Type *PointerType::containedType() { return ContainedType; }

size_t PointerType::getSize() { return 8; }

Expand Down
6 changes: 3 additions & 3 deletions src/Transform/TypeInfer.cpp
Expand Up @@ -104,7 +104,7 @@ Type *TypeInfer::visit(Argument *V) {

FunctionType *TypeInfer::followFcnPointer(Type *CalleeTy) {
if (auto PointerTy = dyn_cast<PointerType>(CalleeTy))
return dyn_cast<FunctionType>(PointerTy->getCTy());
return dyn_cast<FunctionType>(PointerTy->containedType());
return nullptr;
}

Expand Down Expand Up @@ -178,8 +178,8 @@ Type *TypeInfer::visit(TerminatorInst *V) {
Type *TypeInfer::visit(IndexingInst *V) {
auto Ty = cast<TensorType>(visit(V->val()));
assert(!isa<UnType>(Ty) && "unable to infer type of Tensor");
V->setType(Ty->getCTy());
return Ty->getCTy();
V->setType(Ty->containedType());
return Ty->containedType();
}

Type *TypeInfer::visit(BindInst *V) {
Expand Down
4 changes: 4 additions & 0 deletions src/UI/CLI/CMakeLists.txt
Expand Up @@ -3,6 +3,10 @@ find_package(LLVM REQUIRED)
add_executable(CLI
"${CMAKE_CURRENT_SOURCE_DIR}/Rhine.cpp")

add_custom_command(TARGET CLI
PRE_BUILD COMMAND "find" "${PROJECT_BINARY_DIR}" "-name"
"*.gcda" "-exec" "rm" "{}" "\;")

set_target_properties(CLI PROPERTIES
OUTPUT_NAME "rhine"
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
Expand Down

0 comments on commit 1f15802

Please sign in to comment.