summaryrefslogtreecommitdiff
path: root/src/gcinfo
diff options
context:
space:
mode:
authorSwaroop Sridhar <Swaroop.Sridhar@microsoft.com>2015-04-29 20:17:48 -0700
committerSwaroop Sridhar <Swaroop.Sridhar@microsoft.com>2015-05-05 13:39:09 -0700
commitb503f15c45f9a7e6d0f90e5f4f9d3985f2060fe8 (patch)
tree358b860c39546d3dac102b06fd4a0494f9543af0 /src/gcinfo
parente79b36be0a49362908f5d191ca5b1f68eef8b39f (diff)
downloadcoreclr-b503f15c45f9a7e6d0f90e5f4f9d3985f2060fe8.tar.gz
coreclr-b503f15c45f9a7e6d0f90e5f4f9d3985f2060fe8.tar.bz2
coreclr-b503f15c45f9a7e6d0f90e5f4f9d3985f2060fe8.zip
GcInfo: Add support for Standalone build
The STANDALONE_BUILD switch can be used to build the GcInfoEncoder library independently by clients outside the CoreClr tree. The GcInfo library uses some custom data-structures (ex: ArrayList) and includes some utility libraries (ex: UtilCode) which pull in several other headers with considerable unrelated content. Rather than porting all the utility code to suite other clients, the STANDALONE_BUILD switch can be used to include only the minimal set of headers specific to GcInfo encodings. Clients of STANDALONE_BUILD will likely use standard library implementations of data-structures like ArrayList, HashMap etc., in place of the custom implementation currently used by GcInfoEncoder. Rather than spew the GcInfoEnoder code with #ifdef STANDALONE_BUILD ... #else .. #endif blocks, we include a special header GcInfoUtil.h in STANDALONE_BUILD mode. GcInfoUtil.h is expected to supply the interface/implementation for the data-structures and utilities used by GcInfoEncoder. This header should be provided by the clients doing the standalone build in their source tree.
Diffstat (limited to 'src/gcinfo')
-rw-r--r--src/gcinfo/CMakeLists.txt3
-rw-r--r--src/gcinfo/gcinfoencoder.cpp6
2 files changed, 8 insertions, 1 deletions
diff --git a/src/gcinfo/CMakeLists.txt b/src/gcinfo/CMakeLists.txt
index 47789d8ccb..0093815b8a 100644
--- a/src/gcinfo/CMakeLists.txt
+++ b/src/gcinfo/CMakeLists.txt
@@ -14,3 +14,6 @@ endif(CLR_CMAKE_PLATFORM_UNIX)
add_subdirectory(lib)
add_subdirectory(crossgen)
+
+install (FILES gcinfoencoder.cpp
+ DESTINATION gcinfo)
diff --git a/src/gcinfo/gcinfoencoder.cpp b/src/gcinfo/gcinfoencoder.cpp
index f9d6ebb4a1..8f3fe9508e 100644
--- a/src/gcinfo/gcinfoencoder.cpp
+++ b/src/gcinfo/gcinfoencoder.cpp
@@ -20,8 +20,11 @@
#define LOGGING
#endif
#endif
+
+#ifndef STANDALONE_BUILD
#include "log.h"
#include "simplerhash.h"
+#endif
#ifdef MDIL
#define MUST_CALL_JITALLOCATOR_FREE 1
@@ -84,7 +87,7 @@ void GcInfoSize::Log(DWORD level, const char * header)
#endif
-
+#ifndef DISABLE_EH_VECTORS
inline BOOL IsEssential(EE_ILEXCEPTION_CLAUSE *pClause)
{
_ASSERTE(pClause->TryEndPC >= pClause->TryStartPC);
@@ -93,6 +96,7 @@ inline BOOL IsEssential(EE_ILEXCEPTION_CLAUSE *pClause)
return TRUE;
}
+#endif
GcInfoEncoder::GcInfoEncoder(
ICorJitInfo* pCorJitInfo,