File tree Expand file tree Collapse file tree 6 files changed +171
-97
lines changed Expand file tree Collapse file tree 6 files changed +171
-97
lines changed Original file line number Diff line number Diff line change
1
+ //
2
+ // This is a derivative work. originally part of the LLVM Project.
3
+ // Licensed under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ // Copyright (c) 2023 Vinnie Falco ([email protected] )
8
+ //
9
+ // Official repository: https://github.com/cppalliance/mrdox
10
+ //
11
+
12
+ #ifndef MRDOX_ERROR_HPP
13
+ #define MRDOX_ERROR_HPP
14
+
15
+ #include < llvm/ADT/StringRef.h>
16
+ #include < llvm/Support/Error.h>
17
+ #include < source_location>
18
+
19
+ namespace clang {
20
+ namespace mrdox {
21
+
22
+ /* * Return an Error for the given text and source location.
23
+ */
24
+ [[nodiscard]]
25
+ llvm::Error
26
+ makeError (
27
+ llvm::StringRef what,
28
+ std::source_location loc =
29
+ std::source_location::current ());
30
+
31
+ } // mrdox
32
+ } // clang
33
+
34
+ #endif
Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ struct Reporter
46
46
return EXIT_FAILURE;
47
47
}
48
48
49
+ /* * Report a non-successful Error
50
+ */
51
+ void
52
+ failed (llvm::Error&& err);
53
+
49
54
/* * Report the failure of an action.
50
55
51
56
@param action The operation which failed.
@@ -102,6 +107,11 @@ struct Reporter
102
107
llvm::errs () << s << ' \n ' ;
103
108
}
104
109
110
+ static
111
+ llvm::StringRef
112
+ makeString (
113
+ std::source_location const & loc);
114
+
105
115
private:
106
116
/* * Return a string formatted from arguments.
107
117
@@ -186,10 +196,6 @@ struct Reporter
186
196
os << makeString (loc);
187
197
}
188
198
189
- llvm::StringRef
190
- makeString (
191
- std::source_location const & loc) const ;
192
-
193
199
private:
194
200
llvm::sys::Mutex mutable m_;
195
201
bool failed_ = false ;
You can’t perform that action at this time.
0 commit comments