Kaydet (Commit) 598d8194 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Visible function type RTTI for Clang -fsanitize=function

...by adding some further SAL_DLLPUBLIC_RTTI type annotations (cf.
b4f6b26b "SAL_DLLPUBLIC_RTTI for proper RTTI
visibility for LLVM") and by making sure relevant function types do not use
incomplete types in their parameter and return types (which would make the RTTI
hidden).

Change-Id: Id7aadcbc0704b9759968ae36266fc9ce11a2e340
üst 64235bc9
......@@ -21,6 +21,7 @@
#include <boost/noncopyable.hpp>
#include <com/sun/star/graphic/XPrimitive2DRenderer.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/supportsservice.hxx>
......
......@@ -30,7 +30,8 @@
#include "shape.hxx"
#include <boost/scoped_array.hpp>
class FilterConfigItem;
#include <vcl/FilterConfigItem.hxx>
// complete FilterConfigItem for GraphicImport under -fsanitize=function
namespace PictReaderInternal {
//! utilitary class to store a pattern, ...
......
......@@ -46,7 +46,7 @@ class Type;
return true if the any contains an assignable value (no data loss), e.g. the any contains a
short and you >>= it into a long variable.
*/
class SAL_WARN_UNUSED Any : public uno_Any
class SAL_WARN_UNUSED SAL_DLLPUBLIC_RTTI Any : public uno_Any
{
public:
/// @cond INTERNAL
......
......@@ -213,7 +213,7 @@ template< typename T2 > struct UpCast< XInterface, T2 > {};
for reference type.
*/
template< class interface_type >
class Reference : public BaseReference
class SAL_DLLPUBLIC_RTTI Reference : public BaseReference
{
/** Queries given interface for type interface_type.
......
......@@ -52,7 +52,7 @@ namespace uno
@tparam E element type of sequence
*/
template< class E >
class SAL_WARN_UNUSED Sequence
class SAL_WARN_UNUSED SAL_DLLPUBLIC_RTTI Sequence
{
/** sequence handle
*/
......
......@@ -51,7 +51,7 @@ enum UnoType_NoAcquire
@see typelib_TypeDescriptionReference
*/
class SAL_WARN_UNUSED Type
class SAL_WARN_UNUSED SAL_DLLPUBLIC_RTTI Type
{
/** the C typelib reference pointer
*/
......
......@@ -50,7 +50,7 @@ typedef sal_uInt16 RegAccessMode;
a value and link keys which navigate over the linktarget to an existing
other key (which are no longer supported).
*/
enum RegKeyType
enum SAL_DLLPUBLIC_RTTI RegKeyType
{
/// represents a real key
RG_KEYTYPE,
......@@ -66,7 +66,7 @@ enum RegKeyType
to define own data structures and store these types in the registry. The UNO
core reflection data is stored as a binary blob in the type registry.
*/
enum RegValueType
enum SAL_DLLPUBLIC_RTTI RegValueType
{
/// The key has no value or the value type is unknown.
RG_VALUETYPE_NOT_DEFINED,
......@@ -87,7 +87,7 @@ enum RegValueType
};
/// specifies the possible error codes which can occur using the registry API.
enum RegError
enum SAL_DLLPUBLIC_RTTI RegError
{
/// no error.
REG_NO_ERROR,
......
......@@ -131,7 +131,7 @@ SAL_DLLPUBLIC void SAL_CALL rtl_freeAlignedMemory (
/** Opaque rtl_arena_type.
*/
typedef struct rtl_arena_st rtl_arena_type;
typedef struct SAL_DLLPUBLIC_RTTI rtl_arena_st rtl_arena_type;
#define RTL_ARENA_NAME_LENGTH 31
......
......@@ -85,7 +85,7 @@ namespace rtl
use this class.
*/
class SAL_WARN_UNUSED OString
class SAL_WARN_UNUSED SAL_DLLPUBLIC_RTTI OString
{
public:
/// @cond INTERNAL
......
......@@ -39,7 +39,7 @@ extern "C"
@deprecated Do not use.
*/
typedef struct _rtl_ModuleCount
typedef struct SAL_DLLPUBLIC_RTTI _rtl_ModuleCount
{
void ( SAL_CALL * acquire ) ( struct _rtl_ModuleCount * that );
void ( SAL_CALL * release ) ( struct _rtl_ModuleCount * that );
......
......@@ -1173,7 +1173,7 @@ SAL_DLLPUBLIC double SAL_CALL rtl_ustr_toDouble(
/** @cond INTERNAL */
/** The implementation of a Unicode string.
*/
typedef struct _rtl_uString
typedef struct SAL_DLLPUBLIC_RTTI _rtl_uString
{
oslInterlockedCount refCount; /* opaque */
sal_Int32 length;
......
......@@ -111,7 +111,7 @@ template<char C> struct SAL_WARN_UNUSED OUStringLiteral1 {
less people should have understanding problems when they use this class.
*/
class SAL_WARN_UNUSED OUString
class SAL_WARN_UNUSED SAL_DLLPUBLIC_RTTI OUString
{
public:
/// @cond INTERNAL
......
......@@ -20,6 +20,7 @@
#define INCLUDED_SFX2_CHILDWIN_HXX
#include <sal/config.h>
#include <sfx2/dllapi.h>
#include <sal/types.h>
#include <vcl/window.hxx>
......@@ -28,9 +29,12 @@
#include <sfx2/shell.hxx>
#include <sfx2/chalign.hxx>
#include <sfx2/bindings.hxx>
// complete SfxBindings for complete SfxChildWinCtor, SfxChildWinContextCtor
// under -fsanitize=function
class SfxWorkWindow;
class SfxModule;
class SfxBindings;
class SfxShell;
class SfxChildWindow;
class SfxChildWindowContext;
......@@ -45,7 +49,7 @@ class SfxChildWindowContext;
#define CHILDWIN_NOPOS USHRT_MAX
// ChildWindow Configuration
struct SfxChildWinInfo
struct SAL_DLLPUBLIC_RTTI SfxChildWinInfo
{
bool bVisible;
Point aPos;
......
......@@ -33,7 +33,7 @@
namespace tools {
/** T must be a class that extends SvRefBase */
template<typename T> class SvRef {
template<typename T> class SAL_DLLPUBLIC_RTTI SvRef {
public:
SvRef(): pObj(0) {}
......
......@@ -37,7 +37,7 @@ struct _typelib_TypeDescription;
/** Holds a weak reference to a type description.
*/
typedef struct _typelib_TypeDescriptionReference
typedef struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescriptionReference
{
/** reference count of type; don't ever modify this by yourself, use
typelib_typedescriptionreference_acquire() and typelib_typedescriptionreference_release()
......@@ -68,7 +68,7 @@ typedef struct _typelib_TypeDescriptionReference
typelib_TypeDescriptionReference for the first six members.
So a typedescription can be used as type reference.
*/
typedef struct _typelib_TypeDescription
typedef struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescription
{
/** reference count; don't ever modify this by yourself, use
typelib_typedescription_acquire() and typelib_typedescription_release()
......@@ -367,7 +367,7 @@ typedef struct _typelib_InterfaceAttributeTypeDescription
<code>typelib_typedescription_complete</code>.</li>
</ul>
*/
typedef struct _typelib_InterfaceTypeDescription
typedef struct SAL_DLLPUBLIC_RTTI _typelib_InterfaceTypeDescription
{
/** inherits all members of typelib_TypeDescription
*/
......
......@@ -37,7 +37,7 @@ struct _uno_Mapping;
/** This is the binary specification of an UNO any.
*/
typedef struct _uno_Any
typedef struct SAL_DLLPUBLIC_RTTI _uno_Any
{
/** type of value
*/
......
......@@ -58,7 +58,7 @@ typedef void (SAL_CALL * uno_DispatchMethod)(
/** The binary C uno interface description.
*/
typedef struct _uno_Interface
typedef struct SAL_DLLPUBLIC_RTTI _uno_Interface
{
/** Acquires uno interface.
......
......@@ -38,7 +38,7 @@ struct _typelib_InterfaceTypeDescription;
/** The binary specification of an UNO environment.
*/
typedef struct _uno_Environment
typedef struct SAL_DLLPUBLIC_RTTI _uno_Environment
{
/** reserved for future use (0 if not used)
*/
......@@ -130,7 +130,7 @@ typedef void * (SAL_CALL * uno_memAlloc)( sal_Size nBytes );
/** The binary specification of an UNO environment supporting interface registration.
*/
typedef struct _uno_ExtEnvironment
typedef struct SAL_DLLPUBLIC_RTTI _uno_ExtEnvironment
{
/** inherits all members of an uno_Environment
*/
......
......@@ -61,7 +61,7 @@ typedef void (SAL_CALL * uno_MapInterfaceFunc)(
/** This is the binary specification of a mapping.
*/
typedef struct _uno_Mapping
typedef struct SAL_DLLPUBLIC_RTTI _uno_Mapping
{
/** Acquires mapping
*/
......
......@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/StorageFormats.hpp>
......
......@@ -87,7 +87,7 @@ struct ImplTextConverter
/* - TextEncoding - Structures - */
/* ----------------------------- */
struct ImplTextEncodingData
struct SAL_DLLPUBLIC_RTTI ImplTextEncodingData
{
ImplTextConverter maConverter;
sal_uInt8 mnMinCharSize;
......
......@@ -79,7 +79,7 @@ class ScEEAbsImport {
SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ) = 0;
};
class ScFormatFilterPlugin {
class SAL_DLLPUBLIC_RTTI ScFormatFilterPlugin {
public:
// various import filters
virtual FltError ScImportLotus123( SfxMedium&, ScDocument*, rtl_TextEncoding eSrc = RTL_TEXTENCODING_DONTKNOW ) = 0;
......
......@@ -41,6 +41,9 @@
#include "spelldialog.hxx"
#include <searchresults.hxx>
#include <sfx2/request.hxx>
// needed for -fsanitize=function visibility of typeinfo for functions of
// type void(SfxShell*,SfxRequest&) defined in scslots.hxx
#define ScTabViewShell
#include "scslots.hxx"
......
......@@ -55,6 +55,9 @@
#include <oox/ole/olehelper.hxx>
#include <rtl/math.hxx>
#include <sfx2/objsh.hxx>
// complete SfxObjectShell for SaveVBA under -fsanitize=function
using namespace com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::presentation;
......
......@@ -22,6 +22,7 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/uno/Any.h>
......
......@@ -24,6 +24,7 @@
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/frame/XConfigManager.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <registerservices.hxx>
......
......@@ -33,6 +33,9 @@
#include "wdocsh.hxx"
#include "web.hrc"
#include <sfx2/request.hxx>
// needed for -fsanitize=function visibility of typeinfo for functions of
// type void(SfxShell*,SfxRequest&) defined in swslots.hxx
#define SwWebDocShell
#include "swslots.hxx"
......
......@@ -33,6 +33,9 @@
#include "popup.hrc"
#include "shells.hrc"
#include <sfx2/request.hxx>
// needed for -fsanitize=function visibility of typeinfo for functions of
// type void(SfxShell*,SfxRequest&) defined in swslots.hxx
#define SwWebDrawFormShell
#include "swslots.hxx"
......
......@@ -31,6 +31,9 @@
#include "web.hrc"
// STATIC DATA
#include <sfx2/request.hxx>
// needed for -fsanitize=function visibility of typeinfo for functions of
// type void(SfxShell*,SfxRequest&) defined in swslots.hxx
#define SwWebFrameShell
#include <sfx2/msg.hxx>
#include "swslots.hxx"
......
......@@ -35,6 +35,9 @@
#include "web.hrc"
#include "wgrfsh.hxx"
#include <sfx2/request.hxx>
// needed for -fsanitize=function visibility of typeinfo for functions of
// type void(SfxShell*,SfxRequest&) defined in swslots.hxx
#define SwWebGrfShell
#include "swslots.hxx"
......
......@@ -31,6 +31,9 @@
#include "uinums.hxx"
#include "wlistsh.hxx"
#include <sfx2/request.hxx>
// needed for -fsanitize=function visibility of typeinfo for functions of
// type void(SfxShell*,SfxRequest&) defined in swslots.hxx
#define SwWebListShell
#include "swslots.hxx"
......
......@@ -33,6 +33,9 @@
#include "wrtsh.hxx"
#include "wtabsh.hxx"
#include <sfx2/request.hxx>
// needed for -fsanitize=function visibility of typeinfo for functions of
// type void(SfxShell*,SfxRequest&) defined in swslots.hxx
#define SwWebTableShell
#include <sfx2/msg.hxx>
#include "svx/svxids.hrc"
......
......@@ -37,6 +37,9 @@
#include <unomid.h>
// STATIC DATA
#include <sfx2/request.hxx>
// needed for -fsanitize=function visibility of typeinfo for functions of
// type void(SfxShell*,SfxRequest&) defined in swslots.hxx
#define SwWebTextShell
#include <sfx2/msg.hxx>
#include "swslots.hxx"
......
......@@ -60,6 +60,9 @@
#include <web.hrc>
#include <shells.hrc>
#include <sfx2/request.hxx>
// needed for -fsanitize=function visibility of typeinfo for functions of
// type void(SfxShell*,SfxRequest&) defined in swslots.hxx
#define SwWebView
#define Text
#define TextInTable
......
......@@ -34,11 +34,13 @@
#include <rtl/ustring.hxx>
#include <vcl/keycod.hxx>
#include <vcl/window.hxx>
// complete vcl::Window for SalFrame::CallCallback under -fsanitize=function
class AllSettings;
class SalGraphics;
class SalBitmap;
class SalMenu;
namespace vcl { class Window; }
struct SalFrameState;
struct SalInputContext;
......
......@@ -20,7 +20,11 @@
#ifndef INCLUDED_VCL_INC_UNX_DESKTOPS_HXX
#define INCLUDED_VCL_INC_UNX_DESKTOPS_HXX
enum DesktopType {
#include <sal/config.h>
#include <sal/types.h>
enum SAL_DLLPUBLIC_RTTI DesktopType {
DESKTOP_NONE, // headless, i.e. no X connection at all
DESKTOP_UNKNOWN, // unknown desktop, simple WM, etc.
DESKTOP_GNOME,
......
......@@ -25,6 +25,7 @@
#include "svdata.hxx"
#include "salinst.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/lang/XSingleServiceFactory.hpp"
#include "com/sun/star/lang/XInitialization.hpp"
......
......@@ -23,6 +23,7 @@
#include "factory.hxx"
#include "svdata.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/beans/XMaterialHolder.hpp>
#include <com/sun/star/awt/FontDescriptor.hpp>
......
......@@ -52,6 +52,7 @@
#include <algorithm>
#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
......
......@@ -18,6 +18,7 @@
*/
#include <xmloff/unointerfacetouniqueidentifiermapper.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/animations/AnimationTransformType.hpp>
......
......@@ -23,6 +23,7 @@
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlmetai.hxx>
#include <xmloff/nmspmap.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
using namespace ::com::sun::star;
......
......@@ -19,6 +19,7 @@
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/servicehelper.hxx>
#include <sax/tools/converter.hxx>
......
......@@ -18,6 +18,7 @@
*/
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <rtl/ustrbuf.hxx>
#include <sax/tools/converter.hxx>
#include <xmloff/nmspmap.hxx>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment