Made many ConstString functions inlined in the header file.
Changed all of our synthesized "___clang" functions, types and variables
that get used in expressions over to have a prefix of "$_lldb". Now when we
do name lookups we can easily switch off of the first '$' character to know
if we should look through only our internal (when first char is '$') stuff,
or when we should look through program variables, functions and types.
Converted all of the clang expression code over to using "const ConstString&"
values for names instead of "const char *" since there were many places that
were converting the "const char *" names into ConstString names and them
throwing them away. We now avoid making a lot of ConstString conversions and
benefit from the quick comparisons in a few extra spots.
Converted a lot of code from LLVM coding conventions into LLDB coding
conventions.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116634 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/IRDynamicChecks.cpp b/source/Expression/IRDynamicChecks.cpp
index 53cabcb..2a21db5 100644
--- a/source/Expression/IRDynamicChecks.cpp
+++ b/source/Expression/IRDynamicChecks.cpp
@@ -26,18 +26,15 @@
static char ID;
-static const char valid_pointer_check_name[] =
-"___clang_valid_pointer_check";
+#define VALID_POINTER_CHECK_NAME "$__lldb_valid_pointer_check"
+#define VALID_OBJC_OBJECT_CHECK_NAME "$__lldb_objc_object_check"
-static const char valid_pointer_check_text[] =
- "extern \"C\" void "
- "___clang_valid_pointer_check (unsigned char *ptr)"
- "{"
- "unsigned char val = *ptr;"
- "}";
-
-static const char objc_object_check_name[] =
- "___clang_objc_object_check";
+static const char g_valid_pointer_check_text[] =
+"extern \"C\" void\n"
+VALID_POINTER_CHECK_NAME " (unsigned char *ptr)\n"
+"{\n"
+" unsigned char val = *ptr;\n"
+"}";
static bool FunctionExists(const SymbolContext &sym_ctx, const char *name)
{
@@ -55,14 +52,14 @@
std::string ret;
if (!exe_ctx.frame)
- return "extern \"C\" void ___clang_objc_object_check (unsigned char *obj) { }";
+ return "extern \"C\" void $__lldb_objc_object_check (unsigned char *obj) { }";
const SymbolContext &sym_ctx(exe_ctx.frame->GetSymbolContext(lldb::eSymbolContextEverything));
if (FunctionExists(sym_ctx, "gdb_object_getClass"))
{
return "extern \"C\" void "
- "___clang_objc_object_check(uint8_t *obj)"
+ "$__lldb_objc_object_check(uint8_t *obj)"
"{"
""
"}";
@@ -70,7 +67,7 @@
else if (FunctionExists(sym_ctx, "gdb_class_getClass"))
{
return "extern \"C\" void "
- "___clang_objc_object_check(uint8_t *obj)"
+ "$__lldb_objc_object_check(uint8_t *obj)"
"{"
""
"}";
@@ -78,7 +75,7 @@
else
{
return "extern \"C\" void "
- "___clang_objc_object_check(uint8_t *obj)"
+ "$__lldb_objc_object_check(uint8_t *obj)"
"{"
""
"}";
@@ -97,8 +94,8 @@
DynamicCheckerFunctions::Install(Stream &error_stream,
ExecutionContext &exe_ctx)
{
- m_valid_pointer_check.reset(new ClangUtilityFunction(valid_pointer_check_text,
- valid_pointer_check_name));
+ m_valid_pointer_check.reset(new ClangUtilityFunction(g_valid_pointer_check_text,
+ VALID_POINTER_CHECK_NAME));
if (!m_valid_pointer_check->Install(error_stream, exe_ctx))
return false;