remove full locinfo AST nodes for now.  They just clutter the implementation
and should be implemented with an ASTBuilder subclass anyway.

llvm-svn: 39107
diff --git a/clang/Sema/ASTStreamer.cpp b/clang/Sema/ASTStreamer.cpp
index 6e73df6..924f9ad 100644
--- a/clang/Sema/ASTStreamer.cpp
+++ b/clang/Sema/ASTStreamer.cpp
@@ -23,8 +23,8 @@
     Parser P;
     std::vector<Decl*> LastInGroupList;
   public:
-    ASTStreamer(Preprocessor &PP, unsigned MainFileID, bool FullLocInfo)
-      : P(PP, *new ASTBuilder(PP, FullLocInfo, LastInGroupList)) {
+    ASTStreamer(Preprocessor &PP, unsigned MainFileID)
+      : P(PP, *new ASTBuilder(PP, LastInGroupList)) {
       PP.EnterSourceFile(MainFileID, 0, true);
       
       // Initialize the parser.
@@ -80,9 +80,8 @@
 /// ASTStreamer_Init - Create an ASTStreamer with the specified preprocessor
 /// and FileID.
 ASTStreamerTy *llvm::clang::ASTStreamer_Init(Preprocessor &PP, 
-                                             unsigned MainFileID,
-                                             bool FullLocInfo) {
-  return new ASTStreamer(PP, MainFileID, FullLocInfo);
+                                             unsigned MainFileID) {
+  return new ASTStreamer(PP, MainFileID);
 }
 
 /// ASTStreamer_ReadTopLevelDecl - Parse and return one top-level declaration. This
diff --git a/clang/Sema/Sema.cpp b/clang/Sema/Sema.cpp
index bbda610..35102b9 100644
--- a/clang/Sema/Sema.cpp
+++ b/clang/Sema/Sema.cpp
@@ -91,7 +91,7 @@
 Action::StmtResult 
 ASTBuilder::ParseCompoundStmt(SourceLocation L, SourceLocation R,
                               StmtTy **Elts, unsigned NumElts) {
-  if (FullLocInfo || NumElts > 1)
+  if (NumElts > 1)
     return new CompoundStmt((Stmt**)Elts, NumElts);
   else if (NumElts == 1)
     return Elts[0];        // {stmt} -> stmt
@@ -146,9 +146,7 @@
 Action::ExprResult ASTBuilder::ParseParenExpr(SourceLocation L, 
                                               SourceLocation R,
                                               ExprTy *Val) {
-  if (!FullLocInfo) return Val;
-  
-  return new ParenExpr(L, R, (Expr*)Val);
+  return Val;
 }
 
 /// ParseStringExpr - This accepts a string after semantic analysis. This string
@@ -159,11 +157,7 @@
 ParseStringExpr(const char *StrData, unsigned StrLen, bool isWide,
                 SourceLocation *TokLocs, unsigned NumToks) {
   assert(NumToks && "Must have at least one string!");
-  
-  if (!FullLocInfo)
-    return new StringExpr(StrData, StrLen, isWide);
-  else
-    return new StringExprLOC(StrData, StrLen, isWide, TokLocs, NumToks);
+  return new StringExpr(StrData, StrLen, isWide);
 }
 
 
@@ -188,26 +182,19 @@
   case tok::kw___imag:    Opc = UnaryOperator::Imag; break;
   case tok::ampamp:       Opc = UnaryOperator::AddrLabel; break;
   case tok::kw___extension__: 
-    if (!FullLocInfo) return Input;
-    Opc = UnaryOperator::Extension;
-    break;
+    return Input;
+    //Opc = UnaryOperator::Extension;
+    //break;
   }
 
-  if (!FullLocInfo)
-    return new UnaryOperator((Expr*)Input, Opc);
-  else
-    return new UnaryOperatorLOC(OpLoc, (Expr*)Input, Opc);
+  return new UnaryOperator((Expr*)Input, Opc);
 }
 
 Action::ExprResult ASTBuilder::
 ParseSizeOfAlignOfTypeExpr(SourceLocation OpLoc, bool isSizeof, 
                            SourceLocation LParenLoc, TypeTy *Ty,
                            SourceLocation RParenLoc) {
-  if (!FullLocInfo)
-    return new SizeOfAlignOfTypeExpr(isSizeof, (Type*)Ty);
-  else
-    return new SizeOfAlignOfTypeExprLOC(OpLoc, isSizeof, LParenLoc, (Type*)Ty,
-                                        RParenLoc);
+  return new SizeOfAlignOfTypeExpr(isSizeof, (Type*)Ty);
 }
 
 
@@ -221,19 +208,13 @@
   case tok::minusminus: Opc = UnaryOperator::PostDec; break;
   }
   
