[cfe-commits] r39342 - in /cfe/cfe/trunk: AST/Expr.cpp AST/Sema.h AST/SemaExpr.cpp AST/StmtPrinter.cpp Parse/ParseExpr.cpp Sema/Sema.h Sema/SemaExpr.cpp include/clang/AST/Expr.h include/clang/AST/StmtNodes.def include/clang/Parse/Action.h

snaroff at cs.uiuc.edu snaroff at cs.uiuc.edu
Wed Jul 11 09:43:21 PDT 2007


Author: snaroff
Date: Wed Jul 11 11:43:21 2007
New Revision: 39342

URL: http://llvm.org/viewvc/llvm-project?rev=39342&view=rev
Log:
Batch search/replace snafu (inadvertantly changed IntegerConstant->StringLiteral).
clang still compiled/linked/ran properly...simply a confusing name regression.
>From now on I'll make sure I run "cvs diff" before committing any changes!

Modified:
    cfe/cfe/trunk/AST/Expr.cpp
    cfe/cfe/trunk/AST/Sema.h
    cfe/cfe/trunk/AST/SemaExpr.cpp
    cfe/cfe/trunk/AST/StmtPrinter.cpp
    cfe/cfe/trunk/Parse/ParseExpr.cpp
    cfe/cfe/trunk/Sema/Sema.h
    cfe/cfe/trunk/Sema/SemaExpr.cpp
    cfe/cfe/trunk/include/clang/AST/Expr.h
    cfe/cfe/trunk/include/clang/AST/StmtNodes.def
    cfe/cfe/trunk/include/clang/Parse/Action.h

Modified: cfe/cfe/trunk/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Expr.cpp?rev=39342&r1=39341&r2=39342&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Expr.cpp (original)
+++ cfe/cfe/trunk/AST/Expr.cpp Wed Jul 11 11:43:21 2007
@@ -21,8 +21,8 @@
 // Primary Expressions.
 //===----------------------------------------------------------------------===//
 
-StringExpr::StringExpr(const char *strData, unsigned byteLength, bool Wide) {
-  // OPTIMIZE: could allocate this appended to the StringExpr.
+StringLiteral::StringLiteral(const char *strData, unsigned byteLength, bool Wide) {
+  // OPTIMIZE: could allocate this appended to the StringLiteral.
   char *AStrData = new char[byteLength];
   memcpy(AStrData, strData, byteLength);
   StrData = AStrData;
@@ -30,7 +30,7 @@
   IsWide = Wide;
 }
 
-StringExpr::~StringExpr() {
+StringLiteral::~StringLiteral() {
   delete[] StrData;
 }
 

Modified: cfe/cfe/trunk/AST/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Sema.h?rev=39342&r1=39341&r2=39342&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Sema.h (original)
+++ cfe/cfe/trunk/AST/Sema.h Wed Jul 11 11:43:21 2007
@@ -155,14 +155,14 @@
                                          bool HasTrailingLParen);
   virtual ExprResult ParseSimplePrimaryExpr(SourceLocation Loc,
                                             tok::TokenKind Kind);
-  virtual ExprResult ParseStringLiteral(SourceLocation Loc);
+  virtual ExprResult ParseIntegerLiteral(SourceLocation Loc);
   virtual ExprResult ParseFloatingLiteral(SourceLocation Loc);
   virtual ExprResult ParseParenExpr(SourceLocation L, SourceLocation R,
                                     ExprTy *Val);
 
-  /// ParseStringExpr - The specified tokens were lexed as pasted string
+  /// ParseStringLiteral - The specified tokens were lexed as pasted string
   /// fragments (e.g. "foo" "bar" L"baz").
-  virtual ExprResult ParseStringExpr(const LexerToken *Toks, unsigned NumToks);
+  virtual ExprResult ParseStringLiteral(const LexerToken *Toks, unsigned NumToks);
     
   // Binary/Unary Operators.  'Tok' is the token for the operator.
   virtual ExprResult ParseUnaryOp(SourceLocation OpLoc, tok::TokenKind Op,

Modified: cfe/cfe/trunk/AST/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/SemaExpr.cpp?rev=39342&r1=39341&r2=39342&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/SemaExpr.cpp (original)
+++ cfe/cfe/trunk/AST/SemaExpr.cpp Wed Jul 11 11:43:21 2007
@@ -35,14 +35,14 @@
   return -1;
 }
 
-/// ParseStringExpr - The specified tokens were lexed as pasted string
+/// ParseStringLiteral - The specified tokens were lexed as pasted string
 /// fragments (e.g. "foo" "bar" L"baz").  The result string has to handle string
 /// concatenation ([C99 5.1.1.2, translation phase #6]), so it may come from
 /// multiple tokens.  However, the common case is that StringToks points to one
 /// string.
 /// 
 Action::ExprResult
-Sema::ParseStringExpr(const LexerToken *StringToks, unsigned NumStringToks) {
+Sema::ParseStringLiteral(const LexerToken *StringToks, unsigned NumStringToks) {
   assert(NumStringToks && "Must have at least one string!");
 
   // Scan all of the string portions, remember the max individual token length,
@@ -236,7 +236,7 @@
   // FIXME: use factory.
   
   // Pass &StringTokLocs[0], StringTokLocs.size() to factory!
-  return new StringExpr(&ResultBuf[0], ResultPtr-&ResultBuf[0], AnyWide);
+  return new StringLiteral(&ResultBuf[0], ResultPtr-&ResultBuf[0], AnyWide);
 }
 
 
@@ -285,8 +285,8 @@
   }
 }
 
