Changeset 21f0aa8


Ignore:
Timestamp:
Aug 17, 2017, 2:45:12 PM (4 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
6ac5223, e9145a3
Parents:
936e9f4
Message:

Seperated CodeLocation? out from the general utilities.

Location:
src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.h

    r936e9f4 r21f0aa8  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 21 22:18:59 2017
    13 // Update Count     : 6
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr Aug 17 14:01:00 2017
     13// Update Count     : 7
    1414//
    1515
     
    2121#include <string>     // for string
    2222
    23 #include "utility.h"  // for CodeLocation, toString
     23#include "CodeLocation.h"  // for CodeLocation, toString
    2424
    2525struct error {
  • src/Common/utility.h

    r936e9f4 r21f0aa8  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 21 22:19:13 2017
    13 // Update Count     : 33
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr Aug 17 11:38:00 2017
     13// Update Count     : 34
    1414//
    1515
     
    341341}
    342342
    343 struct CodeLocation {
    344         int linenumber;
    345         std::string filename;
    346 
    347         /// Create a new unset CodeLocation.
    348         CodeLocation()
    349                 : linenumber( -1 )
    350                 , filename("")
    351         {}
    352 
    353         /// Create a new CodeLocation with the given values.
    354         CodeLocation( const char* filename, int lineno )
    355                 : linenumber( lineno )
    356                 , filename(filename ? filename : "")
    357         {}
    358 
    359         CodeLocation( const CodeLocation& rhs ) = default;
    360 
    361         bool isSet () const {
    362                 return -1 != linenumber;
    363         }
    364 
    365         bool isUnset () const {
    366                 return !isSet();
    367         }
    368 
    369         void unset () {
    370                 linenumber = -1;
    371                 filename = "";
    372         }
    373 
    374         // Use field access for set.
    375 };
    376 
    377 inline std::string to_string( const CodeLocation& location ) {
    378         return location.isSet() ? location.filename + ":" + std::to_string(location.linenumber) + " " : "";
    379 }
    380 
    381343// Local Variables: //
    382344// tab-width: 4 //
  • src/ControlStruct/LabelGenerator.cc

    r936e9f4 r21f0aa8  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jun 23 12:18:34 2015
    13 // Update Count     : 13
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr Aug 14 14:14:00 2015
     13// Update Count     : 14
    1414//
    1515
    16 #include <iostream>             // for operator<<, basic_ostream, ostringstream
     16#include <iostream>             // for operator<<, basic_ostream
     17#include <sstream>              // for ostringstream
    1718#include <list>                 // for list
    1819
  • src/Parser/ParseNode.h

    r936e9f4 r21f0aa8  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:28:16 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 16 16:46:48 2017
    13 // Update Count     : 794
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr Aug 17 13:46:00 2017
     13// Update Count     : 795
    1414//
    1515
     
    2424#include <string>                  // for string
    2525
     26#include "Common/CodeLocation.h"   // for CodeLocation
    2627#include "Common/SemanticError.h"  // for SemanticError
    2728#include "Common/UniqueName.h"     // for UniqueName
    28 #include "Common/utility.h"        // for maybeClone, CodeLocation, maybeBuild
     29#include "Common/utility.h"        // for maybeClone, maybeBuild
    2930#include "Parser/LinkageSpec.h"    // for Spec
    3031#include "SynTree/Expression.h"    // for Expression, ConstantExpr (ptr only)
  • src/SynTree/BaseSyntaxNode.h

    r936e9f4 r21f0aa8  
    99// Author           : Thierry Delisle
    1010// Created On       : Tue Feb 14 07:44:20 2017
    11 // Last Modified By :
    12 // Last Modified On :
    13 // Update Count     :
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr Aug 17 13:44:00
     13// Update Count     : 1
    1414//
    1515
    1616#pragma once
    1717
    18 #include "Common/utility.h"
    19 #include "Visitor.h"
     18#include "Common/CodeLocation.h"
     19class Visitor;
    2020
    2121class BaseSyntaxNode {
Note: See TracChangeset for help on using the changeset viewer.