summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ExpressionSourceCode.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2016-04-29 18:09:03 +0000
committerSean Callanan <scallanan@apple.com>2016-04-29 18:09:03 +0000
commit7736a208b8958a7e708c0756bdce40437f8f48f6 (patch)
tree47114371e62e174ee586383cdc704cdf0cc1a9d4 /lldb/source/Expression/ExpressionSourceCode.cpp
parent327b06400fc208fbd2da720383733d09568ae5f3 (diff)
downloadbcm5719-llvm-7736a208b8958a7e708c0756bdce40437f8f48f6.tar.gz
bcm5719-llvm-7736a208b8958a7e708c0756bdce40437f8f48f6.zip
[fix] Fixed a bug where const this would cause parser errors about $__lldb_expr.
In templated const functions, trying to run an expression would produce the error error: out-of-line definition of '$__lldb_expr' does not match any declaration in 'foo' member declaration does not match because it is const qualified error: 1 error parsing expression which is no good. It turned out we don't actually need to worry about "const," we just need to be consistent about the declaration of the expression and the FunctionDecl we inject into the class for "this." Also added a test case. <rdar://problem/24985958> llvm-svn: 268083
Diffstat (limited to 'lldb/source/Expression/ExpressionSourceCode.cpp')
-rw-r--r--lldb/source/Expression/ExpressionSourceCode.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Expression/ExpressionSourceCode.cpp b/lldb/source/Expression/ExpressionSourceCode.cpp
index 14e98105b8a..d82ed608407 100644
--- a/lldb/source/Expression/ExpressionSourceCode.cpp
+++ b/lldb/source/Expression/ExpressionSourceCode.cpp
@@ -195,7 +195,7 @@ AddLocalVariableDecls(const lldb::VariableListSP &var_list_sp, StreamString &str
}
}
-bool ExpressionSourceCode::GetText (std::string &text, lldb::LanguageType wrapping_language, bool const_object, bool static_method, ExecutionContext &exe_ctx) const
+bool ExpressionSourceCode::GetText (std::string &text, lldb::LanguageType wrapping_language, bool static_method, ExecutionContext &exe_ctx) const
{
const char *target_specific_defines = "typedef signed char BOOL;\n";
std::string module_macros;
@@ -337,13 +337,12 @@ bool ExpressionSourceCode::GetText (std::string &text, lldb::LanguageType wrappi
break;
case lldb::eLanguageTypeC_plus_plus:
wrap_stream.Printf("void \n"
- "$__lldb_class::%s(void *$__lldb_arg) %s\n"
+ "$__lldb_class::%s(void *$__lldb_arg) \n"
"{ \n"
" %s; \n"
"%s"
"} \n",
m_name.c_str(),
- (const_object ? "const" : ""),
lldb_local_var_decls.GetData(),
tagged_body.c_str());
break;
OpenPOWER on IntegriCloud