mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 10:58:11 +08:00
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
This commit is contained in:
@@ -22,19 +22,16 @@ ClangPersistentVariables::ClangPersistentVariables () :
|
||||
}
|
||||
|
||||
void
|
||||
ClangPersistentVariables::GetNextResultName (std::string &name)
|
||||
ClangPersistentVariables::GetNextResultName (ConstString &name)
|
||||
{
|
||||
StreamString s;
|
||||
s.Printf("$%llu", m_result_counter);
|
||||
|
||||
m_result_counter++;
|
||||
|
||||
name = s.GetString();
|
||||
char result_name[256];
|
||||
::snprintf (result_name, sizeof(result_name), "$%llu", m_result_counter++);
|
||||
name.SetCString(result_name);
|
||||
}
|
||||
|
||||
bool
|
||||
ClangPersistentVariables::CreatePersistentVariable(const char *name,
|
||||
TypeFromUser user_type)
|
||||
ClangPersistentVariables::CreatePersistentVariable (const ConstString &name,
|
||||
TypeFromUser user_type)
|
||||
{
|
||||
if (GetVariable(name))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user