Fixed some minor style issues in rLLDB359921 [NFC]
authorRaphael Isemann <teemperor@gmail.com>
Fri, 3 May 2019 21:01:45 +0000 (21:01 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Fri, 3 May 2019 21:01:45 +0000 (21:01 +0000)
Ran clang-format on the added test file and use the new StringRef
comparison over the temporary ConstStrings. Also aligned the
end of one of the code string literals.

llvm-svn: 359931

lldb/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp

index cd1bac3..5e8237e 100644 (file)
@@ -1,21 +1,21 @@
 namespace error {
-  int x;
+int x;
 }
 
 struct A {
   void foo() {
-    int error=1;
+    int error = 1;
 
     return; // break here
   }
 };
 
 int main() {
int error=1;
 int error = 1;
 
- A a;
 A a;
 
- a.foo();
 a.foo();
 
- return 0; // break here
 return 0; // break here
 }
index ce604aa..39ee8f7 100644 (file)
@@ -210,18 +210,18 @@ static void AddLocalVariableDecls(const lldb::VariableListSP &var_list_sp,
 
     // We can check for .block_descriptor w/o checking for langauge since this
     // is not a valid identifier in either C or C++.
-    if (!var_name || var_name == ConstString(".block_descriptor"))
+    if (!var_name || var_name == ".block_descriptor")
       continue;
 
     if (!expr.empty() && !ExprBodyContainsVar(expr, var_name.GetStringRef()))
       continue;
 
-    if ((var_name == ConstString("self") || var_name == ConstString("_cmd")) &&
+    if ((var_name == "self" || var_name == "_cmd") &&
         (wrapping_language == lldb::eLanguageTypeObjC ||
          wrapping_language == lldb::eLanguageTypeObjC_plus_plus))
       continue;
 
-    if (var_name == ConstString("this") &&
+    if (var_name == "this" &&
         wrapping_language == lldb::eLanguageTypeC_plus_plus)
       continue;
 
@@ -405,7 +405,7 @@ bool ClangExpressionSourceCode::GetText(
             "@implementation $__lldb_objc_class ($__lldb_category)  \n"
             "-(void)%s:(void *)$__lldb_arg                          \n"
             "{                                                      \n"
-            "    %s;                                                 \n"
+            "    %s;                                                \n"
             "%s"
             "}                                                      \n"
             "@end                                                   \n",