summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/Sema/Sema.h5
-rw-r--r--clang/lib/Sema/Sema.cpp3
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 220b6c17835..7d8ab59fe90 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -328,10 +328,13 @@ private:
};
/// Sema - This implements semantic analysis and AST building for C.
-class Sema {
+class Sema final {
Sema(const Sema &) = delete;
void operator=(const Sema &) = delete;
+ /// A key method to reduce duplicate debug info from Sema.
+ virtual void anchor();
+
///Source of additional semantic information.
ExternalSemaSource *ExternalSource;
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index bedea216795..c3c6cad277f 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -189,6 +189,9 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
SemaPPCallbackHandler->set(*this);
}
+// Anchor Sema's type info to this TU.
+void Sema::anchor() {}
+
void Sema::addImplicitTypedef(StringRef Name, QualType T) {
DeclarationName DN = &Context.Idents.get(Name);
if (IdResolver.begin(DN) == IdResolver.end())
OpenPOWER on IntegriCloud