From d88ba82a4702c0ce7759640d330c52935cc1ccb7 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Mon, 9 Jan 2012 17:10:00 +0000 Subject: [PATCH] Getting a start on the typeinfo infrastructure. llvm-svn: 147776 --- libcxxabi/src/private_typeinfo.cpp | 75 +++++++++++++++++ libcxxabi/src/private_typeinfo.h | 130 +++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+) create mode 100644 libcxxabi/src/private_typeinfo.cpp create mode 100644 libcxxabi/src/private_typeinfo.h diff --git a/libcxxabi/src/private_typeinfo.cpp b/libcxxabi/src/private_typeinfo.cpp new file mode 100644 index 000000000000..d98e1336718b --- /dev/null +++ b/libcxxabi/src/private_typeinfo.cpp @@ -0,0 +1,75 @@ +//===----------------------- private_typeinfo.cpp -------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "private_typeinfo.h" + +namespace __cxxabiv1 +{ + +// __fundamental_type_info + +__fundamental_type_info::~__fundamental_type_info() +{ +} + +// __array_type_info + +__array_type_info::~__array_type_info() +{ +} + +// __function_type_info + +__function_type_info::~__function_type_info() +{ +} + +// __enum_type_info + +__enum_type_info::~__enum_type_info() +{ +} + +// __class_type_info + +__class_type_info::~__class_type_info() +{ +} + +// __si_class_type_info + +__si_class_type_info::~__si_class_type_info() +{ +} + +// __vmi_class_type_info + +__vmi_class_type_info::~__vmi_class_type_info() +{ +} + +// __pbase_type_info + +__pbase_type_info::~__pbase_type_info() +{ +} + +// __pointer_type_info + +__pointer_type_info::~__pointer_type_info() +{ +} + +// __pointer_to_member_type_info + +__pointer_to_member_type_info::~__pointer_to_member_type_info() +{ +} + +} // __cxxabiv1 diff --git a/libcxxabi/src/private_typeinfo.h b/libcxxabi/src/private_typeinfo.h new file mode 100644 index 000000000000..2a36985730b7 --- /dev/null +++ b/libcxxabi/src/private_typeinfo.h @@ -0,0 +1,130 @@ +//===------------------------ private_typeinfo.h --------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef __PRIVATE_TYPEINFO_H_ +#define __PRIVATE_TYPEINFO_H_ + +#include + +namespace __cxxabiv1 +{ + +class __fundamental_type_info + : public std::type_info +{ +public: + virtual ~__fundamental_type_info(); +}; + +class __array_type_info + : public std::type_info +{ +public: + virtual ~__array_type_info(); +}; + +class __function_type_info + : public std::type_info +{ +public: + virtual ~__function_type_info(); +}; + +class __enum_type_info + : public std::type_info +{ +public: + virtual ~__enum_type_info(); +}; + +class __class_type_info + : public std::type_info +{ +public: + virtual ~__class_type_info(); +}; + +class __si_class_type_info + : public __class_type_info +{ +public: + const __class_type_info* __base_type; + + virtual ~__si_class_type_info(); +}; + +struct __base_class_type_info +{ +public: + const __class_type_info* __base_type; + long __offset_flags; + + enum __offset_flags_masks + { + __virtual_mask = 0x1, + __public_mask = 0x2, + __offset_shift = 8 + }; +}; + +class __vmi_class_type_info + : public __class_type_info +{ +public: + unsigned int __flags; + unsigned int __base_count; + __base_class_type_info __base_info[1]; + + enum __flags_masks + { + __non_diamond_repeat_mask = 0x1, + __diamond_shaped_mask = 0x2 + }; + + virtual ~__vmi_class_type_info(); +}; + +class __pbase_type_info + : public std::type_info +{ +public: + unsigned int __flags; + const std::type_info* __pointee; + + enum __masks + { + __const_mask = 0x1, + __volatile_mask = 0x2, + __restrict_mask = 0x4, + __incomplete_mask = 0x8, + __incomplete_class_mask = 0x10 + }; + + virtual ~__pbase_type_info(); +}; + +class __pointer_type_info + : public __pbase_type_info +{ +public: + virtual ~__pointer_type_info(); +}; + +class __pointer_to_member_type_info + : public __pbase_type_info +{ +public: + const __class_type_info* __context; + + virtual ~__pointer_to_member_type_info(); +}; + +} // __cxxabiv1 + +#endif // __PRIVATE_TYPEINFO_H_