Refactor location tracking.

R=kbr@chromium.org

Review URL: https://codereview.appspot.com/9078046

git-svn-id: https://angleproject.googlecode.com/svn/trunk@2202 736b8ea6-26fd-11df-bfd4-992fa37f6226

TRAC #23333
Authored-by: alokp@chromium.org
Signed-off-by: Shannon Woods
Signed-off-by Nicolas Capens
Merged-by: Jamie Madill
diff --git a/src/compiler/intermediate.h b/src/compiler/intermediate.h
index d5d6a19..a8a0e31 100644
--- a/src/compiler/intermediate.h
+++ b/src/compiler/intermediate.h
@@ -217,10 +217,16 @@
 public:
     POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)
 
-    TIntermNode() : line(0) {}
+    TIntermNode() {
+        // TODO: Move this to TSourceLoc constructor
+        // after getting rid of TPublicType.
+        line.first_file = line.last_file = 0;
+        line.first_line = line.last_line = 0;
+    }
+    virtual ~TIntermNode() { }
 
-    TSourceLoc getLine() const { return line; }
-    void setLine(TSourceLoc l) { line = l; }
+    const TSourceLoc& getLine() const { return line; }
+    void setLine(const TSourceLoc& l) { line = l; }
 
     virtual void traverse(TIntermTraverser*) = 0;
     virtual TIntermTyped* getAsTyped() { return 0; }
@@ -231,7 +237,6 @@
     virtual TIntermSelection* getAsSelectionNode() { return 0; }
     virtual TIntermSymbol* getAsSymbolNode() { return 0; }
     virtual TIntermLoop* getAsLoopNode() { return 0; }
-    virtual ~TIntermNode() { }
 
 protected:
     TSourceLoc line;
@@ -470,7 +475,7 @@
 //
 class TIntermAggregate : public TIntermOperator {
 public:
-    TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), endLine(0), useEmulatedFunction(false) { }
+    TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), useEmulatedFunction(false) { }
     TIntermAggregate(TOperator o) : TIntermOperator(o), useEmulatedFunction(false) { }
     ~TIntermAggregate() { }
 
@@ -490,9 +495,6 @@
     void setDebug(bool d) { debug = d; }
     bool getDebug() { return debug; }
 
-    void setEndLine(TSourceLoc line) { endLine = line; }
-    TSourceLoc getEndLine() const { return endLine; }
-
     void setUseEmulatedFunction() { useEmulatedFunction = true; }
     bool getUseEmulatedFunction() { return useEmulatedFunction; }
 
@@ -505,7 +507,6 @@
 
     bool optimize;
     bool debug;
-    TSourceLoc endLine;
 
     // If set to true, replace the built-in function call with an emulated one
     // to work around driver bugs.