[cfe-commits] r39416 - 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

Steve Naroff snaroff at apple.com
Wed Jul 11 09:44:08 PDT 2007


Author: snaroff
Date: Wed Jul 11 11:44:07 2007
New Revision: 39416

URL: http://llvm.org/viewvc/llvm-project?rev=39416&view=rev
Log:
Bug #:
Submitted by:
Reviewed by:
Misc. changes driven by getting "carbon.h" to compile...

- Added ParseCharacterConstant() hook to Action, Sema, etc.
- Added CheckAssignmentOperands() & CheckCommaOperands() to Sema.
- Added CharacterLiteral AST node.
- Fixed CallExpr instantiation - install the correct type.
- Install a bunch of temp types and annotate with FIXME's.

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=39416&r1=39415&r2=39416&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Expr.cpp (original)
+++ cfe/cfe/trunk/AST/Expr.cpp Wed Jul 11 11:44:07 2007
@@ -73,8 +73,8 @@
 // Postfix Operators.
 //===----------------------------------------------------------------------===//
 
-CallExpr::CallExpr(Expr *fn, Expr **args, unsigned numargs)
-  : Expr(CallExprClass, fn->getType()), Fn(fn), NumArgs(numargs) {
+CallExpr::CallExpr(Expr *fn, Expr **args, unsigned numargs, QualType t)
+  : Expr(CallExprClass, t), Fn(fn), NumArgs(numargs) {
   Args = new Expr*[numargs];
   for (unsigned i = 0; i != numargs; ++i)
     Args[i] = args[i];

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

==============================================================================
--- cfe/cfe/trunk/AST/Sema.h (original)
+++ cfe/cfe/trunk/AST/Sema.h Wed Jul 11 11:44:07 2007
@@ -166,6 +166,7 @@
   virtual ExprResult ParseSimplePrimaryExpr(SourceLocation Loc,
                                             tok::TokenKind Kind);
   virtual ExprResult ParseNumericConstant(const LexerToken &);
+  virtual ExprResult ParseCharacterConstant(const LexerToken &);
   virtual ExprResult ParseParenExpr(SourceLocation L, SourceLocation R,
                                     ExprTy *Val);
 
@@ -244,6 +245,10 @@
     Expr *lex, Expr *rex, SourceLocation OpLoc, unsigned OpCode); 
   ExprResult CheckLogicalOperands( // C99 6.5.[13,14]
     Expr *lex, Expr *rex, SourceLocation OpLoc, unsigned OpCode);
+  ExprResult CheckAssignmentOperands( // C99 6.5.16
+    Expr *lex, Expr *rex, SourceLocation OpLoc, unsigned OpCode);
+  ExprResult CheckCommaOperands( // C99 6.5.17
+    Expr *lex, Expr *rex, SourceLocation OpLoc);
   
   /// type checking unary operators (subroutines of ParseUnaryOp).
   /// The unsigned arguments are really enums (UnaryOperator::Opcode)

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

==============================================================================
--- cfe/cfe/trunk/AST/SemaExpr.cpp (original)
+++ cfe/cfe/trunk/AST/SemaExpr.cpp Wed Jul 11 11:44:07 2007
@@ -97,6 +97,19 @@
   }
 }
 
