Skip to content

Commit

Permalink
refactor sources
Browse files Browse the repository at this point in the history
  • Loading branch information
vinniefalco committed Apr 15, 2023
1 parent 778861b commit 13adee3
Show file tree
Hide file tree
Showing 38 changed files with 92 additions and 64 deletions.
2 changes: 1 addition & 1 deletion include/mrdox/meta/Types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace mrdox {
A USRs is a string that provide an unambiguous
reference to a symbol.
*/
using SymbolID = std::array<uint8_t, 20>;
using SymbolID = std::array<unsigned char, 20>;

// Empty SymbolID for comparison, so we don't have to construct one every time.
inline SymbolID const EmptySID = SymbolID();
Expand Down
4 changes: 2 additions & 2 deletions source/lib/ClangDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// FrontendActionFactory.
//

#include "ClangDoc.h"
#include "Visitor.hpp"
#include "ClangDoc.hpp"
#include "ast/Visitor.hpp"
#include <clang/Frontend/CompilerInstance.h>
#include <clang/Frontend/FrontendAction.h>

Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions source/lib/Corpus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
// Official repository: https://github.com/cppalliance/mrdox
//

#include "BitcodeReader.h"
#include "BitcodeWriter.h"
#include "ClangDoc.h"
#include "Reduce.h"
#include "Serialize.h"
#include "ClangDoc.hpp"
#include "ast/BitcodeReader.hpp"
#include "ast/BitcodeWriter.hpp"
#include "ast/Serialize.hpp"
#include "meta/Reduce.hpp"
#include <mrdox/Corpus.hpp>
#include <mrdox/Error.hpp>
#include <mrdox/Metadata.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Official repository: https://github.com/cppalliance/mrdox
//

#include "BitcodeReader.h"
#include "BitcodeReader.hpp"
#include <mrdox/Error.hpp>
#include <mrdox/Metadata.hpp>
#include <llvm/ADT/IndexedMap.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEREADER_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEREADER_H

#include "BitcodeWriter.h"
#include "BitcodeWriter.hpp"
#include <clang/AST/AST.h>
#include <llvm/ADT/SmallVector.h>
#include <llvm/Bitstream/BitstreamReader.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
// Official repository: https://github.com/cppalliance/mrdox
//

#include "BitcodeWriter.h"
#include "BitcodeWriter.hpp"
#include <mrdox/Metadata.hpp>
#include "llvm/ADT/IndexedMap.h"
#include <llvm/ADT/IndexedMap.h>
#include <initializer_list>

namespace clang {
Expand Down
10 changes: 5 additions & 5 deletions source/lib/BitcodeWriter.h → source/lib/ast/BitcodeWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEWRITER_H

#include <mrdox/MetadataFwd.hpp>
#include "clang/AST/AST.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Bitstream/BitstreamWriter.h"
#include <clang/AST/AST.h>
#include <llvm/ADT/DenseMap.h>
#include <llvm/ADT/SmallVector.h>
#include <llvm/ADT/StringRef.h>
#include <llvm/Bitstream/BitstreamWriter.h>
#include <initializer_list>
#include <vector>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,10 @@
// Official repository: https://github.com/cppalliance/mrdox
//

#include "CommentVisitor.h"
#include "CommentVisitor.hpp"
#include "clangASTComment.hpp"
#include <mrdox/Reporter.hpp>
#include <mrdox/meta/Javadoc.hpp>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 5054) // C5054: operator '+': deprecated between enumerations of different types
#endif
#include <clang/AST/Comment.h>
#include <clang/AST/CommentVisitor.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
//#include <clang/AST/CommentCommandInfo.inc>

namespace clang {
namespace mrdox {
Expand Down
File renamed without changes.
26 changes: 9 additions & 17 deletions source/lib/Serialize.cpp → source/lib/ast/Serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,16 @@
// Official repository: https://github.com/cppalliance/mrdox
//

#include "Serialize.h"
#include "CommentVisitor.h"
#include "BitcodeWriter.h"
#include "Serialize.hpp"
#include "CommentVisitor.hpp"
#include "BitcodeWriter.hpp"
#include <mrdox/Metadata.hpp>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 5054) // C5054: operator '+': deprecated between enumerations of different types
#include <clang/AST/Comment.h>
#pragma warning(pop)
#endif
#include "clang/Index/USRGeneration.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/SHA1.h"

#include "base64.hpp"
#include <clang/Index/USRGeneration.h>
#include <clang/Lex/Lexer.h>
#include <llvm/ADT/Hashing.h>
#include <llvm/ADT/StringExtras.h>
#include <llvm/Support/Path.h>
#include <llvm/Support/SHA1.h>

using clang::comments::FullComment;

Expand Down
File renamed without changes.
11 changes: 3 additions & 8 deletions source/lib/Visitor.cpp → source/lib/ast/Visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@
// Official repository: https://github.com/cppalliance/mrdox
//

#include "BitcodeWriter.h"
#include "Serialize.h"
#include "BitcodeWriter.hpp"
#include "Serialize.hpp"
#include "utility.hpp"
#include "Visitor.hpp"
//#include "ast/clangASTComment.hpp"
#include <mrdox/Corpus.hpp>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 5054) // C5054: operator '+': deprecated between enumerations of different types
#include <clang/AST/Comment.h>
#pragma warning(pop)
#endif
#include <clang/Index/USRGeneration.h>
#include <llvm/ADT/StringExtras.h>
#include <llvm/Support/Error.h>
Expand Down
File renamed without changes.
30 changes: 30 additions & 0 deletions source/lib/ast/clangASTComment.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// This is a derivative work. originally part of the LLVM Project.
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// Copyright (c) 2023 Vinnie Falco ([email protected])
//
// Official repository: https://github.com/cppalliance/mrdox
//

// This is a workaround for the annoying
// warning in the current trunk of llvm

#ifndef MRDOX_SOURCE_AST_CLANGASTCOMMENT_HPP
#define MRDOX_SOURCE_AST_CLANGASTCOMMENT_HPP

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 5054) // C5054: operator '+': deprecated between enumerations of different types
#endif

#include <clang/AST/Comment.h>
#include <clang/AST/CommentVisitor.h>

#ifdef _MSC_VER
#pragma warning(pop)
#endif

#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Official repository: https://github.com/cppalliance/mrdox
//

#include <mrdox/Generator.hpp>
#include <mrdox/format/Generator.hpp>
#include <llvm/Support/FileSystem.h>
#include <llvm/Support/Path.h>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions source/lib/Info.cpp → source/lib/meta/Info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// Official repository: https://github.com/cppalliance/mrdox
//

#include <mrdox/Info.hpp>
#include <mrdox/Record.hpp>
#include <mrdox/meta/Info.hpp>
#include <mrdox/meta/Record.hpp>
#include <clang/AST/Type.h>
#include <llvm/ADT/STLExtras.h>
#include <llvm/Support/FileSystem.h>
Expand Down
4 changes: 2 additions & 2 deletions source/lib/Javadoc.cpp → source/lib/meta/Javadoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <mrdox/meta/Javadoc.hpp>
#include <mrdox/meta/Namespace.hpp>
#include <mrdox/Config.hpp>
#include "llvm/Support/Error.h"
#include "llvm/Support/Path.h"
#include <llvm/Support/Error.h>
#include <llvm/Support/Path.h>

namespace clang {
namespace mrdox {
Expand Down
6 changes: 3 additions & 3 deletions source/lib/Namespace.cpp → source/lib/meta/Namespace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
// Official repository: https://github.com/cppalliance/mrdox
//

#include "Reduce.h"
#include "Reduce.hpp"
#include <mrdox/meta/Namespace.hpp>
#include <mrdox/Config.hpp>
#include "llvm/Support/Error.h"
#include "llvm/Support/Path.h"
#include <llvm/Support/Error.h>
#include <llvm/Support/Path.h>

namespace clang {
namespace mrdox {
Expand Down
2 changes: 1 addition & 1 deletion source/lib/Record.cpp → source/lib/meta/Record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Official repository: https://github.com/cppalliance/mrdox
//

#include "Reduce.h"
#include "Reduce.hpp"
#include <mrdox/meta/Record.hpp>
#include <cassert>
#include <utility>
Expand Down
4 changes: 2 additions & 2 deletions source/lib/Reduce.h → source/lib/meta/Reduce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// Official repository: https://github.com/cppalliance/mrdox
//

#ifndef MRDOX_REDUCE_HPP
#define MRDOX_REDUCE_HPP
#ifndef MRDOX_SOURCE_META_REDUCE_HPP
#define MRDOX_SOURCE_META_REDUCE_HPP

#include <mrdox/meta/Info.hpp>
#include <llvm/Support/Error.h>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions source/lib/meta/Types.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// This is a derivative work. originally part of the LLVM Project.
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// Copyright (c) 2023 Vinnie Falco ([email protected])
//
// Official repository: https://github.com/cppalliance/mrdox
//

#include <mrdox/meta/Types.hpp>

namespace clang {
namespace mrdox {

static_assert(CHAR_BIT == 8);

} // mrdox
} // clang

0 comments on commit 13adee3

Please sign in to comment.