-Sema::ExprResult Sema::ParseStringLiteral(SourceLocation Loc) {
-  return new StringLiteral();
+Sema::ExprResult Sema::ParseIntegerLiteral(SourceLocation Loc) {
+  return new IntegerLiteral();
 }
 Sema::ExprResult Sema::ParseFloatingLiteral(SourceLocation Loc) {
   return new FloatingLiteral();
@@ -339,7 +339,7 @@
   if (isa<FunctionType>(ArgTy) && isSizeof) {
     // alignof(function) is allowed.
     Diag(OpLoc, diag::ext_sizeof_function_type);
-    return new StringLiteral(/*1*/);
+    return new IntegerLiteral(/*1*/);
   } else if (ArgTy->isVoidType()) {
     Diag(OpLoc, diag::ext_sizeof_void_type, isSizeof ? "sizeof" : "__alignof");
   } else if (ArgTy->isIncompleteType()) {
@@ -347,7 +347,7 @@
     ArgTy->getAsString(TypeName);
     Diag(OpLoc, isSizeof ? diag::err_sizeof_incomplete_type : 
          diag::err_alignof_incomplete_type, TypeName);
-    return new StringLiteral(/*0*/);
+    return new IntegerLiteral(/*0*/);
   }
   
   return new SizeOfAlignOfTypeExpr(isSizeof, ArgTy);

Modified: cfe/cfe/trunk/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/StmtPrinter.cpp?rev=39342&r1=39341&r2=39342&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/StmtPrinter.cpp (original)
+++ cfe/cfe/trunk/AST/StmtPrinter.cpp Wed Jul 11 11:43:21 2007
@@ -215,7 +215,7 @@
   OS << Node->getDecl()->getName();
 }
 
-void StmtPrinter::VisitStringLiteral(StringLiteral *Node) {
+void StmtPrinter::VisitIntegerLiteral(IntegerLiteral *Node) {
   // FIXME: print value.
   OS << "1";
 }
@@ -223,7 +223,7 @@
   // FIXME: print value.
   OS << "1.0";
 }
-void StmtPrinter::VisitStringExpr(StringExpr *Str) {
+void StmtPrinter::VisitStringLiteral(StringLiteral *Str) {
   if (Str->isWide()) OS << 'L';
   OS << '"';
   

Modified: cfe/cfe/trunk/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseExpr.cpp?rev=39342&r1=39341&r2=39342&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/ParseExpr.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseExpr.cpp Wed Jul 11 11:43:21 2007
@@ -476,7 +476,7 @@
     // TODO: Validate whether this is an integer or floating-constant or
     // neither.
     if (1) {
-      Res = Actions.ParseStringLiteral(Tok.getLocation());
+      Res = Actions.ParseIntegerLiteral(Tok.getLocation());
     } else {
       Res = Actions.ParseFloatingLiteral(Tok.getLocation());
     }
@@ -929,5 +929,5 @@
   } while (isTokenStringLiteral());
 
   // Pass the set of string tokens, ready for concatenation, to the actions.
-  return Actions.ParseStringExpr(&StringToks[0], StringToks.size());
+  return Actions.ParseStringLiteral(&StringToks[0], StringToks.size());
 }

Modified: cfe/cfe/trunk/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/Sema.h?rev=39342&r1=39341&r2=39342&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/Sema.h (original)
+++ cfe/cfe/trunk/Sema/Sema.h Wed Jul 11 11:43:21 2007
@@ -155,14 +155,14 @@
                                          bool HasTrailingLParen);
   virtual ExprResult ParseSimplePrimaryExpr(SourceLocation Loc,
                                             tok::TokenKind Kind);