+Sema::ExprResult Sema::ParseCharacterConstant(const LexerToken &Tok) {
+  SmallString<16> CharBuffer;
+  CharBuffer.resize(Tok.getLength());
+  const char *ThisTokBegin = &CharBuffer[0];
+  unsigned ActualLength = PP.getSpelling(Tok, ThisTokBegin);
+  
+  CharLiteralParser Literal(ThisTokBegin, ThisTokBegin+ActualLength,
+                            Tok.getLocation(), PP);
+  if (Literal.hadError())
+    return ExprResult(true);
+  return new CharacterLiteral(Literal.getValue(), Context.IntTy);
+}
+
 Action::ExprResult Sema::ParseNumericConstant(const LexerToken &Tok) {
   // fast path for a single digit (which is quite common). A single digit 
   // cannot have a trigraph, escaped newline, radix prefix, or type suffix.
@@ -146,7 +159,9 @@
 
 Action::ExprResult Sema::ParseParenExpr(SourceLocation L, SourceLocation R,
                                         ExprTy *Val) {
-  return Val;
+  Expr *e = (Expr *)Val;
+  assert((e != 0) && "ParseParenExpr() missing expr");
+  return e;
 }
 
 
@@ -312,14 +327,24 @@
 ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc,
               ExprTy **Args, unsigned NumArgs,
               SourceLocation *CommaLocs, SourceLocation RParenLoc) {
-  return new CallExpr((Expr*)Fn, (Expr**)Args, NumArgs);
+  QualType qType = ((Expr *)Fn)->getType();
+
+  assert(!qType.isNull() && "no type for function call expression");
+
+  QualType canonType = qType.getCanonicalType();
+  QualType resultType;
+  
+  if (const FunctionType *funcT = dyn_cast<FunctionType>(canonType)) {
+    resultType = funcT->getResultType();
+  }
+  return new CallExpr((Expr*)Fn, (Expr**)Args, NumArgs, resultType);
 }
 
 Action::ExprResult Sema::
 ParseCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
               SourceLocation RParenLoc, ExprTy *Op) {
   // If error parsing type, ignore.
-  if (Ty == 0) return true;
+  assert((Ty != 0) && "ParseCastExpr(): missing type");
   return new CastExpr(QualType::getFromOpaquePtr(Ty), (Expr*)Op);
 }
 
@@ -364,7 +389,10 @@
   }
 
   Expr *lhs = (Expr *)LHS, *rhs = (Expr*)RHS;
-  
+
+  assert((lhs != 0) && "ParseBinOp(): missing left expression");
+  assert((rhs != 0) && "ParseBinOp(): missing right expression");
+
   if (BinaryOperator::isMultiplicativeOp(Opc)) 
     return CheckMultiplicativeOperands(lhs, rhs, TokLoc, Opc);
   else if (BinaryOperator::isAdditiveOp(Opc))
@@ -379,8 +407,12 @@
     return CheckBitwiseOperands(lhs, rhs, TokLoc, Opc);
   else if (BinaryOperator::isLogicalOp(Opc))
     return CheckLogicalOperands(lhs, rhs, TokLoc, Opc);
+  else if (BinaryOperator::isAssignmentOp(Opc))
+    return CheckAssignmentOperands(lhs, rhs, TokLoc, Opc);
+  else if (Opc == BinaryOperator::Comma)
+    return CheckCommaOperands(lhs, rhs, TokLoc);
     
-  assert(0 && "ParseBinOp() not handling all binary ops properly");
+  assert(0 && "ParseBinOp(): illegal binary op");
 }
 
 /// ParseConditionalOp - Parse a ?: operation.  Note that 'LHS' may be null
@@ -389,7 +421,14 @@
                                             SourceLocation ColonLoc,
                                             ExprTy *Cond, ExprTy *LHS,
                                             ExprTy *RHS) {
-  return new ConditionalOperator((Expr*)Cond, (Expr*)LHS, (Expr*)RHS);
+  QualType lhs = ((Expr *)LHS)->getType();
+  QualType rhs = ((Expr *)RHS)->getType();
+
+  assert(!lhs.isNull() && "ParseConditionalOp(): no lhs type");
+  assert(!rhs.isNull() && "ParseConditionalOp(): no rhs type");
+
+  QualType canonType = rhs.getCanonicalType(); // TEMPORARY
+  return new ConditionalOperator((Expr*)Cond, (Expr*)LHS, (Expr*)RHS, canonType);
 }
 
 /// UsualUnaryConversion - Performs various conversions that are common to most
@@ -570,6 +609,7 @@
 Action::ExprResult Sema::CheckAdditiveOperands( // C99 6.5.6
   Expr *lex, Expr *rex, SourceLocation loc, unsigned code) 
 {
+  // FIXME: add type checking and fix result type
   return new BinaryOperator(lex, rex, (BinaryOperator::Opcode)code, Context.IntTy);
 }
 
