Skip to content

Commit

Permalink
Remove some unused defines and functions (#53724)
Browse files Browse the repository at this point in the history
* Remove some unused defines and functions

* Delete the _CROSS_COMPILER_ define

It is also unused.

* Also fix a typo while I am here

* Delete #define DUMPER

* Delete #include's under #ifdef ICECAP

* Delete MAX/MIN_SHORT_AS_INT defines
  • Loading branch information
SingleAccretion authored Jun 4, 2021
1 parent 951b424 commit d40dc6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 80 deletions.
10 changes: 0 additions & 10 deletions src/coreclr/jit/cpp.hint
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,11 @@
// See the article on hints in MSDN for more information on their necessity and use:
// http://msdn.microsoft.com/en-us/library/dd997977.aspx

#define foreach_treenode_execution_order(__node, __stmt) for (;;)

#define foreach_block(__compiler, __block) for (;;)

#define FOREACH_REGISTER_FILE(file) for (;;)

// From jit.h

#define DECLARE_TYPED_ENUM(tag,baseType) enum tag : baseType

#define END_DECLARE_TYPED_ENUM(tag,baseType) ;

#define INDEBUG(x) x
#define INDEBUG_COMMA(x) x,
#define DEBUGARG(x) , x

#define PROTO_ARG(x) x ,
#define PROTO_ARGL(x) , x
75 changes: 5 additions & 70 deletions src/coreclr/jit/jit.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@
#if defined(TARGET_ARM64)
#error Cannot define both TARGET_X86 and TARGET_ARM64
#endif
#if !defined(HOST_X86)
#define _CROSS_COMPILER_
#endif
#elif defined(TARGET_AMD64)
#if defined(TARGET_X86)
#error Cannot define both TARGET_AMD64 and TARGET_X86
Expand All @@ -99,9 +96,6 @@
#if defined(TARGET_ARM64)
#error Cannot define both TARGET_AMD64 and TARGET_ARM64
#endif
#if !defined(HOST_AMD64)
#define _CROSS_COMPILER_
#endif
#elif defined(TARGET_ARM)
#if defined(TARGET_X86)
#error Cannot define both TARGET_ARM and TARGET_X86
Expand All @@ -112,9 +106,6 @@
#if defined(TARGET_ARM64)
#error Cannot define both TARGET_ARM and TARGET_ARM64
#endif
#if !defined(HOST_ARM)
#define _CROSS_COMPILER_
#endif
#elif defined(TARGET_ARM64)
#if defined(TARGET_X86)
#error Cannot define both TARGET_ARM64 and TARGET_X86
Expand All @@ -125,9 +116,6 @@
#if defined(TARGET_ARM)
#error Cannot define both TARGET_ARM64 and TARGET_ARM
#endif
#if !defined(HOST_ARM64)
#define _CROSS_COMPILER_
#endif
#else
#error Unsupported or unset target architecture
#endif
Expand Down Expand Up @@ -198,11 +186,9 @@

#ifdef DEBUG
#define INDEBUG(x) x
#define INDEBUG_COMMA(x) x,
#define DEBUGARG(x) , x
#else
#define INDEBUG(x)
#define INDEBUG_COMMA(x)
#define DEBUGARG(x)
#endif

Expand All @@ -223,7 +209,7 @@
#if defined(DEBUG) && !defined(OSX_ARM64_ABI)
// On all platforms except Arm64 OSX arguments on the stack are taking
// register size slots. On these platforms we could check that stack slots count
// matchs out new byte size calculations.
// matches our new byte size calculations.
#define DEBUG_ARG_SLOTS
#endif

Expand All @@ -239,11 +225,6 @@

#if defined(UNIX_AMD64_ABI) || !defined(TARGET_64BIT) || defined(TARGET_ARM64)
#define FEATURE_PUT_STRUCT_ARG_STK 1
#define PUT_STRUCT_ARG_STK_ONLY_ARG(x) , x
#define PUT_STRUCT_ARG_STK_ONLY(x) x
#else
#define PUT_STRUCT_ARG_STK_ONLY_ARG(x)
#define PUT_STRUCT_ARG_STK_ONLY(x)
#endif

#if defined(UNIX_AMD64_ABI)
Expand Down Expand Up @@ -297,8 +278,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#define INFO6 LL_INFO10000 // Did Jit or Inline succeeded?
#define INFO7 LL_INFO100000 // NYI stuff
#define INFO8 LL_INFO1000000 // Weird failures
#define INFO9 LL_EVERYTHING // Info about incoming settings
#define INFO10 LL_EVERYTHING // Totally verbose

#endif // DEBUG

Expand All @@ -308,11 +287,6 @@ const CORINFO_CLASS_HANDLE NO_CLASS_HANDLE = (CORINFO_CLASS_HANDLE) nullptr;

/*****************************************************************************/

inline bool False()
{
return false;
} // Use to disable code while keeping prefast happy

// We define two IL offset types, as follows:
//
// IL_OFFSET: either a distinguished value, or an IL offset.
Expand Down Expand Up @@ -496,21 +470,17 @@ class GlobalJitOptions
#endif

/*****************************************************************************/
#ifdef DEBUG
/*****************************************************************************/

#define DUMPER

#else // !DEBUG
#if !defined(DEBUG)

#if DUMP_GC_TABLES
#pragma message("NOTE: this non-debug build has GC ptr table dumping always enabled!")
const bool dspGCtbls = true;
const bool dspGCtbls = true;
#endif

/*****************************************************************************/
#endif // !DEBUG

/*****************************************************************************/

#ifdef DEBUG
#define JITDUMP(...) \
{ \
Expand Down Expand Up @@ -591,21 +561,8 @@ inline bool IsUninitialized(T data);

/*****************************************************************************/

enum accessLevel
{
ACL_NONE,
ACL_PRIVATE,
ACL_DEFAULT,
ACL_PROTECTED,
ACL_PUBLIC,
};

/*****************************************************************************/

#define castto(var, typ) (*(typ*)&var)

#define sizeto(typ, mem) (offsetof(typ, mem) + sizeof(((typ*)0)->mem))

/*****************************************************************************/

#ifdef NO_MISALIGNED_ACCESS
Expand Down Expand Up @@ -645,23 +602,11 @@ inline size_t roundUp(size_t size, size_t mult = sizeof(size_t))
return (size + (mult - 1)) & ~(mult - 1);
}

inline size_t roundDn(size_t size, size_t mult = sizeof(size_t))
{
assert(mult && ((mult & (mult - 1)) == 0)); // power of two test

return (size) & ~(mult - 1);
}

#ifdef HOST_64BIT
inline unsigned int roundUp(unsigned size, unsigned mult)
{
return (unsigned int)roundUp((size_t)size, (size_t)mult);
}

inline unsigned int roundDn(unsigned size, unsigned mult)
{
return (unsigned int)roundDn((size_t)size, (size_t)mult);
}
#endif // HOST_64BIT

inline unsigned int unsigned_abs(int x)
Expand Down Expand Up @@ -698,12 +643,6 @@ class Histogram

#endif // CALL_ARG_STATS || COUNT_BASIC_BLOCKS || COUNT_LOOPS || EMITTER_STATS || MEASURE_NODE_SIZE

/*****************************************************************************/
#ifdef ICECAP
#include "icapexp.h"
#include "icapctrl.h"
#endif

/*****************************************************************************/

#include "error.h"
Expand Down Expand Up @@ -783,10 +722,6 @@ extern int jitNativeCode(CORINFO_METHOD_HANDLE methodHnd,
const size_t MAX_USHORT_SIZE_T = static_cast<size_t>(static_cast<unsigned short>(-1));
const size_t MAX_UNSIGNED_SIZE_T = static_cast<size_t>(static_cast<unsigned>(-1));

// These assume 2's complement...
const int MAX_SHORT_AS_INT = 32767;
const int MIN_SHORT_AS_INT = -32768;

/*****************************************************************************/

class Compiler;
Expand Down

0 comments on commit d40dc6e

Please sign in to comment.