-  if (!FullLocInfo)
-    return new UnaryOperator((Expr*)Input, Opc);
-  else
-    return new UnaryOperatorLOC(OpLoc, (Expr*)Input, Opc);
+  return new UnaryOperator((Expr*)Input, Opc);
 }
 
 Action::ExprResult ASTBuilder::
 ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc,
                         ExprTy *Idx, SourceLocation RLoc) {
-  if (!FullLocInfo)
-    return new ArraySubscriptExpr((Expr*)Base, (Expr*)Idx);
-  else
-    return new ArraySubscriptExprLOC((Expr*)Base, LLoc, (Expr*)Idx, RLoc);
+  return new ArraySubscriptExpr((Expr*)Base, (Expr*)Idx);
 }
 
 Action::ExprResult ASTBuilder::
@@ -242,11 +223,7 @@
                          IdentifierInfo &Member) {
   Decl *MemberDecl = 0;
   // TODO: Look up MemberDecl.
-  if (!FullLocInfo)
-    return new MemberExpr((Expr*)Base, OpKind == tok::arrow, MemberDecl);
-  else
-    return new MemberExprLOC((Expr*)Base, OpLoc, OpKind == tok::arrow,
-                             MemberLoc, MemberDecl);
+  return new MemberExpr((Expr*)Base, OpKind == tok::arrow, MemberDecl);
 }
 
 /// ParseCallExpr - Handle a call to Fn with the specified array of arguments.
@@ -256,20 +233,13 @@
 ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc,
               ExprTy **Args, unsigned NumArgs,
               SourceLocation *CommaLocs, SourceLocation RParenLoc) {
-  if (!FullLocInfo)
-    return new CallExpr((Expr*)Fn, (Expr**)Args, NumArgs);
-  else
-    return new CallExprLOC((Expr*)Fn, LParenLoc, (Expr**)Args, NumArgs,
-                           CommaLocs, RParenLoc);
+  return new CallExpr((Expr*)Fn, (Expr**)Args, NumArgs);
 }
 
 Action::ExprResult ASTBuilder::
 ParseCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
               SourceLocation RParenLoc, ExprTy *Op) {
-  if (!FullLocInfo)
-    return new CastExpr((Type*)Ty, (Expr*)Op);
-  else
-    return new CastExprLOC(LParenLoc, (Type*)Ty, RParenLoc, (Expr*)Op);
+  return new CastExpr((Type*)Ty, (Expr*)Op);
 }
 
 
@@ -313,10 +283,7 @@
   case tok::comma:                Opc = BinaryOperator::Comma; break;
   }
   
-  if (!FullLocInfo)
-    return new BinaryOperator((Expr*)LHS, (Expr*)RHS, Opc);
-  else
-    return new BinaryOperatorLOC((Expr*)LHS, TokLoc, (Expr*)RHS, Opc);
+  return new BinaryOperator((Expr*)LHS, (Expr*)RHS, Opc);
 }
 
 /// ParseConditionalOp - Parse a ?: operation.  Note that 'LHS' may be null
@@ -325,10 +292,6 @@
                                                   SourceLocation ColonLoc,
                                                   ExprTy *Cond, ExprTy *LHS,
                                                   ExprTy *RHS) {
-  if (!FullLocInfo)
-    return new ConditionalOperator((Expr*)Cond, (Expr*)LHS, (Expr*)RHS);
-  else
-    return new ConditionalOperatorLOC((Expr*)Cond, QuestionLoc, (Expr*)LHS,
-                                      ColonLoc, (Expr*)RHS);
+  return new ConditionalOperator((Expr*)Cond, (Expr*)LHS, (Expr*)RHS);
 }
 
diff --git a/clang/Sema/Sema.h b/clang/Sema/Sema.h
index b39c95f..5e57687 100644
--- a/clang/Sema/Sema.h
+++ b/clang/Sema/Sema.h
@@ -29,19 +29,14 @@
 class ASTBuilder : public Action {
   Preprocessor &PP;
   
-  /// FullLocInfo - If this is true, the ASTBuilder constructs AST Nodes that
-  /// capture maximal location information for each source-language construct.
-  bool FullLocInfo;
-  
   /// LastInGroupList - This vector is populated when there are multiple
   /// declarators in a single decl group (e.g. "int A, B, C").  In this case,
   /// all but the last decl will be entered into this.  This is used by the
   /// ASTStreamer.
   std::vector<Decl*> &LastInGroupList;
 public:
-  ASTBuilder(Preprocessor &pp, bool fullLocInfo,
-             std::vector<Decl*> &prevInGroup)
-    : PP(pp), FullLocInfo(fullLocInfo), LastInGroupList(prevInGroup) {}
+  ASTBuilder(Preprocessor &pp, std::vector<Decl*> &prevInGroup)
+    : PP(pp), LastInGroupList(prevInGroup) {}
   
   //===--------------------------------------------------------------------===//
   // Symbol table tracking callbacks.
@@ -59,7 +54,6 @@
   virtual StmtResult ParseCompoundStmt(SourceLocation L, SourceLocation R,
                                        StmtTy **Elts, unsigned NumElts);
   virtual StmtResult ParseExprStmt(ExprTy *Expr) {
-    // TODO: Full info should track this with a node.
     return Expr; // Exprs are Stmts.
   }