Skip to content

Commit

Permalink
Merge branch 'stable' of https://github.com/LuisaGroup/LuisaCompute i…
Browse files Browse the repository at this point in the history
…nto stable
  • Loading branch information
Mike-Leo-Smith committed May 24, 2024
2 parents 1150dd5 + 3628f3f commit e8bc6e8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
14 changes: 12 additions & 2 deletions src/clangcxx/src/llvm/ASTConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,12 @@ struct ExprTranslator : public clang::RecursiveASTVisitor<ExprTranslator> {
}
current = fb->binary(lcType, TranslateBinaryOp(cxx_op), lhs, rhs);
}
} else if (auto cxxCondOp = llvm::dyn_cast<clang::ConditionalOperator>(x)) {
auto _cond = stack->GetExpr(cxxCondOp->getCond());
auto _true = stack->GetExpr(cxxCondOp->getTrueExpr());
auto _false = stack->GetExpr(cxxCondOp->getFalseExpr());
const auto lcType = db->FindOrAddType(cxxCondOp->getType(), x->getBeginLoc());
current = fb->call(lcType, CallOp::SELECT, {_false, _true, _cond});
} else if (auto dref = llvm::dyn_cast<DeclRefExpr>(x)) {
auto str = luisa::string(dref->getNameInfo().getName().getAsString());
if (auto _current = stack->GetLocal(dref->getDecl())) {
Expand Down Expand Up @@ -1105,6 +1111,7 @@ struct ExprTranslator : public clang::RecursiveASTVisitor<ExprTranslator> {
auto FunctionBuilderBuilder::build(const clang::FunctionDecl *S, bool allowKernel) -> BuildResult {
BuildResult result{
.dimension = 0};
bool is_builtin_type_method = false;
bool is_ignore = false;
bool is_kernel = false;
bool is_vertex = false;
Expand Down Expand Up @@ -1147,7 +1154,10 @@ auto FunctionBuilderBuilder::build(const clang::FunctionDecl *S, bool allowKerne
if (auto thisType = Method->getParent()) {
is_ignore |= thisType->isUnion();// ignore union
for (auto Anno : thisType->specific_attrs<clang::AnnotateAttr>())
is_ignore |= isBuiltinType(Anno);
{
is_builtin_type_method |= isBuiltinType(Anno);
is_ignore |= is_builtin_type_method;
}
if (thisType->isLambda())// ignore global lambda declares, we deal them on stacks only
is_lambda = true;

Expand Down Expand Up @@ -1326,7 +1336,7 @@ auto FunctionBuilderBuilder::build(const clang::FunctionDecl *S, bool allowKerne
}

// ctor initializers
if (is_method) {
if (is_method && !is_builtin_type_method) {
if (auto lcType = db->FindOrAddType(methodThisType, S->getBeginLoc())) {
auto this_local = db->GetFunctionThis(builder);
if (auto Ctor = llvm::dyn_cast<clang::CXXConstructorDecl>(S)) {
Expand Down
2 changes: 1 addition & 1 deletion src/ext/EASTL
Submodule EASTL updated 1 files
+1 −1 packages/mimalloc
2 changes: 1 addition & 1 deletion src/ext/imgui
2 changes: 1 addition & 1 deletion src/ext/xxHash

0 comments on commit e8bc6e8

Please sign in to comment.