@@ -636,7 +676,22 @@
 Action::ExprResult Sema::CheckLogicalOperands( // C99 6.5.[13,14]
   Expr *lex, Expr *rex, SourceLocation loc, unsigned code) 
 {
-  return new BinaryOperator(lex, rex, (BinaryOperator::Opcode)code);
+  // FIXME: add type checking and fix result type
+  return new BinaryOperator(lex, rex, (BinaryOperator::Opcode)code, Context.IntTy);
+}
+
+Action::ExprResult Sema::CheckAssignmentOperands( // C99 6.5.16
+  Expr *lex, Expr *rex, SourceLocation loc, unsigned code) 
+{
+  // FIXME: add type checking and fix result type
+  return new BinaryOperator(lex, rex, (BinaryOperator::Opcode)code, Context.IntTy);
+}
+
+Action::ExprResult Sema::CheckCommaOperands( // C99 6.5.17
+  Expr *lex, Expr *rex, SourceLocation loc) 
+{
+  // FIXME: add type checking and fix result type
+  return new BinaryOperator(lex, rex, BinaryOperator::Comma, Context.IntTy);
 }
 
 Action::ExprResult
@@ -725,8 +780,10 @@
   assert(!qType.isNull() && "no type for * expression");
 
   QualType canonType = qType.getCanonicalType();
+
+  // FIXME: add type checking and fix result type
   
-  return new UnaryOperator(op, UnaryOperator::Deref, QualType());
+  return new UnaryOperator(op, UnaryOperator::Deref, Context.IntTy);
 }
 
 /// CheckArithmeticOperand - Check the arithmetic unary operators (C99 6.5.3.3).

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

==============================================================================
--- cfe/cfe/trunk/AST/StmtPrinter.cpp (original)
+++ cfe/cfe/trunk/AST/StmtPrinter.cpp Wed Jul 11 11:44:07 2007
@@ -215,6 +215,11 @@
   OS << Node->getDecl()->getName();
 }
 
+void StmtPrinter::VisitCharacterLiteral(CharacterLiteral *Node) {
+  // FIXME: print value.
+  OS << "x";
+}
+
 void StmtPrinter::VisitIntegerLiteral(IntegerLiteral *Node) {
   // FIXME: print value.
   OS << "1";

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

==============================================================================
--- cfe/cfe/trunk/Parse/ParseExpr.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseExpr.cpp Wed Jul 11 11:44:07 2007
@@ -497,6 +497,10 @@
     return ParsePostfixExpressionSuffix(Res);
   }
   case tok::char_constant:     // constant: character-constant
+    Res = Actions.ParseCharacterConstant(Tok);
+    ConsumeToken();
+    // These can be followed by postfix-expr pieces.
+    return ParsePostfixExpressionSuffix(Res);    
   case tok::kw___func__:       // primary-expression: __func__ [C99 6.4.2.2]
   case tok::kw___FUNCTION__:   // primary-expression: __FUNCTION__ [GNU]
   case tok::kw___PRETTY_FUNCTION__:  // primary-expression: __P..Y_F..N__ [GNU]

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

==============================================================================
--- cfe/cfe/trunk/Sema/Sema.h (original)
+++ cfe/cfe/trunk/Sema/Sema.h Wed Jul 11 11:44:07 2007
@@ -166,6 +166,7 @@
   virtual ExprResult ParseSimplePrimaryExpr(SourceLocation Loc,
                                             tok::TokenKind Kind);
   virtual ExprResult ParseNumericConstant(const LexerToken &);
+  virtual ExprResult ParseCharacterConstant(const LexerToken &);
   virtual ExprResult ParseParenExpr(SourceLocation L, SourceLocation R,
                                     ExprTy *Val);
 
@@ -244,6 +245,10 @@
     Expr *lex, Expr *rex, SourceLocation OpLoc, unsigned OpCode); 
   ExprResult CheckLogicalOperands( // C99 6.5.[13,14]
     Expr *lex, Expr *rex, SourceLocation OpLoc, unsigned OpCode);
