[Lldb-commits] [lldb] r368802 - [lldb] Reinstate original guard variable check

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 13 22:52:33 PDT 2019


Author: teemperor
Date: Tue Aug 13 22:52:33 2019
New Revision: 368802

URL: http://llvm.org/viewvc/llvm-project?rev=368802&view=rev
Log:
[lldb] Reinstate original guard variable check

The isGuardVariableSymbol option for ignoring Microsoft's ABI
was originally added to get the bots green, but now that we found
the actual issue (that we checked for prefix instead of suffix
in the MS ABI check), we should be able to properly implement
the guard variable check without any strange Microsoft exceptions.

Modified:
    lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp?rev=368802&r1=368801&r2=368802&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp Tue Aug 13 22:52:33 2019
@@ -156,12 +156,9 @@ clang::NamedDecl *IRForTarget::DeclForGl
 }
 
 /// Returns true iff the mangled symbol is for a static guard variable.
-static bool isGuardVariableSymbol(llvm::StringRef mangled_symbol,
-                                  bool check_ms_abi = true) {
-  bool result = mangled_symbol.startswith("_ZGV"); // Itanium ABI guard variable
-  if (check_ms_abi)
-    result |= mangled_symbol.endswith("@4IA"); // Microsoft ABI
-  return result;
+static bool isGuardVariableSymbol(llvm::StringRef mangled_symbol) {
+  return mangled_symbol.startswith("_ZGV") || // Itanium ABI
+         mangled_symbol.endswith("@4IA");     // Microsoft ABI
 }
 
 bool IRForTarget::CreateResultVariable(llvm::Function &llvm_function) {
@@ -181,9 +178,8 @@ bool IRForTarget::CreateResultVariable(l
   for (StringMapEntry<llvm::Value *> &value_symbol : value_symbol_table) {
     result_name = value_symbol.first();
 
-    // Check if this is a guard variable. It seems this causes some hiccups
-    // on Windows, so let's only check for Itanium guard variables.
-    bool is_guard_var = isGuardVariableSymbol(result_name, /*MS ABI*/ false);
+    // Check if this is a guard variable.
+    const bool is_guard_var = isGuardVariableSymbol(result_name);
 
     if (result_name.contains("$__lldb_expr_result_ptr") && !is_guard_var) {
       found_result = true;




More information about the lldb-commits mailing list