llvm-project/lldb/source/Symbol/ClangExternalASTSourceCommon.cpp
Raphael Isemann f49d15b3f8 [lldb][NFC] Move definition of ClangASTMetadata out of ClangExternalASTSourceCommon.h
Changing metadata of a ClangASTContext currently requires to include
the unrelated ClangExternalASTSourceCommon.h header because it actually defines
the ClangASTMetadata class.

This also removes the dependency from ClangASTImporter to ClangExternalASTSourceCommon.
2019-12-16 10:52:31 +01:00

35 lines
1.0 KiB
C++

//===-- ClangExternalASTSourceCommon.cpp ------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "lldb/Symbol/ClangExternalASTSourceCommon.h"
#include "lldb/Utility/Stream.h"
#include <mutex>
using namespace lldb_private;
char ClangExternalASTSourceCommon::ID;
ClangExternalASTSourceCommon::~ClangExternalASTSourceCommon() {}
ClangASTMetadata *
ClangExternalASTSourceCommon::GetMetadata(const clang::Decl *object) {
auto It = m_decl_metadata.find(object);
if (It != m_decl_metadata.end())
return &It->second;
return nullptr;
}
ClangASTMetadata *
ClangExternalASTSourceCommon::GetMetadata(const clang::Type *object) {
auto It = m_type_metadata.find(object);
if (It != m_type_metadata.end())
return &It->second;
return nullptr;
}