aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index 60e103e..1ea4a2e 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -403,8 +403,7 @@ public:
}
private:
- static std::optional<std::string>
- toString(CodeSynthesisContext::SynthesisKind Kind) {
+ static std::string toString(CodeSynthesisContext::SynthesisKind Kind) {
switch (Kind) {
case CodeSynthesisContext::TemplateInstantiation:
return "TemplateInstantiation";
@@ -462,10 +461,8 @@ private:
return "TypeAliasTemplateInstantiation";
case CodeSynthesisContext::PartialOrderingTTP:
return "PartialOrderingTTP";
- case CodeSynthesisContext::CheckTemplateParameter:
- return std::nullopt;
}
- return std::nullopt;
+ return "";
}
template <bool BeginInstantiation>
@@ -473,14 +470,12 @@ private:
const CodeSynthesisContext &Inst) {
std::string YAML;
{
- std::optional<TemplightEntry> Entry =
- getTemplightEntry<BeginInstantiation>(TheSema, Inst);
- if (!Entry)
- return;
llvm::raw_string_ostream OS(YAML);
llvm::yaml::Output YO(OS);
+ TemplightEntry Entry =
+ getTemplightEntry<BeginInstantiation>(TheSema, Inst);
llvm::yaml::EmptyContext Context;
- llvm::yaml::yamlize(YO, *Entry, true, Context);
+ llvm::yaml::yamlize(YO, Entry, true, Context);
}
Out << "---" << YAML << "\n";
}
@@ -560,13 +555,10 @@ private:
}
template <bool BeginInstantiation>
- static std::optional<TemplightEntry>
- getTemplightEntry(const Sema &TheSema, const CodeSynthesisContext &Inst) {
+ static TemplightEntry getTemplightEntry(const Sema &TheSema,
+ const CodeSynthesisContext &Inst) {
TemplightEntry Entry;
- std::optional<std::string> Kind = toString(Inst.Kind);
- if (!Kind)
- return std::nullopt;
- Entry.Kind = *Kind;
+ Entry.Kind = toString(Inst.Kind);
Entry.Event = BeginInstantiation ? "Begin" : "End";
llvm::raw_string_ostream OS(Entry.Name);
printEntryName(TheSema, Inst.Entity, OS);