Skip to content

Commit f1d1690

Browse files
committed
use llvm::Optional
1 parent 5b58fcf commit f1d1690

File tree

10 files changed

+17
-18
lines changed

10 files changed

+17
-18
lines changed

include/mrdox/Config.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "Representation.h"
1717
#include <clang/Tooling/ArgumentsAdjusters.h>
1818
#include <clang/Tooling/Execution.h>
19+
#include <llvm/ADT/Optional.h>
1920
#include <llvm/ADT/SmallVector.h>
2021
#include <llvm/ADT/StringRef.h>
2122
#include <memory>
@@ -55,7 +56,7 @@ struct Config
5556

5657
// URL of repository that hosts code used
5758
// for links to definition locations.
58-
std::optional<std::string> RepositoryUrl;
59+
llvm::Optional<std::string> RepositoryUrl;
5960

6061
bool IgnoreMappingFailures = false;
6162

source/lib/BitcodeReader.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "llvm/ADT/IndexedMap.h"
1414
#include "llvm/Support/Error.h"
1515
#include "llvm/Support/raw_ostream.h"
16-
#include <optional>
1716

1817
namespace clang {
1918
namespace mrdox {

source/lib/BitcodeReader.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include "llvm/ADT/SmallVector.h"
2525
#include "llvm/Bitstream/BitstreamReader.h"
2626
#include "llvm/Support/Error.h"
27-
#include <optional>
2827

2928
namespace clang {
3029
namespace mrdox {

source/lib/Representation.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include <llvm/ADT/SmallVector.h>
3636
#include <llvm/ADT/StringExtras.h>
3737
#include <array>
38-
#include <optional>
3938
#include <string>
4039
#include <vector>
4140

source/lib/jad/Enum.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919

2020
#include "jad/Symbol.hpp"
2121
#include "jad/Type.hpp"
22+
#include <llvm/ADT/Optional.h>
2223
#include <llvm/ADT/SmallString.h>
2324
#include <llvm/ADT/SmallVector.h>
2425
#include <llvm/ADT/StringRef.h>
25-
#include <optional>
2626
#include <utility>
2727

2828
namespace clang {
@@ -85,7 +85,7 @@ struct EnumInfo : SymbolInfo
8585
// Set to nonempty to the type when this is an explicitly typed enum. For
8686
// enum Foo : short { ... };
8787
// this will be "short".
88-
std::optional<TypeInfo> BaseType;
88+
llvm::Optional<TypeInfo> BaseType;
8989

9090
llvm::SmallVector<EnumValueInfo, 4> Members; // List of enum members.
9191
};

source/lib/jad/Function.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
#include "jad/Template.hpp"
2020
#include "jad/Types.hpp"
2121
#include <clang/Basic/Specifiers.h>
22+
#include <llvm/ADT/Optional.h>
2223
#include <llvm/ADT/SmallString.h>
2324
#include <llvm/ADT/SmallVector.h>
24-
#include <optional>
2525
#include <vector>
2626

2727
namespace clang {
@@ -58,7 +58,7 @@ struct FunctionInfo : SymbolInfo
5858
SmallString<16> FullName;
5959

6060
// When present, this function is a template or specialization.
61-
std::optional<TemplateInfo> Template;
61+
llvm::Optional<TemplateInfo> Template;
6262
};
6363

6464
/// A list of zero or more functions

source/lib/jad/Index.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
#include "jad/Info.hpp"
1616
#include "jad/Reference.hpp"
17+
#include <llvm/ADT/Optional.h>
1718
#include <llvm/ADT/SmallString.h>
1819
#include <llvm/ADT/StringRef.h>
1920
#include <llvm/Support/Error.h>
20-
#include <optional>
2121
#include <vector>
2222

2323
namespace clang {
@@ -58,7 +58,7 @@ struct Index : Reference
5858

5959
bool operator<(const Index& Other) const;
6060

61-
std::optional<llvm::SmallString<16>> JumpToSection;
61+
llvm::Optional<llvm::SmallString<16>> JumpToSection;
6262
std::vector<Index> Children;
6363

6464
void sort();

source/lib/jad/Record.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include "jad/Template.hpp"
2121
#include "jad/Types.hpp"
2222
#include <clang/AST/Type.h>
23+
#include <llvm/ADT/Optional.h>
2324
#include <llvm/ADT/SmallVector.h>
24-
#include <optional>
2525
#include <vector>
2626

2727
namespace clang {
@@ -49,7 +49,7 @@ struct RecordInfo : SymbolInfo
4949
llvm::SmallString<16> FullName;
5050

5151
// When present, this record is a template or specialization.
52-
std::optional<TemplateInfo> Template;
52+
llvm::Optional<TemplateInfo> Template;
5353

5454
// Indicates if the record was declared using a typedef. Things like anonymous
5555
// structs in a typedef:

source/lib/jad/Template.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#define MRDOX_JAD_TEMPLATE_HPP
1414

1515
#include "jad/TemplateParam.hpp"
16+
#include <llvm/ADT/Optional.h>
1617

1718
namespace clang {
1819
namespace mrdox {
@@ -34,7 +35,7 @@ struct TemplateInfo
3435
std::vector<TemplateParamInfo> Params;
3536

3637
// Set when this is a specialization of another record/function.
37-
std::optional<TemplateSpecializationInfo> Specialization;
38+
llvm::Optional<TemplateSpecializationInfo> Specialization;
3839
};
3940

4041
} // mrdox

source/lib/jad/TemplateParams.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
#include <clang/Basic/Specifiers.h>
3131
#include <clang/Tooling/StandaloneExecution.h>
3232
#include <llvm/ADT/APSInt.h>
33+
#include <llvm/ADT/Optional.h>
3334
#include <llvm/ADT/SmallVector.h>
3435
#include <llvm/ADT/StringExtras.h>
3536
#include <array>
36-
#include <optional>
3737
#include <string>
3838
#include <vector>
3939

@@ -108,7 +108,7 @@ struct TemplateInfo {
108108
std::vector<TemplateParamInfo> Params;
109109

110110
// Set when this is a specialization of another record/function.
111-
std::optional<TemplateSpecializationInfo> Specialization;
111+
llvm::Optional<TemplateSpecializationInfo> Specialization;
112112
};
113113

114114
// Info for field types.
@@ -187,7 +187,7 @@ struct FunctionInfo : public SymbolInfo {
187187
SmallString<16> FullName;
188188

189189
// When present, this function is a template or specialization.
190-
std::optional<TemplateInfo> Template;
190+
llvm::Optional<TemplateInfo> Template;
191191
};
192192

193193
// TODO: Expand to allow for documenting templating, inheritance access,
@@ -209,7 +209,7 @@ struct RecordInfo
209209
SmallString<16> FullName;
210210

211211
// When present, this record is a template or specialization.
212-
std::optional<TemplateInfo> Template;
212+
llvm::Optional<TemplateInfo> Template;
213213

214214
// Indicates if the record was declared using a typedef. Things like anonymous
215215
// structs in a typedef:
@@ -304,7 +304,7 @@ struct EnumInfo : public SymbolInfo {
304304
// Set to nonempty to the type when this is an explicitly typed enum. For
305305
// enum Foo : short { ... };
306306
// this will be "short".
307-
std::optional<TypeInfo> BaseType;
307+
llvm::Optional<TypeInfo> BaseType;
308308

309309
llvm::SmallVector<EnumValueInfo, 4> Members; // List of enum members.
310310
};

0 commit comments

Comments
 (0)