diff options
author | Greg Clayton <gclayton@apple.com> | 2010-10-15 22:48:33 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-10-15 22:48:33 +0000 |
commit | 7b462cc18a9624805d16a240fb870ca7f917d727 (patch) | |
tree | 61df6c5862241d671d1d118ee87b0bf7e1a278c4 /lldb/source/Expression/IRDynamicChecks.cpp | |
parent | e2f8841d340bb755de8e3dbc96eb1d4ec84cae98 (diff) | |
download | bcm5719-llvm-7b462cc18a9624805d16a240fb870ca7f917d727.tar.gz bcm5719-llvm-7b462cc18a9624805d16a240fb870ca7f917d727.zip |
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.
llvm-svn: 116634
Diffstat (limited to 'lldb/source/Expression/IRDynamicChecks.cpp')
-rw-r--r-- | lldb/source/Expression/IRDynamicChecks.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/lldb/source/Expression/IRDynamicChecks.cpp b/lldb/source/Expression/IRDynamicChecks.cpp index 53cabcb11fa..2a21db523a6 100644 --- a/lldb/source/Expression/IRDynamicChecks.cpp +++ b/lldb/source/Expression/IRDynamicChecks.cpp @@ -26,18 +26,15 @@ using namespace lldb_private; 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 @@ static const char *objc_object_check_text(ExecutionContext &exe_ctx) 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 @@ static const char *objc_object_check_text(ExecutionContext &exe_ctx) 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 @@ static const char *objc_object_check_text(ExecutionContext &exe_ctx) else { return "extern \"C\" void " - "___clang_objc_object_check(uint8_t *obj)" + "$__lldb_objc_object_check(uint8_t *obj)" "{" "" "}"; @@ -97,8 +94,8 @@ bool 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; |