Skip to content

Commit

Permalink
ci: update LLVM to 5b959310
Browse files Browse the repository at this point in the history
  • Loading branch information
alandefreitas committed Apr 4, 2024
1 parent ab43756 commit 62793c4
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 61 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=29b20829cc6ce3e6d9c3809164994c1659e0da56" >> $GITHUB_OUTPUT
echo -E "llvm-hash=5b959310b0fae723bd119ed8815bf1cb1a8c67d4" >> $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 29b20829cc6ce3e6d9c3809164994c1659e0da56
git checkout 5b959310b0fae723bd119ed8815bf1cb1a8c67d4
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/29b20829cc6ce3e6d9c3809164994c1659e0da56[29b20829]
It depends on a recent version of LLVM: https://github.com/llvm/llvm-project/tree/5b959310b0fae723bd119ed8815bf1cb1a8c67d4[5b959310]

**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 29b20829cc6ce3e6d9c3809164994c1659e0da56 <.>
git fetch --depth 1 origin 5b959310b0fae723bd119ed8815bf1cb1a8c67d4 <.>
git checkout FETCH_HEAD <.>
----

Expand Down
4 changes: 2 additions & 2 deletions include/mrdocs/Support/ThreadPool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <vector>

namespace llvm {
class ThreadPool;
class StdThreadPool;
class ThreadPoolTaskGroup;
} // llvm