+  ExprResult CheckAssignmentOperands( // C99 6.5.16
+    Expr *lex, Expr *rex, SourceLocation OpLoc, unsigned OpCode);
+  ExprResult CheckCommaOperands( // C99 6.5.17
+    Expr *lex, Expr *rex, SourceLocation OpLoc);
   
   /// type checking unary operators (subroutines of ParseUnaryOp).
   /// The unsigned arguments are really enums (UnaryOperator::Opcode)

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

==============================================================================
--- cfe/cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaExpr.cpp Wed Jul 11 11:44:07 2007
@@ -97,6 +97,19 @@
   }
 }
 
+Sema::ExprResult Sema::ParseCharacterConstant(const LexerToken &Tok) {
+  SmallString<16> CharBuffer;
+  CharBuffer.resize(Tok.getLength());
+  const char *ThisTokBegin = &CharBuffer[0];
+  unsigned ActualLength = PP.getSpelling(Tok, ThisTokBegin);
+  
+  CharLiteralParser Literal(ThisTokBegin, ThisTokBegin+ActualLength,
+                            Tok.getLocation(), PP);
+  if (Literal.hadError())
+    return ExprResult(true);
+  return new CharacterLiteral(Literal.getValue(), Context.IntTy);
+}
+
 Action::ExprResult Sema::ParseNumericConstant(const LexerToken &Tok) {
   // fast path for a single digit (which is quite common). A single digit 
   // cannot have a trigraph, escaped newline, radix prefix, or type suffix.
@@ -146,7 +159,9 @@
 
 Action::ExprResult Sema::ParseParenExpr(SourceLocation L, SourceLocation R,
                                         ExprTy *Val) {
-  return Val;
+  Expr *e = (Expr *)Val;
+  assert((e != 0) && "ParseParenExpr() missing expr");
+  return e;
 }
 
 
@@ -312,14 +327,24 @@
 ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc,
               ExprTy **Args, unsigned NumArgs,
               SourceLocation *CommaLocs, SourceLocation RParenLoc) {
-  return new CallExpr((Expr*)Fn, (Expr**)Args, NumArgs);
+  QualType qType = ((Expr *)Fn)->getType();
+
+  assert(!qType.isNull() && "no type for function call expression");
+
+  QualType canonType = qType.getCanonicalType();
+  QualType resultType;
+  
+  if (const FunctionType *funcT = dyn_cast<FunctionType>(canonType)) {
+    resultType = funcT->getResultType();
+  }
+  return new CallExpr((Expr*)Fn, (Expr**)Args, NumArgs, resultType);
 }
 
 Action::ExprResult Sema::
 ParseCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
               SourceLocation RParenLoc, ExprTy *Op) {
   // If error parsing type, ignore.
-  if (Ty == 0) return true;
+  assert((Ty != 0) && "ParseCastExpr(): missing type");
   return new CastExpr(QualType::getFromOpaquePtr(Ty), (Expr*)Op);
 }
 
@@ -364,7 +389,10 @@
   }
 
   Expr *lhs = (Expr *)LHS, *rhs = (Expr*)RHS;
-  
+
+  assert((lhs != 0) && "ParseBinOp(): missing left expression");
+  assert((rhs != 0) && "ParseBinOp(): missing right expression");
+
   if (BinaryOperator::isMultiplicativeOp(Opc)) 
     return CheckMultiplicativeOperands(lhs, rhs, TokLoc, Opc);
   else if (BinaryOperator::isAdditiveOp(Opc))
@@ -379,8 +407,12 @@
     return CheckBitwiseOperands(lhs, rhs, TokLoc, Opc);
   else if (BinaryOperator::isLogicalOp(Opc))
     return CheckLogicalOperands(lhs, rhs, TokLoc, Opc);
+  else if (BinaryOperator::isAssignmentOp(Opc))
+    return CheckAssignmentOperands(lhs, rhs, TokLoc, Opc);
+  else if (Opc == BinaryOperator::Comma)
+    return CheckCommaOperands(lhs, rhs, TokLoc);
     
-  assert(0 && "ParseBinOp() not handling all binary ops properly");
+  assert(0 && "ParseBinOp(): illegal binary op");
 }
 
 /// ParseConditionalOp - Parse a ?: operation.  Note that 'LHS' may be null
