Add support for global types and type resolution. Fix several minor
formatting and spacing bugs. This is sufficient for llvm-upgrade to
correctly upgrade all of llvm/test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32114 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvm-upgrade/ParserInternals.h b/tools/llvm-upgrade/ParserInternals.h
index faa66c2..5dcdce8 100644
--- a/tools/llvm-upgrade/ParserInternals.h
+++ b/tools/llvm-upgrade/ParserInternals.h
@@ -42,7 +42,7 @@
enum Types {
BoolTy, SByteTy, UByteTy, ShortTy, UShortTy, IntTy, UIntTy, LongTy, ULongTy,
FloatTy, DoubleTy, PointerTy, PackedTy, ArrayTy, StructTy, OpaqueTy, VoidTy,
- LabelTy, FunctionTy
+ LabelTy, FunctionTy, UnresolvedTy, NumericTy
};
/// This type is used to keep track of the signedness of the obsolete
@@ -56,28 +56,28 @@
std::string* newTy;
Types oldTy;
- void destroy() { delete newTy; }
+ void destroy() const { delete newTy; }
- bool isSigned() {
+ bool isSigned() const {
return oldTy == SByteTy || oldTy == ShortTy ||
oldTy == IntTy || oldTy == LongTy;
}
- bool isUnsigned() {
+ bool isUnsigned() const {
return oldTy == UByteTy || oldTy == UShortTy ||
oldTy == UIntTy || oldTy == ULongTy;
}
- bool isSignless() { return !isSigned() && !isUnsigned(); }
- bool isInteger() { return isSigned() || isUnsigned(); }
- bool isIntegral() { return oldTy == BoolTy || isInteger(); }
- bool isFloatingPoint() { return oldTy == DoubleTy || oldTy == FloatTy; }
- bool isPacked() { return oldTy == PackedTy; }
- bool isPointer() { return oldTy == PointerTy; }
- bool isOther() { return !isPacked() && !isPointer() && !isFloatingPoint()
- && !isIntegral(); }
+ bool isSignless() const { return !isSigned() && !isUnsigned(); }
+ bool isInteger() const { return isSigned() || isUnsigned(); }
+ bool isIntegral() const { return oldTy == BoolTy || isInteger(); }
+ bool isFloatingPoint() const { return oldTy == DoubleTy || oldTy == FloatTy; }
+ bool isPacked() const { return oldTy == PackedTy; }
+ bool isPointer() const { return oldTy == PointerTy; }
+ bool isOther() const {
+ return !isPacked() && !isPointer() && !isFloatingPoint() && !isIntegral(); }
- unsigned getBitWidth() {
+ unsigned getBitWidth() const {
switch (oldTy) {
case LabelTy:
case VoidTy : return 0;