rename IntegerConstant->IntegerLiteral

rename FloatingConstant->FloatingLiteral
rename StringExpr->StringLiteral

llvm-svn: 39341
This commit is contained in:
Steve Naroff 2007-02-21 22:05:47 +00:00
parent bf313b0bb2
commit ab62488ae3
10 changed files with 32 additions and 29 deletions

View File

@ -155,8 +155,8 @@ public:
bool HasTrailingLParen);
virtual ExprResult ParseSimplePrimaryExpr(SourceLocation Loc,
tok::TokenKind Kind);
virtual ExprResult ParseIntegerConstant(SourceLocation Loc);
virtual ExprResult ParseFloatingConstant(SourceLocation Loc);
virtual ExprResult ParseStringLiteral(SourceLocation Loc);
virtual ExprResult ParseFloatingLiteral(SourceLocation Loc);
virtual ExprResult ParseParenExpr(SourceLocation L, SourceLocation R,
ExprTy *Val);

View File

@ -285,11 +285,11 @@ Sema::ExprResult Sema::ParseSimplePrimaryExpr(SourceLocation Loc,
}
}
Sema::ExprResult Sema::ParseIntegerConstant(SourceLocation Loc) {
return new IntegerConstant();
Sema::ExprResult Sema::ParseStringLiteral(SourceLocation Loc) {
return new StringLiteral();
}
Sema::ExprResult Sema::ParseFloatingConstant(SourceLocation Loc) {
return new FloatingConstant();
Sema::ExprResult Sema::ParseFloatingLiteral(SourceLocation Loc) {
return new FloatingLiteral();
}
Action::ExprResult Sema::ParseParenExpr(SourceLocation L, SourceLocation R,
@ -339,7 +339,7 @@ ParseSizeOfAlignOfTypeExpr(SourceLocation OpLoc, bool isSizeof,
if (isa<FunctionType>(ArgTy) && isSizeof) {
// alignof(function) is allowed.
Diag(OpLoc, diag::ext_sizeof_function_type);
return new IntegerConstant(/*1*/);
return new StringLiteral(/*1*/);
} else if (ArgTy->isVoidType()) {
Diag(OpLoc, diag::ext_sizeof_void_type, isSizeof ? "sizeof" : "__alignof");
} else if (ArgTy->isIncompleteType()) {
@ -347,7 +347,7 @@ ParseSizeOfAlignOfTypeExpr(SourceLocation OpLoc, bool isSizeof,
ArgTy->getAsString(TypeName);
Diag(OpLoc, isSizeof ? diag::err_sizeof_incomplete_type :
diag::err_alignof_incomplete_type, TypeName);
return new IntegerConstant(/*0*/);
return new StringLiteral(/*0*/);
}
return new SizeOfAlignOfTypeExpr(isSizeof, ArgTy);

View File

@ -215,11 +215,11 @@ void StmtPrinter::VisitDeclRefExpr(DeclRefExpr *Node) {
OS << Node->getDecl()->getName();
}
void StmtPrinter::VisitIntegerConstant(IntegerConstant *Node) {
void StmtPrinter::VisitStringLiteral(StringLiteral *Node) {
// FIXME: print value.
OS << "1";
}
void StmtPrinter::VisitFloatingConstant(FloatingConstant *Node) {
void StmtPrinter::VisitFloatingLiteral(FloatingLiteral *Node) {
// FIXME: print value.
OS << "1.0";
}

View File

@ -476,9 +476,9 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) {
// TODO: Validate whether this is an integer or floating-constant or
// neither.
if (1) {
Res = Actions.ParseIntegerConstant(Tok.getLocation());
Res = Actions.ParseStringLiteral(Tok.getLocation());
} else {
Res = Actions.ParseFloatingConstant(Tok.getLocation());
Res = Actions.ParseFloatingLiteral(Tok.getLocation());
}
ConsumeToken();

View File

@ -155,8 +155,8 @@ public:
bool HasTrailingLParen);
virtual ExprResult ParseSimplePrimaryExpr(SourceLocation Loc,
tok::TokenKind Kind);
virtual ExprResult ParseIntegerConstant(SourceLocation Loc);
virtual ExprResult ParseFloatingConstant(SourceLocation Loc);
virtual ExprResult ParseStringLiteral(SourceLocation Loc);
virtual ExprResult ParseFloatingLiteral(SourceLocation Loc);
virtual ExprResult ParseParenExpr(SourceLocation L, SourceLocation R,
ExprTy *Val);

View File

@ -285,11 +285,11 @@ Sema::ExprResult Sema::ParseSimplePrimaryExpr(SourceLocation Loc,
}
}
Sema::ExprResult Sema::ParseIntegerConstant(SourceLocation Loc) {
return new IntegerConstant();
Sema::ExprResult Sema::ParseStringLiteral(SourceLocation Loc) {
return new StringLiteral();
}
Sema::ExprResult Sema::ParseFloatingConstant(SourceLocation Loc) {
return new FloatingConstant();
Sema::ExprResult Sema::ParseFloatingLiteral(SourceLocation Loc) {
return new FloatingLiteral();
}
Action::ExprResult Sema::ParseParenExpr(SourceLocation L, SourceLocation R,
@ -339,7 +339,7 @@ ParseSizeOfAlignOfTypeExpr(SourceLocation OpLoc, bool isSizeof,
if (isa<FunctionType>(ArgTy) && isSizeof) {
// alignof(function) is allowed.
Diag(OpLoc, diag::ext_sizeof_function_type);
return new IntegerConstant(/*1*/);
return new StringLiteral(/*1*/);
} else if (ArgTy->isVoidType()) {
Diag(OpLoc, diag::ext_sizeof_void_type, isSizeof ? "sizeof" : "__alignof");
} else if (ArgTy->isIncompleteType()) {
@ -347,7 +347,7 @@ ParseSizeOfAlignOfTypeExpr(SourceLocation OpLoc, bool isSizeof,
ArgTy->getAsString(TypeName);
Diag(OpLoc, isSizeof ? diag::err_sizeof_incomplete_type :
diag::err_alignof_incomplete_type, TypeName);
return new IntegerConstant(/*0*/);
return new StringLiteral(/*0*/);
}
return new SizeOfAlignOfTypeExpr(isSizeof, ArgTy);

View File

@ -199,7 +199,7 @@
DEC8DABF0A94402500353FCA /* ASTStreamer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ASTStreamer.h; path = clang/AST/ASTStreamer.h; sourceTree = "<group>"; };
DED626C80AE0C065001E80A4 /* TargetInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetInfo.cpp; sourceTree = "<group>"; };
DED627020AE0C51D001E80A4 /* Targets.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Targets.cpp; path = Driver/Targets.cpp; sourceTree = "<group>"; };
DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Decl.cpp; path = AST/Decl.cpp; sourceTree = "<group>"; };
DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Decl.cpp; path = AST/Decl.cpp; sourceTree = "<group>"; usesTabs = 1; };
DED676D00B6C786700AAD4A3 /* Builtins.def */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = Builtins.def; path = clang/AST/Builtins.def; sourceTree = "<group>"; };
DED676F90B6C797B00AAD4A3 /* Builtins.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Builtins.h; path = clang/AST/Builtins.h; sourceTree = "<group>"; };
DED677C80B6C854100AAD4A3 /* Builtins.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Builtins.cpp; path = AST/Builtins.cpp; sourceTree = "<group>"; };
@ -472,9 +472,12 @@
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
projectDirPath = "";
projectRoot = "";
shouldCheckCompatibility = 1;
targets = (
8DD76F620486A84900D96B5E /* clang */,
);

View File

@ -51,15 +51,15 @@ public:
virtual void visit(StmtVisitor &Visitor);
};
class IntegerConstant : public Expr {
class StringLiteral : public Expr {
public:
IntegerConstant() {}
StringLiteral() {}
virtual void visit(StmtVisitor &Visitor);
};
class FloatingConstant : public Expr {
class FloatingLiteral : public Expr {
public:
FloatingConstant() {}
FloatingLiteral() {}
virtual void visit(StmtVisitor &Visitor);
};

View File

@ -30,8 +30,8 @@ STMT(ReturnStmt , Stmt)
// Expressions.
STMT(Expr , Stmt)
STMT(DeclRefExpr , Expr)
STMT(IntegerConstant , Expr)
STMT(FloatingConstant , Expr)
STMT(StringLiteral , Expr)
STMT(FloatingLiteral , Expr)
STMT(StringExpr , Expr)
STMT(ParenExpr , Expr)
STMT(UnaryOperator , Expr)

View File

@ -263,8 +263,8 @@ public:
tok::TokenKind Kind) {
return 0;
}
virtual ExprResult ParseIntegerConstant(SourceLocation Loc) { return 0; }
virtual ExprResult ParseFloatingConstant(SourceLocation Loc) { return 0; }
virtual ExprResult ParseStringLiteral(SourceLocation Loc) { return 0; }
virtual ExprResult ParseFloatingLiteral(SourceLocation Loc) { return 0; }
/// ParseStringExpr - The specified tokens were lexed as pasted string
/// fragments (e.g. "foo" "bar" L"baz").