@@ -389,7 +421,14 @@
                                             SourceLocation ColonLoc,
                                             ExprTy *Cond, ExprTy *LHS,
                                             ExprTy *RHS) {
-  return new ConditionalOperator((Expr*)Cond, (Expr*)LHS, (Expr*)RHS);
+  QualType lhs = ((Expr *)LHS)->getType();
+  QualType rhs = ((Expr *)RHS)->getType();
+
+  assert(!lhs.isNull() && "ParseConditionalOp(): no lhs type");
+  assert(!rhs.isNull() && "ParseConditionalOp(): no rhs type");
+
+  QualType canonType = rhs.getCanonicalType(); // TEMPORARY
+  return new ConditionalOperator((Expr*)Cond, (Expr*)LHS, (Expr*)RHS, canonType);
 }
 
 /// UsualUnaryConversion - Performs various conversions that are common to most
@@ -570,6 +609,7 @@
 Action::ExprResult Sema::CheckAdditiveOperands( // C99 6.5.6
   Expr *lex, Expr *rex, SourceLocation loc, unsigned code) 
 {
+  // FIXME: add type checking and fix result type
   return new BinaryOperator(lex, rex, (BinaryOperator::Opcode)code, Context.IntTy);
 }
 
@@ -636,7 +676,22 @@
 Action::ExprResult Sema::CheckLogicalOperands( // C99 6.5.[13,14]
   Expr *lex, Expr *rex, SourceLocation loc, unsigned code) 
 {
-  return new BinaryOperator(lex, rex, (BinaryOperator::Opcode)code);
+  // FIXME: add type checking and fix result type
+  return new BinaryOperator(lex, rex, (BinaryOperator::Opcode)code, Context.IntTy);
+}
+
+Action::ExprResult Sema::CheckAssignmentOperands( // C99 6.5.16
+  Expr *lex, Expr *rex, SourceLocation loc, unsigned code) 
+{
+  // FIXME: add type checking and fix result type
+  return new BinaryOperator(lex, rex, (BinaryOperator::Opcode)code, Context.IntTy);
+}
+
+Action::ExprResult Sema::CheckCommaOperands( // C99 6.5.17
+  Expr *lex, Expr *rex, SourceLocation loc) 
+{
+  // FIXME: add type checking and fix result type
+  return new BinaryOperator(lex, rex, BinaryOperator::Comma, Context.IntTy);
 }
 
 Action::ExprResult
@@ -725,8 +780,10 @@
   assert(!qType.isNull() && "no type for * expression");
 
   QualType canonType = qType.getCanonicalType();
+
+  // FIXME: add type checking and fix result type
   
-  return new UnaryOperator(op, UnaryOperator::Deref, QualType());
+  return new UnaryOperator(op, UnaryOperator::Deref, Context.IntTy);
 }
 
 /// CheckArithmeticOperand - Check the arithmetic unary operators (C99 6.5.3.3).

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=39416&r1=39415&r2=39416&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/cfe/trunk/include/clang/AST/Expr.h Wed Jul 11 11:44:07 2007
@@ -91,6 +91,21 @@
   static bool classof(const IntegerLiteral *) { return true; }
 };
 
