Skip to content

Commit bae9c52

Browse files
committed
squelch unused private members
1 parent 8343333 commit bae9c52

File tree

4 files changed

+45
-37
lines changed

4 files changed

+45
-37
lines changed

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON CACHE STRING "")
3333
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON CACHE STRING "")
3434
option(MRDOX_BUILD_TESTS "Build tests" ON)
3535

36+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
37+
set(MRDOX_GCC ON)
38+
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
39+
set(MRDOX_CLANG ON)
40+
endif()
41+
3642
#-------------------------------------------------
3743
#
3844
# Dependencies
@@ -114,6 +120,13 @@ if (WIN32)
114120
endif()
115121
endif ()
116122

123+
if (MRDOX_CLANG)
124+
target_compile_options(
125+
mrdox_lib
126+
PUBLIC
127+
-Wno-unused-private-field)
128+
endif ()
129+
117130
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES CMakeLists.txt)
118131
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/mrdox PREFIX "include" FILES ${LIB_INCLUDES})
119132
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/source/lib PREFIX "source" FILES ${LIB_SOURCES})

include/mrdox/Corpus.hpp

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,33 @@ class Corpus
4747
std::vector<SymbolID> allSymbols;
4848

4949
public:
50+
//--------------------------------------------
51+
//
52+
// Static Functions
53+
//
54+
//--------------------------------------------
55+
56+
/** Store the Info in the tool results, keyed by SymbolID.
57+
*/
58+
static
59+
void
60+
reportResult(
61+
tooling::ExecutionContext& exc,
62+
Info const& I);
63+
64+
/** Build the intermediate representation of the code being documented.
65+
66+
@par R The diagnostic reporting object to
67+
use for delivering errors and information.
68+
*/
69+
[[nodiscard]]
70+
static
71+
std::unique_ptr<Corpus>
72+
build(
73+
tooling::ToolExecutor& ex,
74+
Config const& config,
75+
Reporter& R);
76+
5077
//--------------------------------------------
5178
//
5279
// Observers
@@ -102,9 +129,11 @@ class Corpus
102129
return *p;
103130
}
104131

132+
//--------------------------------------------
105133
//
106134
// Modifiers
107135
//
136+
//--------------------------------------------
108137

109138
/** Canonicalize the contents of the object.
110139
@@ -117,12 +146,13 @@ class Corpus
117146
bool
118147
canonicalize(Reporter& R);
119148

149+
private:
120150
//--------------------------------------------
121151
//
122152
// Implementation
123153
//
124154
//--------------------------------------------
125-
private:
155+
126156
/** Insert this element and all its children into the Corpus.
127157
128158
@par Thread Safety
@@ -137,33 +167,6 @@ class Corpus
137167
*/
138168
void insertIntoIndex(Info const& I);
139169

140-
//--------------------------------------------
141-
//
142-
// Static Functions
143-
//
144-
//--------------------------------------------
145-
public:
146-
/** Store the Info in the tool results, keyed by SymbolID.
147-
*/
148-
static
149-
void
150-
reportResult(
151-
tooling::ExecutionContext& exc,
152-
Info const& I);
153-
154-
/** Build the intermediate representation of the code being documented.
155-
156-
@par R The diagnostic reporting object to
157-
use for delivering errors and information.
158-
*/
159-
[[nodiscard]]
160-
static
161-
std::unique_ptr<Corpus>
162-
build(
163-
tooling::ToolExecutor& ex,
164-
Config const& config,
165-
Reporter& R);
166-
167170
private:
168171
Corpus() = default;
169172

source/lib/Asciidoc.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,6 @@ toString(TagTypeKind k) noexcept
430430
case TagTypeKind::TTK_Union: return "union";
431431
case TagTypeKind::TTK_Class: return "class";
432432
case TagTypeKind::TTK_Enum: return "enum";
433-
default:
434-
llvm_unreachable("unknown TagTypeKind");
435433
}
436434
}
437435

source/lib/Corpus.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,10 @@ build(
189189
R.first->second.emplace_back(Value);
190190
});
191191

192-
// Collects all Infos according to their unique
193-
// USR value. This map is added to from the thread
194-
// pool below and is protected by this mutex.
195-
llvm::sys::Mutex USRToInfoMutex;
196-
197192
// First reducing phase (reduce all decls into one info per decl).
198193
llvm::outs() << "Reducing " << USRToBitcode.size() << " declarations\n";
199194
std::atomic<bool> GotFailure;
200195
GotFailure = false;
201-
llvm::sys::Mutex IndexMutex;
202196
// VFALCO Should this concurrency be a command line option?
203197
llvm::ThreadPool Pool(llvm::hardware_concurrency(tooling::ExecutorConcurrency));
204198
for (auto& Group : USRToBitcode)
@@ -276,7 +270,7 @@ build(
276270
});
277271
}
278272

279-
return std::move(up);
273+
return up;
280274
}
281275

282276
} // mrdox

0 commit comments

Comments
 (0)