aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r--clang/lib/Sema/Sema.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 43a7f9e..cfb2f60 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -443,9 +443,7 @@ void Sema::Initialize() {
if (getLangOpts().MSVCCompat) {
if (getLangOpts().CPlusPlus &&
IdResolver.begin(&Context.Idents.get("type_info")) == IdResolver.end())
- PushOnScopeChains(
- Context.buildImplicitRecord("type_info", TagTypeKind::Class),
- TUScope);
+ PushOnScopeChains(Context.getMSTypeInfoTagDecl(), TUScope);
addImplicitTypedef("size_t", Context.getSizeType());
}
@@ -656,18 +654,19 @@ ASTMutationListener *Sema::getASTMutationListener() const {
return getASTConsumer().GetASTMutationListener();
}
-void Sema::addExternalSource(ExternalSemaSource *E) {
+void Sema::addExternalSource(IntrusiveRefCntPtr<ExternalSemaSource> E) {
assert(E && "Cannot use with NULL ptr");
if (!ExternalSource) {
- ExternalSource = E;
+ ExternalSource = std::move(E);
return;
}
- if (auto *Ex = dyn_cast<MultiplexExternalSemaSource>(ExternalSource))
- Ex->AddSource(E);
+ if (auto *Ex = dyn_cast<MultiplexExternalSemaSource>(ExternalSource.get()))
+ Ex->AddSource(std::move(E));
else
- ExternalSource = new MultiplexExternalSemaSource(ExternalSource.get(), E);
+ ExternalSource = llvm::makeIntrusiveRefCnt<MultiplexExternalSemaSource>(
+ ExternalSource, std::move(E));
}
void Sema::PrintStats() const {