summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-02-13 22:56:14 +0000
committerGreg Clayton <gclayton@apple.com>2013-02-13 22:56:14 +0000
commita66c4d96f02a07f2956a3f029e216a8967463f5d (patch)
treedfab354f735b493e2148d9f0b9e3d6990a174fea /lldb/source/Expression
parent3c8220405d2dfc93da1c0c69942d07b0bd12927a (diff)
downloadbcm5719-llvm-a66c4d96f02a07f2956a3f029e216a8967463f5d.tar.gz
bcm5719-llvm-a66c4d96f02a07f2956a3f029e216a8967463f5d.zip
<rdar://problem/13210494>
Parse objective C information as efficiently as possible and without taking dangerous runtime locks. Reworked the way objective C information is parsed by: 1 - don't read all class names up front, this is about 500K of data with names 2 - add a 32 bit hash map that maps a hash of a name to the Class pointer (isa) 3 - Improved name lookups by using the new hash map 4 - split up reading the objc runtime info into dynamic and shared cache since the shared cache only needs to be read once. 5 - When reading all isa values, also get the 32 bit hash instead of the name 6 - Read names lazily now that we don't need all names up front 7 - Allow the hash maps to not be there and still have this function correctly There is dead code in here with all of the various methods I tried. I want to check this in first to not lose any of it in case we need to revert to any of the extra code. I will promptly cleanup and commit again. llvm-svn: 175101
Diffstat (limited to 'lldb/source/Expression')
-rw-r--r--lldb/source/Expression/ClangUtilityFunction.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/lldb/source/Expression/ClangUtilityFunction.cpp b/lldb/source/Expression/ClangUtilityFunction.cpp
index fd78f6e0b89..c25916243a5 100644
--- a/lldb/source/Expression/ClangUtilityFunction.cpp
+++ b/lldb/source/Expression/ClangUtilityFunction.cpp
@@ -28,6 +28,33 @@
using namespace lldb_private;
+static const char *g_global_defines =
+"#undef NULL \n"
+"#undef Nil \n"
+"#undef nil \n"
+"#undef YES \n"
+"#undef NO \n"
+"#define NULL ((int)0) \n"
+"#define Nil ((Class)0) \n"
+"#define nil ((id)0) \n"
+"#define YES ((BOOL)1) \n"
+"#define NO ((BOOL)0) \n"
+"typedef signed char BOOL; \n"
+"typedef signed __INT8_TYPE__ int8_t;\n"
+"typedef unsigned __INT8_TYPE__ uint8_t;\n"
+"typedef signed __INT16_TYPE__ int16_t;\n"
+"typedef unsigned __INT16_TYPE__ uint16_t;\n"
+"typedef signed __INT32_TYPE__ int32_t;\n"
+"typedef unsigned __INT32_TYPE__ uint32_t;\n"
+"typedef signed __INT64_TYPE__ int64_t;\n"
+"typedef unsigned __INT64_TYPE__ uint64_t;\n"
+"typedef signed __INTPTR_TYPE__ intptr_t;\n"
+"typedef unsigned __INTPTR_TYPE__ uintptr_t;\n"
+"typedef __SIZE_TYPE__ size_t; \n"
+"typedef __PTRDIFF_TYPE__ ptrdiff_t;\n"
+"typedef unsigned short unichar;\n";
+
+
//------------------------------------------------------------------
/// Constructor
///
@@ -40,9 +67,11 @@ using namespace lldb_private;
ClangUtilityFunction::ClangUtilityFunction (const char *text,
const char *name) :
ClangExpression (),
- m_function_text (text),
+ m_function_text (g_global_defines),
m_function_name (name)
{
+ if (text && text[0])
+ m_function_text.append (text);
}
ClangUtilityFunction::~ClangUtilityFunction ()
OpenPOWER on IntegriCloud