Skip to content

Commit afd493e

Browse files
committed
[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. llvm-svn: 368802
1 parent 491ca24 commit afd493e

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,9 @@ clang::NamedDecl *IRForTarget::DeclForGlobal(GlobalValue *global_val) {
156156
}
157157

158158
/// Returns true iff the mangled symbol is for a static guard variable.
159-
static bool isGuardVariableSymbol(llvm::StringRef mangled_symbol,
160-
bool check_ms_abi = true) {
161-
bool result = mangled_symbol.startswith("_ZGV"); // Itanium ABI guard variable
162-
if (check_ms_abi)
163-
result |= mangled_symbol.endswith("@4IA"); // Microsoft ABI
164-
return result;
159+
static bool isGuardVariableSymbol(llvm::StringRef mangled_symbol) {
160+
return mangled_symbol.startswith("_ZGV") || // Itanium ABI
161+
mangled_symbol.endswith("@4IA"); // Microsoft ABI
165162
}
166163

167164
bool IRForTarget::CreateResultVariable(llvm::Function &llvm_function) {
@@ -181,9 +178,8 @@ bool IRForTarget::CreateResultVariable(llvm::Function &llvm_function) {
181178
for (StringMapEntry<llvm::Value *> &value_symbol : value_symbol_table) {
182179
result_name = value_symbol.first();
183180

184-
// Check if this is a guard variable. It seems this causes some hiccups
185-
// on Windows, so let's only check for Itanium guard variables.
186-
bool is_guard_var = isGuardVariableSymbol(result_name, /*MS ABI*/ false);
181+
// Check if this is a guard variable.
182+
const bool is_guard_var = isGuardVariableSymbol(result_name);
187183

188184
if (result_name.contains("$__lldb_expr_result_ptr") && !is_guard_var) {
189185
found_result = true;

0 commit comments

Comments
 (0)