Skip to content

Commit 66214b5

Browse files
committed
Revert "[lldb] Reinstate original guard variable check"
It seems this breaks the following tests: lldb-Suite :: expression_command/call-function/TestCallUserDefinedFunction.py lldb-Suite :: expression_command/rdar42038760/TestScalarURem.py Let's revert this patch and wait until we find an actual issue that could be fixed by also doing the guard variable check on Windows. llvm-svn: 368920
1 parent 710ebb0 commit 66214b5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,12 @@ 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-
return mangled_symbol.startswith("_ZGV") || // Itanium ABI
161-
mangled_symbol.endswith("@4IA"); // Microsoft ABI
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;
162165
}
163166

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

181-
// Check if this is a guard variable.
182-
const bool is_guard_var = isGuardVariableSymbol(result_name);
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);
183187

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

0 commit comments

Comments
 (0)