Skip to content

Commit

Permalink
upgrade llvm
Browse files Browse the repository at this point in the history
  • Loading branch information
vajexal committed May 6, 2024
1 parent c7bd036 commit 3606a96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- name: Setup
run: |
brew install llvm@17 bison re2c
brew install llvm@18 bison re2c
- name: Checkout code
uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions src/codegen/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace X::Codegen {

interfaceDecl.vtableType = genVtable(node, interfaceDecl);
// {vtable, obj ptr, gc meta}
interfaceDecl.llvmType->setBody({builder.getPtrTy(), builder.getInt8PtrTy(), builder.getInt8PtrTy()});
interfaceDecl.llvmType->setBody({builder.getPtrTy(), builder.getPtrTy(), builder.getPtrTy()});

return nullptr;
}
Expand Down Expand Up @@ -242,7 +242,7 @@ namespace X::Codegen {

llvm::Value *Codegen::getGCMetaValue(const Type &type) {
auto meta = getTypeGCMeta(type);
return meta ? builder.CreateIntToPtr(builder.getInt64((uint64_t)meta), builder.getInt8PtrTy()) : nullptr;
return meta ? builder.CreateIntToPtr(builder.getInt64((uint64_t)meta), builder.getPtrTy()) : nullptr;
}

bool Codegen::isObject(const Type &type) const {
Expand Down Expand Up @@ -365,7 +365,7 @@ namespace X::Codegen {
if (interfaceDecl) {
// get "this" from interface object
auto objPtr = builder.CreateStructGEP(interfaceDecl->llvmType, obj, 1);
obj = builder.CreateLoad(builder.getInt8PtrTy(), objPtr);
obj = builder.CreateLoad(builder.getPtrTy(), objPtr);
}
}

Expand Down

0 comments on commit 3606a96

Please sign in to comment.