Added UnaryOperator::isPrefix().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53963 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index de0c740..6c7d170 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -61,6 +61,16 @@
   }
 }
 
+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) {