Skip to content

Commit

Permalink
chore: bump LLVM to 7a28a5b3
Browse files Browse the repository at this point in the history
  • Loading branch information
sdkrystian committed May 27, 2024
1 parent dd28523 commit 1e6e9ae
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
- name: LLVM Parameters
id: llvm-parameters
run: |
echo -E "llvm-hash=5b959310b0fae723bd119ed8815bf1cb1a8c67d4" >> $GITHUB_OUTPUT
echo -E "llvm-hash=7a28a5b3fee6c78ad59af79a3d03c00db153c49f" >> $GITHUB_OUTPUT
echo -E "llvm-build-preset=${{ runner.os == 'Windows' && 'release-win' || 'release-unix' }}" >> $GITHUB_OUTPUT
cd ..
llvm_root=$(pwd)/third-party/llvm-project/install
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Here are the instructions to install LLVM with the settings required by this pro
----
git clone https://github.com/llvm/llvm-project.git
cd llvm-project
git checkout 5b959310b0fae723bd119ed8815bf1cb1a8c67d4
git checkout 7a28a5b3fee6c78ad59af79a3d03c00db153c49f
cmake -S llvm -B build -D LLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -D CMAKE_BUILD_TYPE=Release -D LLVM_ENABLE_RTTI=ON -D CMAKE_INSTALL_PREFIX=/path/to/llvm+clang
cd build
cmake --build . -j <threads> --config Release
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/install.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ NOTE: These examples assume VcPkg is already installed in the `third-party/vcpkg
=== LLVM

MrDocs uses LLVM to parse C++ code and extract documentation from it.
It depends on a recent version of LLVM: https://github.com/llvm/llvm-project/tree/5b959310b0fae723bd119ed8815bf1cb1a8c67d4[5b959310]
It depends on a recent version of LLVM: https://github.com/llvm/llvm-project/tree/7a28a5b3fee6c78ad59af79a3d03c00db153c49f[7a28a5b3]

**Download**:

Expand All @@ -308,7 +308,7 @@ mkdir -p llvm-project <.>
cd llvm-project
git init <.>
git remote add origin https://github.com/llvm/llvm-project.git <.>
git fetch --depth 1 origin 5b959310b0fae723bd119ed8815bf1cb1a8c67d4 <.>
git fetch --depth 1 origin 7a28a5b3fee6c78ad59af79a3d03c00db153c49f <.>
git checkout FETCH_HEAD <.>
----

Expand Down
31 changes: 6 additions & 25 deletions src/lib/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,38 +1045,29 @@ class ASTVisitor
if(P->wasDeclaredWithTypename())
R->KeyKind = TParamKeyKind::Typename;
if(P->hasDefaultArgument())
{
QualType QT = P->getDefaultArgument();
R->Default = buildTemplateArg(
TemplateArgument(QT, QT.isNull(), true));
}
P->getDefaultArgument().getArgument());
return R;
}
else if constexpr(kind == Decl::NonTypeTemplateParm)
{
auto R = std::make_unique<NonTypeTParam>();
R->Type = buildTypeInfo(P->getType());
if(P->hasDefaultArgument())
{
R->Default = buildTemplateArg(
TemplateArgument(P->getDefaultArgument(), true));
}
P->getDefaultArgument().getArgument());
return R;
}
else if constexpr(kind == Decl::TemplateTemplateParm)
{
auto R = std::make_unique<TemplateTParam>();
for(const NamedDecl* NP : *P->getTemplateParameters())
{
R->Params.emplace_back(
buildTemplateParam(NP));
}

if(P->hasDefaultArgument())
{
R->Default = buildTemplateArg(
P->getDefaultArgument().getArgument());
}
return R;
}
MRDOCS_UNREACHABLE();
Expand Down Expand Up @@ -2641,13 +2632,8 @@ traverse(
if(auto* CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D))
{
extractSymbolID(getInstantiatedFrom(CTD), Template->Primary);
// KRYSTIAN NOTE: when this is a partial specialization, we could use
// ClassTemplatePartialSpecializationDecl::getTemplateArgsAsWritten
MRDOCS_ASSERT(CTSD->getTypeAsWritten());
const TypeSourceInfo* TSI = CTSD->getTypeAsWritten();
buildTemplateArgs(Template->Args, TSI->getType()->getAs<
TemplateSpecializationType>()->template_arguments());

// extract the template arguments of the specialization
buildTemplateArgs(Template->Args, CTSD->getTemplateArgsAsWritten());
// extract the template parameters if this is a partial specialization
if(auto* CTPSD = dyn_cast<ClassTemplatePartialSpecializationDecl>(D))
buildTemplateParams(*I.Template, CTPSD->getTemplateParameters());
Expand Down Expand Up @@ -2683,16 +2669,11 @@ traverse(
if(auto* VTSD = dyn_cast<VarTemplateSpecializationDecl>(D))
{
extractSymbolID(getInstantiatedFrom(VTD), Template->Primary);
const ASTTemplateArgumentListInfo* Args = VTSD->getTemplateArgsInfo();
// extract the template arguments of the specialization
buildTemplateArgs(Template->Args, VTSD->getTemplateArgsAsWritten());
// extract the template parameters if this is a partial specialization
if(auto* VTPSD = dyn_cast<VarTemplatePartialSpecializationDecl>(D))
{
// getTemplateArgsInfo returns nullptr for partial specializations,
// so we use getTemplateArgsAsWritten if this is a partial specialization
Args = VTPSD->getTemplateArgsAsWritten();
buildTemplateParams(*I.Template, VTPSD->getTemplateParameters());
}
buildTemplateArgs(Template->Args, Args);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Lib/ConfigImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ shouldVisitSymbol(
return true;
}
// Prefix match
if (filePath.startswith(p))
if (filePath.starts_with(p))
{
bool validPattern = std::ranges::any_of(
settings_.input.filePatterns,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Support/Yaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ diag(
break;
case llvm::SourceMgr::DiagKind::DK_Warning:
{
if(D.getMessage().startswith("unknown key "))
if(D.getMessage().starts_with("unknown key "))
{
// don't show these
return;
Expand Down

0 comments on commit 1e6e9ae

Please sign in to comment.