[cfe-commits] r39375 - in /cfe/cfe/trunk: AST/Sema.h AST/SemaExpr.cpp Sema/Sema.h Sema/SemaExpr.cpp

Steve Naroff snaroff at apple.com
Wed Jul 11 09:43:45 PDT 2007


Author: snaroff
Date: Wed Jul 11 11:43:45 2007
New Revision: 39375

URL: http://llvm.org/viewvc/llvm-project?rev=39375&view=rev
Log:
Bug #:
Submitted by:
Reviewed by:
Avoid including "clang/AST/Expr.h" in Sema.h just to access
UnaryOperator::Opcode. While the inclusion wasn't objectionable in terms
of layering, it is nice to keep the inclusions as modest as possible.

Modified:
    cfe/cfe/trunk/AST/Sema.h
    cfe/cfe/trunk/AST/SemaExpr.cpp
    cfe/cfe/trunk/Sema/Sema.h
    cfe/cfe/trunk/Sema/SemaExpr.cpp

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

==============================================================================
--- cfe/cfe/trunk/AST/Sema.h (original)
+++ cfe/cfe/trunk/AST/Sema.h Wed Jul 11 11:43:45 2007
@@ -16,7 +16,6 @@
 #define LLVM_CLANG_AST_SEMA_H
 
 #include "clang/Parse/Action.h"
-#include "clang/AST/Expr.h"
 #include <vector>
 #include <string>
 
@@ -25,6 +24,7 @@
   class ASTContext;
   class Preprocessor;
   class Decl;
+  class Expr;
   class VarDecl;
   class TypedefDecl;
   class FunctionDecl;
@@ -236,7 +236,7 @@
   ExprResult CheckLogicalOperands(Expr *op1, Expr *op2);   // C99 6.5.[13,14]
   
   ExprResult CheckIncrementDecrementOperand(Expr *op, SourceLocation loc,
-                                            UnaryOperator::Opcode Opc);
+                                            unsigned /*UnaryOperator::Opcode*/c);
 };
 
 

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

==============================================================================
--- cfe/cfe/trunk/AST/SemaExpr.cpp (original)
+++ cfe/cfe/trunk/AST/SemaExpr.cpp Wed Jul 11 11:43:45 2007
@@ -424,7 +424,7 @@
 
 Action::ExprResult
 Sema::CheckIncrementDecrementOperand(Expr *op, SourceLocation OpLoc,
-                                               UnaryOperator::Opcode OpCode) {
+                                               unsigned OpCode) {
   TypeRef type = op->getTypeRef();
 
   assert(!type.isNull() && "no type for increment/decrement expression");
@@ -442,6 +442,6 @@
   if (!type.isModifiableLvalue())
     return Diag(OpLoc, diag::err_typecheck_not_modifiable, type);
 
-  return new UnaryOperator(op, OpCode, type);
+  return new UnaryOperator(op, (UnaryOperator::Opcode)OpCode, type);
 }
 

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

==============================================================================
--- cfe/cfe/trunk/Sema/Sema.h (original)
+++ cfe/cfe/trunk/Sema/Sema.h Wed Jul 11 11:43:45 2007
@@ -16,7 +16,6 @@
 #define LLVM_CLANG_AST_SEMA_H
 
 #include "clang/Parse/Action.h"
-#include "clang/AST/Expr.h"
 #include <vector>
 #include <string>
 
@@ -25,6 +24,7 @@
   class ASTContext;
   class Preprocessor;
   class Decl;
+  class Expr;
   class VarDecl;
   class TypedefDecl;
   class FunctionDecl;
@@ -236,7 +236,7 @@
   ExprResult CheckLogicalOperands(Expr *op1, Expr *op2);   // C99 6.5.[13,14]
   
   ExprResult CheckIncrementDecrementOperand(Expr *op, SourceLocation loc,
-                                            UnaryOperator::Opcode Opc);
+                                            unsigned /*UnaryOperator::Opcode*/c);
 };
 
 

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

==============================================================================
--- cfe/cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaExpr.cpp Wed Jul 11 11:43:45 2007
@@ -424,7 +424,7 @@
 
 Action::ExprResult
 Sema::CheckIncrementDecrementOperand(Expr *op, SourceLocation OpLoc,
-                                               UnaryOperator::Opcode OpCode) {
+                                               unsigned OpCode) {
   TypeRef type = op->getTypeRef();
 
   assert(!type.isNull() && "no type for increment/decrement expression");
@@ -442,6 +442,6 @@
   if (!type.isModifiableLvalue())
     return Diag(OpLoc, diag::err_typecheck_not_modifiable, type);
 
-  return new UnaryOperator(op, OpCode, type);
+  return new UnaryOperator(op, (UnaryOperator::Opcode)OpCode, type);
 }
 





More information about the cfe-commits mailing list