mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
bug 826481 - mark PrepareAndDispatch() as __attribute__((used)) when building with gcc or clang r=froydnj
This commit is contained in:
parent
bddb4a0f97
commit
f25cd1be9f
@ -15,5 +15,3 @@
|
||||
#define SYMBOL_UNDERSCORE
|
||||
#endif
|
||||
|
||||
|
||||
#define ATTRIBUTE_USED __attribute__ ((__used__))
|
||||
|
@ -11,7 +11,7 @@
|
||||
/* Prototype specifies unmangled function name and disables unused warning */
|
||||
static nsresult
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
|
||||
__asm__("PrepareAndDispatch") __attribute__((used));
|
||||
__asm__("PrepareAndDispatch") ATTRIBUTE_USED;
|
||||
|
||||
static nsresult
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
|
||||
|
@ -28,7 +28,7 @@ const uint32_t FPR_COUNT = 8;
|
||||
// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
|
||||
// and then the method gets called.
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
||||
uint64_t * args, uint64_t * gpregs, double *fpregs)
|
||||
{
|
||||
|
@ -12,21 +12,9 @@
|
||||
#error "This code is for Linux ARM only. Please check if it works for you, too.\nDepends strongly on gcc behaviour."
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* This tells gcc3.4+ not to optimize away symbols.
|
||||
* @see http://gcc.gnu.org/gcc-3.4/changes.html
|
||||
*/
|
||||
#define DONT_DROP_OR_WARN __attribute__((used))
|
||||
#else
|
||||
/* This tells older gccs not to warn about unused vairables.
|
||||
* @see http://docs.freebsd.org/info/gcc/gcc.info.Variable_Attributes.html
|
||||
*/
|
||||
#define DONT_DROP_OR_WARN __attribute__((unused))
|
||||
#endif
|
||||
|
||||
/* Specify explicitly a symbol for this function, don't try to guess the c++ mangled symbol. */
|
||||
static nsresult PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args) asm("_PrepareAndDispatch")
|
||||
DONT_DROP_OR_WARN;
|
||||
ATTRIBUTE_USED;
|
||||
|
||||
#ifdef __ARM_EABI__
|
||||
#define DOUBLEWORD_ALIGN(p) ((uint32_t *)((((uint32_t)(p)) + 7) & 0xfffffff8))
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "xptcprivate.h"
|
||||
|
||||
nsresult
|
||||
nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
||||
{
|
||||
#define PARAM_BUFFER_COUNT 16
|
||||
|
@ -24,7 +24,7 @@
|
||||
static nsresult PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args) asm("_PrepareAndDispatch")
|
||||
DONT_DROP_OR_WARN;
|
||||
|
||||
static nsresult
|
||||
static nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
||||
{
|
||||
#define PARAM_BUFFER_COUNT 16
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
/* Implement shared vtbl methods. */
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
||||
uint64_t* intargs, uint64_t* floatargs, uint64_t* restargs)
|
||||
{
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
/* Implement shared vtbl methods. */
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
||||
uint64_t* intargs, uint64_t* floatargs, uint64_t* restargs)
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
/* Prototype specifies unmangled function name and disables unused warning */
|
||||
static nsresult
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
|
||||
__asm__("PrepareAndDispatch") __attribute__((used));
|
||||
__asm__("PrepareAndDispatch") ATTRIBUTE_USED;
|
||||
|
||||
static nsresult
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "xptiprivate.h"
|
||||
|
||||
extern "C" {
|
||||
nsresult
|
||||
nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
||||
{
|
||||
#define PARAM_BUFFER_COUNT 16
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "xptcprivate.h"
|
||||
#include "xptiprivate.h"
|
||||
|
||||
static nsresult
|
||||
static nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
||||
uint32_t* a_gpr, uint64_t *a_fpr, uint32_t *a_ov)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "xptcprivate.h"
|
||||
#include "xptiprivate.h"
|
||||
|
||||
static nsresult
|
||||
static nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
||||
uint64_t* a_gpr, uint64_t *a_fpr, uint64_t *a_ov)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@
|
||||
* Args contains a0-3 and then the stack.
|
||||
* Because a0 is 'this', we want to skip it
|
||||
*/
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
||||
{
|
||||
args++; // always skip over a0
|
||||
|
@ -20,7 +20,7 @@
|
||||
* they are stored on the stack at address "args".
|
||||
*
|
||||
*/
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
||||
uint64_t *gprData, double *fprData)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
static nsresult
|
||||
static nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
||||
{
|
||||
#define PARAM_BUFFER_COUNT 16
|
||||
|
@ -14,7 +14,7 @@
|
||||
#error "This code is for HP-PA RISC 32 bit mode only"
|
||||
#endif
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
||||
uint32_t* args, uint32_t* floatargs)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@
|
||||
// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
|
||||
// and then the method gets called.
|
||||
#include <stdio.h>
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self,
|
||||
uint64_t methodIndex,
|
||||
uint64_t* args,
|
||||
|
@ -16,7 +16,7 @@
|
||||
The args pointer has been set to the start of the parameters BEYOND the ones
|
||||
arriving in registers
|
||||
*/
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args, uint32_t *gprData, double *fprData)
|
||||
{
|
||||
typedef struct {
|
||||
|
@ -15,7 +15,7 @@
|
||||
The args pointer has been set to the start of the parameters BEYOND the ones
|
||||
arriving in registers
|
||||
*/
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args, uint64_t *gprData, double *fprData)
|
||||
{
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
|
||||
// and then the method gets called.
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self,
|
||||
uint32_t methodIndex,
|
||||
uint32_t* args,
|
||||
|
@ -27,7 +27,7 @@
|
||||
// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
|
||||
// and then the method gets called.
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self,
|
||||
uint32_t methodIndex,
|
||||
uint32_t* args,
|
||||
|
@ -28,7 +28,7 @@
|
||||
// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
|
||||
// and then the method gets called.
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self,
|
||||
uint32_t methodIndex,
|
||||
uint32_t* args,
|
||||
|
@ -35,7 +35,7 @@
|
||||
* http://developer.apple.com/documentation/DeveloperTools/Conceptual/
|
||||
* MachORuntime/PowerPCConventions/chapter_3_section_1.html */
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(
|
||||
nsXPTCStubBase *self,
|
||||
uint32_t methodIndex,
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#if defined(sparc) || defined(__sparc__)
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args)
|
||||
{
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#if defined(sparc) || defined(__sparc__)
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
||||
{
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#if defined(sparc) || defined(__sparc__)
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
||||
{
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#if defined(sparc) || defined(__sparc__)
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
||||
{
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#if defined(sparc) || defined(__sparc__)
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args)
|
||||
{
|
||||
|
||||
|
@ -30,7 +30,7 @@ const uint32_t FPR_COUNT = 8;
|
||||
// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
|
||||
// and then the method gets called.
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
||||
uint64_t * args, uint64_t * gpregs, double *fpregs)
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ const uint32_t FPR_COUNT = 8;
|
||||
// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
|
||||
// and then the method gets called.
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
||||
uint64_t * args, uint64_t * gpregs, double *fpregs)
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ const uint32_t FPR_COUNT = 8;
|
||||
// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
|
||||
// and then the method gets called.
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
||||
uint64_t * args, uint64_t * gpregs, double *fpregs)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "xptcprivate.h"
|
||||
#include "xptiprivate.h"
|
||||
|
||||
nsresult
|
||||
nsresult ATTRIBUTE_USED
|
||||
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
||||
{
|
||||
#define PARAM_BUFFER_COUNT 16
|
||||
|
@ -16,7 +16,7 @@
|
||||
# error xptcstubs_x86_64_gnu.cpp being used unexpectedly
|
||||
#endif
|
||||
|
||||
extern "C" nsresult
|
||||
extern "C" nsresult __attribute__((__used__))
|
||||
PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
||||
uint64_t * args, uint64_t * gprData, double *fprData)
|
||||
{
|
||||
|
@ -58,4 +58,10 @@ public:
|
||||
#undef STUB_ENTRY
|
||||
#undef SENTINEL_ENTRY
|
||||
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
#define ATTRIBUTE_USED __attribute__ ((__used__))
|
||||
#else
|
||||
#define ATTRIBUTE_USED
|
||||
#endif
|
||||
|
||||
#endif /* xptcprivate_h___ */
|
||||
|
Loading…
Reference in New Issue
Block a user