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
This commit is contained in:
Reid Spencer
2006-12-02 04:11:07 +00:00
parent 97af751deb
commit a50d5962ed
11 changed files with 877 additions and 603 deletions

View File

@@ -42,7 +42,7 @@ int yyerror(const char *ErrorMsg) ;
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 @@ struct TypeInfo {
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;