+class CharacterLiteral : public Expr {
+  unsigned Value;
+public:
+  // type should be IntTy
+  CharacterLiteral(unsigned value, QualType type)
+    : Expr(CharacterLiteralClass, type), Value(value) {
+  }
+
+  virtual void visit(StmtVisitor &Visitor);
+  static bool classof(const Stmt *T) { 
+    return T->getStmtClass() == CharacterLiteralClass; 
+  }
+  static bool classof(const CharacterLiteral *) { return true; }
+};
+
 class FloatingLiteral : public Expr {
   float Value; // FIXME
 public:
@@ -242,7 +257,7 @@
   Expr **Args;
   unsigned NumArgs;
 public:
-  CallExpr(Expr *fn, Expr **args, unsigned numargs);
+  CallExpr(Expr *fn, Expr **args, unsigned numargs, QualType t);
   ~CallExpr() {
     delete [] Args;
   }
@@ -299,7 +314,7 @@
   Expr *Op;
 public:
   CastExpr(QualType ty, Expr *op) : 
-    Expr(CastExprClass, QualType()), Ty(ty), Op(op) {}
+    Expr(CastExprClass, ty), Ty(ty), Op(op) {}
   CastExpr(StmtClass SC, QualType ty, Expr *op) : 
     Expr(SC, QualType()), Ty(ty), Op(op) {}
   
@@ -353,6 +368,7 @@
   static bool isEqualityOp(Opcode Op) { return Op == EQ || Op == NE; }
   static bool isBitwiseOp(Opcode Op) { return Op >= And && Op <= Or; }
   static bool isLogicalOp(Opcode Op) { return Op == LAnd || Op == LOr; }
+  static bool isAssignmentOp(Opcode Op) { return Op >= Assign || Op<=OrAssign; }
   
   Opcode getOpcode() const { return Opc; }
   Expr *getLHS() { return LHS; }
@@ -374,8 +390,8 @@
 class ConditionalOperator : public Expr {
   Expr *Cond, *LHS, *RHS;  // Left/Middle/Right hand sides.
 public:
-  ConditionalOperator(Expr *cond, Expr *lhs, Expr *rhs)
-    : Expr(ConditionalOperatorClass, QualType()), Cond(cond), LHS(lhs), RHS(rhs) {}
+  ConditionalOperator(Expr *cond, Expr *lhs, Expr *rhs, QualType t)
+    : Expr(ConditionalOperatorClass, t), Cond(cond), LHS(lhs), RHS(rhs) {}
 
   Expr *getCond() { return Cond; }
   Expr *getLHS() { return LHS; }

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=39416&r1=39415&r2=39416&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/StmtNodes.def (original)
+++ cfe/cfe/trunk/include/clang/AST/StmtNodes.def Wed Jul 11 11:44:07 2007
@@ -46,20 +46,21 @@
 STMT(34, IntegerLiteral       , Expr)
 STMT(35, FloatingLiteral      , Expr)
 STMT(36, StringLiteral        , Expr)
-STMT(37, ParenExpr            , Expr)
-STMT(38, UnaryOperator        , Expr)
-STMT(39, SizeOfAlignOfTypeExpr, Expr)
-STMT(40, ArraySubscriptExpr   , Expr)
-STMT(41, CallExpr             , Expr)
-STMT(42, MemberExpr           , Expr)
-STMT(43, CastExpr             , Expr)
-STMT(44, BinaryOperator       , Expr)
-STMT(45, ConditionalOperator  , Expr)
+STMT(37, CharacterLiteral     , Expr)
+STMT(38, ParenExpr            , Expr)
+STMT(39, UnaryOperator        , Expr)
+STMT(40, SizeOfAlignOfTypeExpr, Expr)
+STMT(41, ArraySubscriptExpr   , Expr)
+STMT(42, CallExpr             , Expr)
+STMT(43, MemberExpr           , Expr)
+STMT(44, CastExpr             , Expr)
+STMT(45, BinaryOperator       , Expr)
+STMT(46, ConditionalOperator  , Expr)
 
 // C++ Expressions.
-STMT(46, CXXCastExpr          , CastExpr)
-STMT(47, CXXBoolLiteralExpr   , Expr)
-LAST_EXPR(47)
+STMT(47, CXXCastExpr          , CastExpr)
+STMT(48, CXXBoolLiteralExpr   , Expr)
+LAST_EXPR(48)
 
 #undef STMT
 #undef FIRST_STMT

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=39416&r1=39415&r2=39416&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/Action.h Wed Jul 11 11:44:07 2007
@@ -263,6 +263,7 @@
                                             tok::TokenKind Kind) {
     return 0;
   }
+  virtual ExprResult ParseCharacterConstant(const LexerToken &) { return 0; }
   virtual ExprResult ParseNumericConstant(const LexerToken &) { return 0; }
   
   /// ParseStringLiteral - The specified tokens were lexed as pasted string





More information about the cfe-commits mailing list