From 4e6b8579221c67b83901bcc621d330e7e99a9294 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Fri, 12 Apr 2019 12:54:52 +0000 Subject: Revert r358268 "[DebugInfo] DW_OP_deref_size in PrologEpilogInserter." It causes clang to crash while building Chromium. See https://crbug.com/952230 for reproducer. > The PrologEpilogInserter need to insert a DW_OP_deref_size before > prepending a memory location expression to an already implicit > expression to avoid having the existing expression act on the memory > address instead of the value behind it. > > The reason for using DW_OP_deref_size and not plain DW_OP_deref is that > big-endian targets need to read the right size as simply truncating a > larger read would yield the wrong result (LSB bytes are not at the lower > address). > > Differential Revision: https://reviews.llvm.org/D59687 llvm-svn: 358281 --- llvm/lib/IR/DebugInfoMetadata.cpp | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'llvm/lib/IR/DebugInfoMetadata.cpp') diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp index 4ef38b6f7fe..7158e5764fa 100644 --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -833,7 +833,6 @@ unsigned DIExpression::ExprOperand::getSize() const { case dwarf::DW_OP_LLVM_fragment: return 3; case dwarf::DW_OP_constu: - case dwarf::DW_OP_deref_size: case dwarf::DW_OP_plus_uconst: return 2; default: @@ -890,7 +889,6 @@ bool DIExpression::isValid() const { case dwarf::DW_OP_shr: case dwarf::DW_OP_shra: case dwarf::DW_OP_deref: - case dwarf::DW_OP_deref_size: case dwarf::DW_OP_xderef: case dwarf::DW_OP_lit0: case dwarf::DW_OP_not: @@ -901,19 +899,6 @@ bool DIExpression::isValid() const { return true; } -bool DIExpression::isImplicit() const { - unsigned N = getNumElements(); - if (isValid() && N > 0) { - switch (getElement(N-1)) { - case dwarf::DW_OP_stack_value: return true; - case dwarf::DW_OP_LLVM_fragment: - return N > 1 && getElement(N-2) == dwarf::DW_OP_stack_value; - default: break; - } - } - return false; -} - Optional DIExpression::getFragmentInfo(expr_op_iterator Start, expr_op_iterator End) { for (auto I = Start; I != End; ++I) -- cgit v1.2.3