X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1fc042e8bc9c51f9267fa1936deaebe59ae01ee7..1610a3a014ca193868cd6ed987728201c15b423c:/src/mc/DwarfExpression.cpp diff --git a/src/mc/DwarfExpression.cpp b/src/mc/DwarfExpression.cpp index bfa4f16611..31852a6719 100644 --- a/src/mc/DwarfExpression.cpp +++ b/src/mc/DwarfExpression.cpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2014-2017. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -7,10 +6,6 @@ #include #include -#include -#include -#include - #include "src/mc/AddressSpace.hpp" #include "src/mc/DwarfExpression.hpp" #include "src/mc/Frame.hpp" @@ -24,8 +19,6 @@ using simgrid::mc::remote; namespace simgrid { namespace dwarf { -evaluation_error::~evaluation_error() noexcept(true) {} - void execute( const Dwarf_Op* ops, std::size_t n, const ExpressionContext& context, ExpressionStack& stack) @@ -33,6 +26,8 @@ void execute( for (size_t i = 0; i != n; ++i) { const Dwarf_Op *op = ops + i; std::uint8_t atom = op->atom; + intptr_t first; + intptr_t second; switch (atom) { @@ -206,19 +201,17 @@ void execute( // and replace the top of the stack with the computed value // (stack.top() += stack.before_top()). - case DW_OP_plus: { - intptr_t first = stack.pop(); - intptr_t second = stack.pop(); + case DW_OP_plus: + first = stack.pop(); + second = stack.pop(); stack.push(first + second); break; - } - case DW_OP_mul: { - intptr_t first = stack.pop(); - intptr_t second = stack.pop(); + case DW_OP_mul: + first = stack.pop(); + second = stack.pop(); stack.push(first * second); break; - } case DW_OP_plus_uconst: stack.top() += op->number; @@ -232,33 +225,29 @@ void execute( stack.top() = - (intptr_t) stack.top(); break; - case DW_OP_minus: { - intptr_t first = stack.pop(); - intptr_t second = stack.pop(); + case DW_OP_minus: + first = stack.pop(); + second = stack.pop(); stack.push(second - first); break; - } - case DW_OP_and: { - intptr_t first = stack.pop(); - intptr_t second = stack.pop(); + case DW_OP_and: + first = stack.pop(); + second = stack.pop(); stack.push(first & second); break; - } - case DW_OP_or: { - intptr_t first = stack.pop(); - intptr_t second = stack.pop(); + case DW_OP_or: + first = stack.pop(); + second = stack.pop(); stack.push(first | second); break; - } - case DW_OP_xor: { - intptr_t first = stack.pop(); - intptr_t second = stack.pop(); + case DW_OP_xor: + first = stack.pop(); + second = stack.pop(); stack.push(first ^ second); break; - } case DW_OP_nop: break;