2 * See the dyninst/COPYRIGHT file for copyright information.
4 * We provide the Paradyn Tools (below described as "Paradyn")
5 * on an AS IS basis, and do not warrant its validity or performance.
6 * We reserve the right to update, modify, or discontinue this
7 * software at any time. We shall have no obligation to supply such
8 * updates or modifications or any other form of support to you.
10 * By your use of Paradyn, you understand and agree that we (or any
11 * other person or entity with proprietary rights in Paradyn) are
12 * under no obligation to provide either maintenance services,
13 * update services, notices of latent defects, or correction of
14 * defects for Paradyn.
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
31 #if !defined(IMMEDIATE_H)
34 #include "Expression.h"
39 namespace InstructionAPI
41 /// The %Immediate class represents an immediate value in an operand
43 /// Since an %Immediate represents a constant value, the \c setValue
44 /// and \c clearValue interface are disabled on %Immediate objects.
45 /// If an immediate value is being modified, a new %Immediate object should
46 /// be created to represent the new value.
47 class INSTRUCTION_EXPORT Immediate : public Expression
50 Immediate(const Result& val);
54 /// By definition, an %Immediate has no children.
55 virtual void getChildren(vector<InstructionAST::Ptr>& /*children*/) const;
56 virtual void getChildren(vector<Expression::Ptr>& /*children*/) const;
58 /// By definition, an %Immediate uses no registers.
59 virtual void getUses(set<InstructionAST::Ptr>& /*uses*/);
61 /// \c isUsed, when called on an %Immediate, will return true if \c findMe represents an %Immediate with the same value.
62 /// While this convention may seem arbitrary, it allows \c isUsed to follow a natural rule: an %InstructionAST is used
63 /// by another %InstructionAST if and only if the first %InstructionAST is a subtree of the second one.
64 virtual bool isUsed(InstructionAST::Ptr findMe) const;
66 virtual std::string format(formatStyle) const;
67 static Immediate::Ptr makeImmediate(const Result& val);
68 virtual void apply(Visitor* v);
71 virtual bool isStrictEqual(const InstructionAST& rhs) const;
81 #endif // !defined(IMMEDIATE_H)