-  virtual ExprResult ParseStringLiteral(SourceLocation Loc);
+  virtual ExprResult ParseIntegerLiteral(SourceLocation Loc);
   virtual ExprResult ParseFloatingLiteral(SourceLocation Loc);
   virtual ExprResult ParseParenExpr(SourceLocation L, SourceLocation R,
                                     ExprTy *Val);
 
-  /// ParseStringExpr - The specified tokens were lexed as pasted string
+  /// ParseStringLiteral - The specified tokens were lexed as pasted string
   /// fragments (e.g. "foo" "bar" L"baz").
-  virtual ExprResult ParseStringExpr(const LexerToken *Toks, unsigned NumToks);
+  virtual ExprResult ParseStringLiteral(const LexerToken *Toks, unsigned NumToks);
     
   // Binary/Unary Operators.  'Tok' is the token for the operator.
   virtual ExprResult ParseUnaryOp(SourceLocation OpLoc, tok::TokenKind Op,

Modified: cfe/cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaExpr.cpp?rev=39342&r1=39341&r2=39342&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaExpr.cpp Wed Jul 11 11:43:21 2007
@@ -35,14 +35,14 @@
   return -1;
 }
 
-/// ParseStringExpr - The specified tokens were lexed as pasted string
+/// ParseStringLiteral - The specified tokens were lexed as pasted string
 /// fragments (e.g. "foo" "bar" L"baz").  The result string has to handle string
 /// concatenation ([C99 5.1.1.2, translation phase #6]), so it may come from
 /// multiple tokens.  However, the common case is that StringToks points to one
 /// string.
 /// 
 Action::ExprResult
-Sema::ParseStringExpr(const LexerToken *StringToks, unsigned NumStringToks) {
+Sema::ParseStringLiteral(const LexerToken *StringToks, unsigned NumStringToks) {
   assert(NumStringToks && "Must have at least one string!");
 
   // Scan all of the string portions, remember the max individual token length,
@@ -236,7 +236,7 @@
   // FIXME: use factory.
   
   // Pass &StringTokLocs[0], StringTokLocs.size() to factory!
-  return new StringExpr(&ResultBuf[0], ResultPtr-&ResultBuf[0], AnyWide);
+  return new StringLiteral(&ResultBuf[0], ResultPtr-&ResultBuf[0], AnyWide);
 }
 
 
@@ -285,8 +285,8 @@
   }
 }
 
