зеркало из https://github.com/microsoft/clang-1.git
Added UnaryOperator::isPrefix().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53963 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
a32980435a
Коммит
5a56ac30d0
|
@ -481,6 +481,10 @@ public:
|
|||
/// isPostfix - Return true if this is a postfix operation, like x++.
|
||||
static bool isPostfix(Opcode Op);
|
||||
|
||||
/// isPostfix - Return true if this is a prefix operation, like --x.
|
||||
static bool isPrefix(Opcode Op);
|
||||
|
||||
bool isPrefix() const { return isPrefix(Opc); }
|
||||
bool isPostfix() const { return isPostfix(Opc); }
|
||||
bool isIncrementOp() const {return Opc==PreInc || Opc==PostInc; }
|
||||
bool isIncrementDecrementOp() const { return Opc>=PostInc && Opc<=PreDec; }
|
||||
|
|
|
@ -61,6 +61,16 @@ bool UnaryOperator::isPostfix(Opcode Op) {
|
|||
}
|
||||
}
|
||||
|
||||
bool UnaryOperator::isPrefix(Opcode Op) {
|
||||
switch (Op) {
|
||||
case PreInc:
|
||||
case PreDec:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// getOpcodeStr - Turn an Opcode enum value into the punctuation char it
|
||||
/// corresponds to, e.g. "sizeof" or "[pre]++".
|
||||
const char *UnaryOperator::getOpcodeStr(Opcode Op) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче