aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2025-03-10 10:18:56 +0100
committerNikita Popov <npopov@redhat.com>2025-03-10 10:32:08 +0100
commit07f3388fff0c73c1119d06ca1c2353fd012361c0 (patch)
treef750a1d6664b370228a0c783ad770a06ded8abcd /clang/lib/Frontend/FrontendActions.cpp
parentc579ec66c77461122d93deadebc318fbb846b830 (diff)
downloadllvm-07f3388fff0c73c1119d06ca1c2353fd012361c0.zip
llvm-07f3388fff0c73c1119d06ca1c2353fd012361c0.tar.gz
llvm-07f3388fff0c73c1119d06ca1c2353fd012361c0.tar.bz2
Revert "[clang] Implement instantiation context note for checking template parameters (#126088)"
This reverts commit a24523ac8dc07f3478311a5969184b922b520395. This is causing significant compile-time regressions for C++ code, see: https://github.com/llvm/llvm-project/pull/126088#issuecomment-2704874202
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);