Expand All @@ -37,7 +37,7 @@ class TaskGroup;
class MRDOCS_VISIBLE
ThreadPool
{
std::unique_ptr<llvm::ThreadPool> impl_;
std::unique_ptr<llvm::StdThreadPool> impl_;

friend class TaskGroup;

Expand Down
4 changes: 1 addition & 3 deletions src/lib/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,6 @@ class ASTVisitor
// if an empty string is returned
std::string_view file_path =
file->tryGetRealPathName();
if(file_path.empty())
file_path = file->getName();
files_.emplace(file,
getFileInfo(search_dirs,
normalize_path(file_path, false),
Expand Down Expand Up @@ -1940,7 +1938,7 @@ class ASTVisitor
{
I.specs0.isVirtual |= D->isVirtual();
I.specs0.isVirtualAsWritten |= D->isVirtualAsWritten();
I.specs0.isPure |= D->isPure();
I.specs0.isPure |= D->isPureVirtual();
I.specs0.isConst |= D->isConst();
I.specs0.isVolatile |= D->isVolatile();
I.specs0.refQualifier |=
Expand Down
8 changes: 4 additions & 4 deletions src/lib/AST/ASTVisitorHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ convertToRecordKeyKind(
using NewKind = RecordKeyKind;
switch(kind)
{
case OldKind::TTK_Struct: return NewKind::Struct;
case OldKind::TTK_Class: return NewKind::Class;
case OldKind::TTK_Union: return NewKind::Union;
case OldKind::Struct: return NewKind::Struct;
case OldKind::Class: return NewKind::Class;
case OldKind::Union: return NewKind::Union;
default:
// unsupported TagTypeKind
// unsupported TagTypeKind (Interface, or Enum)
MRDOCS_UNREACHABLE();
}
}
Expand Down
26 changes: 13 additions & 13 deletions src/lib/AST/ParseJavadoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ parseHTMLTag(HTMLStartTagComment const* C)
auto const tagEndIt =
requiresEndTag ? std::ranges::find_if(it_ + 1, end_, [](Comment const* c)
{
return c->getCommentKind() == Comment::HTMLEndTagCommentKind;
return c->getCommentKind() == CommentKind::HTMLEndTagComment;
}) : it_;
if (tagEndIt == end_)
{
Expand All @@ -512,7 +512,7 @@ parseHTMLTag(HTMLStartTagComment const* C)
// Check if all the siblings are text nodes
bool const areAllText = std::all_of(it_ + 1, tagEndIt, [](Comment const* c)
{
return c->getCommentKind() == Comment::TextCommentKind;
return c->getCommentKind() == CommentKind::TextComment;
});
if (!areAllText)
{
Expand Down Expand Up @@ -625,18 +625,18 @@ convertCopydoc(unsigned id)

static
doc::Style
convertStyle(InlineCommandComment::RenderKind kind)
convertStyle(InlineCommandRenderKind kind)
{
switch(kind)
{
case InlineCommandComment::RenderKind::RenderMonospaced:
case InlineCommandRenderKind::Monospaced:
return doc::Style::mono;
case InlineCommandComment::RenderKind::RenderBold:
case InlineCommandRenderKind::Bold:
return doc::Style::bold;
case InlineCommandComment::RenderKind::RenderEmphasized:
case InlineCommandRenderKind::Emphasized:
return doc::Style::italic;
case InlineCommandComment::RenderKind::RenderNormal:
case InlineCommandComment::RenderKind::RenderAnchor:
case InlineCommandRenderKind::Normal:
case InlineCommandRenderKind::Anchor:
return doc::Style::none;
default:
// unknown RenderKind
Expand All @@ -646,15 +646,15 @@ convertStyle(InlineCommandComment::RenderKind kind)

static
doc::ParamDirection
convertDirection(ParamCommandComment::PassDirection kind)
convertDirection(ParamCommandPassDirection kind)
{
switch(kind)
{
case ParamCommandComment::PassDirection::In:
case ParamCommandPassDirection::In:
return doc::ParamDirection::in;
case ParamCommandComment::PassDirection::Out:
case ParamCommandPassDirection::Out:
return doc::ParamDirection::out;
case ParamCommandComment::PassDirection::InOut:
case ParamCommandPassDirection::InOut:
return doc::ParamDirection::inout;
default:
MRDOCS_UNREACHABLE();
Expand Down Expand Up @@ -808,7 +808,7 @@ visitInlineCommandComment(
break;
}
auto const* c = *it_;
if (c->getCommentKind() == Comment::TextCommentKind)
if (c->getCommentKind() == CommentKind::TextComment)
{
ref += static_cast<TextComment const*>(c)->getText();
}
Expand Down
6 changes: 2 additions & 4 deletions src/lib/Lib/MrDocsCompilationDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ isValidMrDocsOption(std::unique_ptr<llvm::opt::Arg> const &arg)
arg->getOption().getUnaliasedOption();

if (optionMatchesAny(opt,
// unknown options
// unknown options
driver::options::OPT_UNKNOWN,

// sanitizers
// sanitizers
driver::options::OPT_fsanitize_EQ,
driver::options::OPT_fno_sanitize_EQ,
driver::options::OPT_fsanitize_recover_EQ,
Expand All @@ -85,7 +85,6 @@ isValidMrDocsOption(std::unique_ptr<llvm::opt::Arg> const &arg)
driver::options::OPT_fno_sanitize_address_use_after_scope,
driver::options::OPT_fno_sanitize_address_use_odr_indicator,
driver::options::OPT__SLASH_fno_sanitize_address_vcasan_lib,
driver::options::OPT_anonymous_513,
driver::options::OPT_fno_sanitize_cfi_canonical_jump_tables,
driver::options::OPT_fno_sanitize_cfi_cross_dso,
driver::options::OPT_fno_sanitize_coverage,
Expand Down Expand Up @@ -117,7 +116,6 @@ isValidMrDocsOption(std::unique_ptr<llvm::opt::Arg> const &arg)
driver::options::OPT__SLASH_fsanitize_address_use_after_return,
driver::options::OPT_fsanitize_address_use_after_scope,
driver::options::OPT_fsanitize_address_use_odr_indicator,
driver::options::OPT_anonymous_512,
driver::options::OPT_fsanitize_cfi_canonical_jump_tables,
driver::options::OPT_fsanitize_cfi_cross_dso,
driver::options::OPT_fsanitize_cfi_icall_normalize_integers,
Expand Down
15 changes: 5 additions & 10 deletions src/lib/Support/ThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// Official repository: https://github.com/cppalliance/mrdocs
//

#include "lib/Support/Debug.hpp"
#include <mrdocs/Support/Error.hpp>
#include <mrdocs/Support/ThreadPool.hpp>
#include <llvm/Support/Signals.h>
Expand All @@ -27,9 +26,7 @@ namespace mrdocs {
//------------------------------------------------

ThreadPool::
~ThreadPool()
{
}
~ThreadPool() = default;

ThreadPool::
ThreadPool() = default;
Expand All @@ -43,7 +40,7 @@ ThreadPool(
llvm::ThreadPoolStrategy S;
S.ThreadsRequested = concurrency;
S.Limit = true;
impl_ = std::make_unique<llvm::ThreadPool>(S);
impl_ = std::make_unique<llvm::StdThreadPool>(S);
}
}

Expand All @@ -52,7 +49,7 @@ ThreadPool::
getThreadCount() const noexcept
{
if(impl_)
return impl_->getThreadCount();
return impl_->getMaxConcurrency();
return 1;
}

Expand Down Expand Up @@ -101,7 +98,7 @@ struct TaskGroup::

explicit
Impl(
llvm::ThreadPool* threadPool)
llvm::StdThreadPool* threadPool)
: taskGroup(threadPool
? std::make_unique<
llvm::ThreadPoolTaskGroup>(*threadPool)
Expand All @@ -111,9 +108,7 @@ struct TaskGroup::
};

TaskGroup::
~TaskGroup()
{
}
~TaskGroup() = default;

TaskGroup::
TaskGroup(
Expand Down
48 changes: 27 additions & 21 deletions test-files/old-tests/namespace.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,10 @@
<file path="namespace.cpp" line="12"/>
</function>
</namespace>
<namespace id="g8xS0yWD4HcXEKd0Legcg56VOsg=" is-anonymous="1">
<function name="f3" id="cg00N9kMKuqEA8yozUxpgawmf1w=">
<namespace id="QFsBClaDSL1ON+ZrDqoAhkZkIVE=" is-anonymous="1">
<function name="f3" id="0wxfCHJiD3XMfQnSI2NiRruFzmU=">
<file path="namespace.cpp" line="17"/>
</function>
<function name="f8" id="DySJ4/Mh2WNuu9mIEcqNSCSDJYk=">
<file path="namespace.cpp" line="37"/>
</function>
<function name="f10" id="JFdBEye4uXzw0ilTytFZ8c1sSbg=">
<file path="namespace.cpp" line="43"/>
</function>
<namespace name="G" id="Wst/dadHi6Smk6pSpSEAkzhH8+M=">
<function name="f11" id="Hbja2CeJ1Aik0Wvl2z2Ywjfvz3Y=">
<file path="namespace.cpp" line="47"/>
</function>
</namespace>
<namespace name="H" id="0bLp2uJCrLh6KF6tdyR+5EFm3JA=" is-inline="1">
<function name="f12" id="emiOGg7QaKWV17XaWH2S5DJ+vL0=">
<file path="namespace.cpp" line="52"/>
</function>
</namespace>
<function name="f14" id="nNa4hlu4nXFlhTbAMLUSo8W55Dc=">
<file path="namespace.cpp" line="67"/>
</function>
</namespace>
</namespace>
<namespace name="D" id="ZzEKHnfY4xmz/e4XegZ+zBdBnKE=" is-inline="1">
Expand All @@ -55,8 +36,33 @@
<file path="namespace.cpp" line="32"/>
</function>
</namespace>
<namespace id="aPdRmNGWxbyYECtLNnl/MSIJQxc=" is-anonymous="1">
<function name="f8" id="8ddwiGlSyG3c3BJDcb/ZigMDMJU=">
<file path="namespace.cpp" line="37"/>
</function>
</namespace>
</namespace>
<namespace id="g8xS0yWD4HcXEKd0Legcg56VOsg=" is-anonymous="1">
<function name="f10" id="JFdBEye4uXzw0ilTytFZ8c1sSbg=">
<file path="namespace.cpp" line="43"/>
</function>
<namespace name="G" id="Wst/dadHi6Smk6pSpSEAkzhH8+M=">
<function name="f11" id="Hbja2CeJ1Aik0Wvl2z2Ywjfvz3Y=">
<file path="namespace.cpp" line="47"/>
</function>
</namespace>
<namespace name="H" id="0bLp2uJCrLh6KF6tdyR+5EFm3JA=" is-inline="1">
<function name="f12" id="emiOGg7QaKWV17XaWH2S5DJ+vL0=">
<file path="namespace.cpp" line="52"/>
</function>
</namespace>
</namespace>
<namespace name="I" id="+dTV+2puUwO4arfDuNZCVAzk0M0=">
<namespace id="5qwv23b0kUmpB/nx6C7H81pMcW8=" is-anonymous="1" is-inline="1">
<function name="f14" id="Wk/88w4XwQou7iSEOBQAnlcQ1ys=">
<file path="namespace.cpp" line="67"/>
</function>
</namespace>
</namespace>
</namespace>
</mrdocs>

0 comments on commit 62793c4

Please sign in to comment.