build: update llvm to 21.1.4 (#292)

This commit is contained in:
ykiko
2025-11-02 22:23:11 +08:00
committed by GitHub
parent 3b1e379408
commit 397eb71dad
18 changed files with 154 additions and 115 deletions

View File

@@ -45,7 +45,14 @@ public:
}
lookup_result lookup(const clang::DependentTemplateSpecializationType* type) {
return lookup(type->getQualifier(), type->getIdentifier());
auto& template_name = type->getDependentTemplateName();
auto identifier = template_name.getName().getIdentifier();
if(identifier) {
return lookup(template_name.getQualifier(), identifier);
} else {
/// FIXME: Operators does't have a name.
return {};
}
}
lookup_result lookup(const clang::DependentScopeDeclRefExpr* expr) {

View File

@@ -627,7 +627,6 @@ public:
}
case clang::NestedNameSpecifier::TypeSpec:
case clang::NestedNameSpecifier::TypeSpecWithTemplate:
case clang::NestedNameSpecifier::Global:
case clang::NestedNameSpecifier::Super: {
break;

View File

@@ -75,7 +75,8 @@ struct Diagnostic {
/// The error message of this diagnostic.
std::string message;
static DiagnosticCollector* create(std::shared_ptr<std::vector<Diagnostic>> diagnostics);
static std::unique_ptr<DiagnosticCollector>
create(std::shared_ptr<std::vector<Diagnostic>> diagnostics);
};
} // namespace clice

View File

@@ -39,15 +39,15 @@ using namespace llvm::sys::fs;
inline std::string resource_dir = "";
inline std::expected<void, std::error_code> init_resource_dir(llvm::StringRef execute) {
inline std::expected<void, std::string> init_resource_dir(llvm::StringRef execute) {
llvm::SmallString<128> path;
path::append(path, path::parent_path(execute), "..");
path::append(path, "lib", "clang", "20");
path::append(path, "lib", "clang", "21");
if(auto error = real_path(path, path)) {
return std::unexpected(error);
return std::unexpected(std::format("{}:{}", error, path.str()));
}
resource_dir = path.str();
return std::expected<void, std::error_code>();
return std::expected<void, std::string>();
}
inline std::expected<std::string, std::error_code> createTemporaryFile(llvm::StringRef prefix,