summaryrefslogtreecommitdiff
path: root/include/clang/AST/VTTBuilder.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/VTTBuilder.h')
-rw-r--r--include/clang/AST/VTTBuilder.h44
1 files changed, 24 insertions, 20 deletions
diff --git a/include/clang/AST/VTTBuilder.h b/include/clang/AST/VTTBuilder.h
index b4a6fe3bdb94..178139477d00 100644
--- a/include/clang/AST/VTTBuilder.h
+++ b/include/clang/AST/VTTBuilder.h
@@ -1,4 +1,4 @@
-//===--- VTTBuilder.h - C++ VTT layout builder --------------------*- C++ -*-=//
+//===- VTTBuilder.h - C++ VTT layout builder --------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -16,25 +16,31 @@
#define LLVM_CLANG_AST_VTTBUILDER_H
#include "clang/AST/BaseSubobject.h"
-#include "clang/AST/CXXInheritance.h"
-#include "clang/AST/GlobalDecl.h"
-#include "clang/AST/RecordLayout.h"
-#include "clang/Basic/ABI.h"
-#include <utility>
+#include "clang/AST/CharUnits.h"
+#include "clang/Basic/LLVM.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/PointerIntPair.h"
+#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/SmallVector.h"
+#include <cstdint>
namespace clang {
+class ASTContext;
+class ASTRecordLayout;
+class CXXRecordDecl;
+
class VTTVTable {
llvm::PointerIntPair<const CXXRecordDecl *, 1, bool> BaseAndIsVirtual;
CharUnits BaseOffset;
public:
- VTTVTable() {}
+ VTTVTable() = default;
VTTVTable(const CXXRecordDecl *Base, CharUnits BaseOffset, bool BaseIsVirtual)
- : BaseAndIsVirtual(Base, BaseIsVirtual), BaseOffset(BaseOffset) {}
+ : BaseAndIsVirtual(Base, BaseIsVirtual), BaseOffset(BaseOffset) {}
VTTVTable(BaseSubobject Base, bool BaseIsVirtual)
- : BaseAndIsVirtual(Base.getBase(), BaseIsVirtual),
- BaseOffset(Base.getBaseOffset()) {}
+ : BaseAndIsVirtual(Base.getBase(), BaseIsVirtual),
+ BaseOffset(Base.getBaseOffset()) {}
const CXXRecordDecl *getBase() const {
return BaseAndIsVirtual.getPointer();
@@ -57,25 +63,24 @@ struct VTTComponent {
uint64_t VTableIndex;
BaseSubobject VTableBase;
- VTTComponent() {}
+ VTTComponent() = default;
VTTComponent(uint64_t VTableIndex, BaseSubobject VTableBase)
- : VTableIndex(VTableIndex), VTableBase(VTableBase) {}
+ : VTableIndex(VTableIndex), VTableBase(VTableBase) {}
};
/// \brief Class for building VTT layout information.
class VTTBuilder {
-
ASTContext &Ctx;
/// \brief The most derived class for which we're building this vtable.
const CXXRecordDecl *MostDerivedClass;
- typedef SmallVector<VTTVTable, 64> VTTVTablesVectorTy;
+ using VTTVTablesVectorTy = SmallVector<VTTVTable, 64>;
/// \brief The VTT vtables.
VTTVTablesVectorTy VTTVTables;
- typedef SmallVector<VTTComponent, 64> VTTComponentsVectorTy;
+ using VTTComponentsVectorTy = SmallVector<VTTComponent, 64>;
/// \brief The VTT components.
VTTComponentsVectorTy VTTComponents;
@@ -83,9 +88,9 @@ class VTTBuilder {
/// \brief The AST record layout of the most derived class.
const ASTRecordLayout &MostDerivedClassLayout;
- typedef llvm::SmallPtrSet<const CXXRecordDecl *, 4> VisitedVirtualBasesSetTy;
+ using VisitedVirtualBasesSetTy = llvm::SmallPtrSet<const CXXRecordDecl *, 4>;
- typedef llvm::DenseMap<BaseSubobject, uint64_t> AddressPointsMapTy;
+ using AddressPointsMapTy = llvm::DenseMap<BaseSubobject, uint64_t>;
/// \brief The sub-VTT indices for the bases of the most derived class.
llvm::DenseMap<BaseSubobject, uint64_t> SubVTTIndicies;
@@ -153,9 +158,8 @@ public:
getSecondaryVirtualPointerIndices() const {
return SecondaryVirtualPointerIndices;
}
-
};
-}
+} // namespace clang
-#endif
+#endif // LLVM_CLANG_AST_VTTBUILDER_H