-Sema::ExprResult Sema::ParseStringLiteral(SourceLocation Loc) {
-  return new StringLiteral();
+Sema::ExprResult Sema::ParseIntegerLiteral(SourceLocation Loc) {
+  return new IntegerLiteral();
 }
 Sema::ExprResult Sema::ParseFloatingLiteral(SourceLocation Loc) {
   return new FloatingLiteral();
@@ -339,7 +339,7 @@
   if (isa<FunctionType>(ArgTy) && isSizeof) {
     // alignof(function) is allowed.
     Diag(OpLoc, diag::ext_sizeof_function_type);
-    return new StringLiteral(/*1*/);
+    return new IntegerLiteral(/*1*/);
   } else if (ArgTy->isVoidType()) {
     Diag(OpLoc, diag::ext_sizeof_void_type, isSizeof ? "sizeof" : "__alignof");
   } else if (ArgTy->isIncompleteType()) {
@@ -347,7 +347,7 @@
     ArgTy->getAsString(TypeName);
     Diag(OpLoc, isSizeof ? diag::err_sizeof_incomplete_type : 
          diag::err_alignof_incomplete_type, TypeName);
-    return new StringLiteral(/*0*/);
+    return new IntegerLiteral(/*0*/);
   }
   
   return new SizeOfAlignOfTypeExpr(isSizeof, ArgTy);

Modified: cfe/cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/Expr.h?rev=39342&r1=39341&r2=39342&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/cfe/trunk/include/clang/AST/Expr.h Wed Jul 11 11:43:21 2007
@@ -51,9 +51,9 @@
   virtual void visit(StmtVisitor &Visitor);
 };
 
-class StringLiteral : public Expr {
+class IntegerLiteral : public Expr {
 public:
-  StringLiteral() {}
+  IntegerLiteral() {}
   virtual void visit(StmtVisitor &Visitor);
 };
 
@@ -63,13 +63,13 @@
   virtual void visit(StmtVisitor &Visitor);
 };
 
-class StringExpr : public Expr {
+class StringLiteral : public Expr {
   const char *StrData;
   unsigned ByteLength;
   bool IsWide;
 public:
-  StringExpr(const char *strData, unsigned byteLength, bool Wide);
-  virtual ~StringExpr();
+  StringLiteral(const char *strData, unsigned byteLength, bool Wide);
+  virtual ~StringLiteral();
   
   const char *getStrData() const { return StrData; }
   unsigned getByteLength() const { return ByteLength; }

Modified: cfe/cfe/trunk/include/clang/AST/StmtNodes.def
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/StmtNodes.def?rev=39342&r1=39341&r2=39342&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/StmtNodes.def (original)
+++ cfe/cfe/trunk/include/clang/AST/StmtNodes.def Wed Jul 11 11:43:21 2007
@@ -30,9 +30,9 @@
 // Expressions.
 STMT(Expr                 , Stmt)
 STMT(DeclRefExpr          , Expr)
-STMT(StringLiteral      , Expr)
-STMT(FloatingLiteral     , Expr)
-STMT(StringExpr           , Expr)
+STMT(IntegerLiteral       , Expr)
+STMT(FloatingLiteral      , Expr)
+STMT(StringLiteral        , Expr)
 STMT(ParenExpr            , Expr)
 STMT(UnaryOperator        , Expr)
 STMT(SizeOfAlignOfTypeExpr, Expr)

Modified: cfe/cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/Action.h?rev=39342&r1=39341&r2=39342&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/Action.h Wed Jul 11 11:43:21 2007
@@ -263,12 +263,12 @@
                                             tok::TokenKind Kind) {
     return 0;
   }
-  virtual ExprResult ParseStringLiteral(SourceLocation Loc) { return 0; }
+  virtual ExprResult ParseIntegerLiteral(SourceLocation Loc) { return 0; }
   virtual ExprResult ParseFloatingLiteral(SourceLocation Loc) { return 0; }
   
-  /// ParseStringExpr - The specified tokens were lexed as pasted string
+  /// ParseStringLiteral - The specified tokens were lexed as pasted string
   /// fragments (e.g. "foo" "bar" L"baz").
-  virtual ExprResult ParseStringExpr(const LexerToken *Toks, unsigned NumToks) {
+  virtual ExprResult ParseStringLiteral(const LexerToken *Toks, unsigned NumToks) {
     return 0;
   }
   





More information about the cfe-commits mailing list