diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-01 15:14:50 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-01 15:14:50 +0000 |
commit | d06b3102115567e4c9a4cadeb9f715a529fa2c04 (patch) | |
tree | 8bd9f93a84ae9790550fc46d12484de8bfe3c02e /tools/llvm-mc | |
parent | 93ad6a837d992654a59a0f76fb1bc16134258503 (diff) | |
download | external_llvm-d06b3102115567e4c9a4cadeb9f715a529fa2c04.zip external_llvm-d06b3102115567e4c9a4cadeb9f715a529fa2c04.tar.gz external_llvm-d06b3102115567e4c9a4cadeb9f715a529fa2c04.tar.bz2 |
llvm-mc: Add some more doxyments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-mc')
-rw-r--r-- | tools/llvm-mc/AsmExpr.h | 68 |
1 files changed, 41 insertions, 27 deletions
diff --git a/tools/llvm-mc/AsmExpr.h b/tools/llvm-mc/AsmExpr.h index e8650e4..84e58ff 100644 --- a/tools/llvm-mc/AsmExpr.h +++ b/tools/llvm-mc/AsmExpr.h @@ -18,13 +18,15 @@ class MCContext; class MCSymbol; class MCValue; +/// AsmExpr - Base class for the full range of assembler expressions which are +/// needed for parsing. class AsmExpr { public: enum AsmExprKind { - Binary, /// Binary expressions. - Constant, /// Constant expressions. - SymbolRef, /// References to labels and assigned expressions. - Unary /// Unary expressions. + Binary, ///< Binary expressions. + Constant, ///< Constant expressions. + SymbolRef, ///< References to labels and assigned expressions. + Unary ///< Unary expressions. }; private: @@ -45,7 +47,7 @@ public: bool EvaluateAsAbsolute(MCContext &Ctx, int64_t &Res) const; /// EvaluateAsRelocatable - Try to evaluate the expression to a relocatable - /// value. + /// value, i.e. an expression of the fixed form (a - b + constant). /// /// @param Res - The relocatable value, if evaluation succeeds. /// @result - True on success. @@ -54,6 +56,7 @@ public: static bool classof(const AsmExpr *) { return true; } }; +//// AsmConstantExpr - Represent a constant integer expression. class AsmConstantExpr : public AsmExpr { int64_t Value; @@ -69,6 +72,12 @@ public: static bool classof(const AsmConstantExpr *) { return true; } }; +/// AsmSymbolRefExpr - Represent a reference to a symbol from inside an +/// expression. +/// +/// A symbol reference in an expression may be a use of a label, a use of an +/// assembler variable (defined constant), or constitute an implicit definition +/// of the symbol as external. class AsmSymbolRefExpr : public AsmExpr { MCSymbol *Symbol; @@ -84,13 +93,14 @@ public: static bool classof(const AsmSymbolRefExpr *) { return true; } }; +/// AsmUnaryExpr - Unary assembler expressions. class AsmUnaryExpr : public AsmExpr { public: enum Opcode { - LNot, /// Logical negation. - Minus, /// Unary minus. - Not, /// Bit-wise negation. - Plus /// Unary plus. + LNot, ///< Logical negation. + Minus, ///< Unary minus. + Not, ///< Bitwise negation. + Plus ///< Unary plus. }; private: @@ -114,27 +124,28 @@ public: static bool classof(const AsmUnaryExpr *) { return true; } }; +/// AsmBinaryExpr - Binary assembler expressions. class AsmBinaryExpr : public AsmExpr { public: enum Opcode { - Add, /// Addition. - And, /// Bitwise and. - Div, /// Division. - EQ, /// Equality comparison. - GT, /// Greater than comparison. - GTE, /// Greater than or equal comparison. - LAnd, /// Logical and. - LOr, /// Logical or. - LT, /// Less than comparison. - LTE, /// Less than or equal comparison. - Mod, /// Modulus. - Mul, /// Multiplication. - NE, /// Inequality comparison. - Or, /// Bitwise or. - Shl, /// Bitwise shift left. - Shr, /// Bitwise shift right. - Sub, /// Subtraction. - Xor /// Bitwise exclusive or. + Add, ///< Addition. + And, ///< Bitwise and. + Div, ///< Division. + EQ, ///< Equality comparison. + GT, ///< Greater than comparison. + GTE, ///< Greater than or equal comparison. + LAnd, ///< Logical and. + LOr, ///< Logical or. + LT, ///< Less than comparison. + LTE, ///< Less than or equal comparison. + Mod, ///< Modulus. + Mul, ///< Multiplication. + NE, ///< Inequality comparison. + Or, ///< Bitwise or. + Shl, ///< Bitwise shift left. + Shr, ///< Bitwise shift right. + Sub, ///< Subtraction. + Xor ///< Bitwise exclusive or. }; private: @@ -151,7 +162,10 @@ public: Opcode getOpcode() const { return Op; } + /// getLHS - Get the left-hand side expression of the binary operator. AsmExpr *getLHS() const { return LHS; } + + /// getRHS - Get the right-hand side expression of the binary operator. AsmExpr *getRHS() const { return RHS; } static bool classof(const AsmExpr *E) { |