[llvm-commits] [llvm] r73844 - in /llvm/trunk: include/llvm/Support/SourceMgr.h lib/Support/CMakeLists.txt lib/Support/SourceMgr.cpp utils/TableGen/CMakeLists.txt utils/TableGen/TGLexer.cpp utils/TableGen/TGLexer.h utils/TableGen/TGParser.h utils/TableGen/TableGen.cpp

Chris Lattner sabre at nondot.org
Sat Jun 20 20:41:51 PDT 2009


Author: lattner
Date: Sat Jun 20 22:41:50 2009
New Revision: 73844

URL: http://llvm.org/viewvc/llvm-project?rev=73844&view=rev
Log:
Rename TGSourceMgr -> SourceMgr.

Modified:
    llvm/trunk/include/llvm/Support/SourceMgr.h
    llvm/trunk/lib/Support/CMakeLists.txt
    llvm/trunk/lib/Support/SourceMgr.cpp
    llvm/trunk/utils/TableGen/CMakeLists.txt
    llvm/trunk/utils/TableGen/TGLexer.cpp
    llvm/trunk/utils/TableGen/TGLexer.h
    llvm/trunk/utils/TableGen/TGParser.h
    llvm/trunk/utils/TableGen/TableGen.cpp

Modified: llvm/trunk/include/llvm/Support/SourceMgr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/SourceMgr.h?rev=73844&r1=73843&r2=73844&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/SourceMgr.h (original)
+++ llvm/trunk/include/llvm/Support/SourceMgr.h Sat Jun 20 22:41:50 2009
@@ -13,8 +13,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef TGSOURCEMGR_H
-#define TGSOURCEMGR_H
+#ifndef SUPPORT_SOURCEMGR_H
+#define SUPPORT_SOURCEMGR_H
 
 #include <string>
 #include <vector>
@@ -22,7 +22,7 @@
 
 namespace llvm {
   class MemoryBuffer;
-  class TGSourceMgr;
+  class SourceMgr;
   
 class SMLoc {
   const char *Ptr;
@@ -42,9 +42,9 @@
   }
 };
 
-/// TGSourceMgr - This owns the files read by tblgen, handles include stacks,
+/// SourceMgr - This owns the files read by tblgen, handles include stacks,
 /// and handles printing of diagnostics.
-class TGSourceMgr {
+class SourceMgr {
   struct SrcBuffer {
     /// Buffer - The memory buffer for the file.
     MemoryBuffer *Buffer;
@@ -57,11 +57,11 @@
   /// Buffers - This is all of the buffers that we are reading from.
   std::vector<SrcBuffer> Buffers;
   
-  TGSourceMgr(const TGSourceMgr&);    // DO NOT IMPLEMENT
-  void operator=(const TGSourceMgr&); // DO NOT IMPLEMENT
+  SourceMgr(const SourceMgr&);    // DO NOT IMPLEMENT
+  void operator=(const SourceMgr&); // DO NOT IMPLEMENT
 public:
-  TGSourceMgr() {}
-  ~TGSourceMgr();
+  SourceMgr() {}
+  ~SourceMgr();
   
   const SrcBuffer &getBufferInfo(unsigned i) const {
     assert(i < Buffers.size() && "Invalid Buffer ID!");

Modified: llvm/trunk/lib/Support/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CMakeLists.txt?rev=73844&r1=73843&r2=73844&view=diff

==============================================================================
--- llvm/trunk/lib/Support/CMakeLists.txt (original)
+++ llvm/trunk/lib/Support/CMakeLists.txt Sat Jun 20 22:41:50 2009
@@ -19,6 +19,7 @@
   PrettyStackTrace.cpp
   SlowOperationInformer.cpp
   SmallPtrSet.cpp
+  SourceMgr.cpp
   Statistic.cpp
   Streams.cpp
   StringExtras.cpp

Modified: llvm/trunk/lib/Support/SourceMgr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SourceMgr.cpp?rev=73844&r1=73843&r2=73844&view=diff

==============================================================================
--- llvm/trunk/lib/Support/SourceMgr.cpp (original)
+++ llvm/trunk/lib/Support/SourceMgr.cpp Sat Jun 20 22:41:50 2009
@@ -18,7 +18,7 @@
 #include "llvm/Support/raw_ostream.h"
 using namespace llvm;
 
-TGSourceMgr::~TGSourceMgr() {
+SourceMgr::~SourceMgr() {
   while (!Buffers.empty()) {
     delete Buffers.back().Buffer;
     Buffers.pop_back();
@@ -27,7 +27,7 @@
 
 /// FindBufferContainingLoc - Return the ID of the buffer containing the
 /// specified location, returning -1 if not found.
-int TGSourceMgr::FindBufferContainingLoc(SMLoc Loc) const {
+int SourceMgr::FindBufferContainingLoc(SMLoc Loc) const {
   for (unsigned i = 0, e = Buffers.size(); i != e; ++i)
     if (Loc.getPointer() >= Buffers[i].Buffer->getBufferStart() &&
         // Use <= here so that a pointer to the null at the end of the buffer
@@ -39,7 +39,7 @@
 
 /// FindLineNumber - Find the line number for the specified location in the
 /// specified file.  This is not a fast method.
-unsigned TGSourceMgr::FindLineNumber(SMLoc Loc, int BufferID) const {
+unsigned SourceMgr::FindLineNumber(SMLoc Loc, int BufferID) const {
   if (BufferID == -1) BufferID = FindBufferContainingLoc(Loc);
   assert(BufferID != -1 && "Invalid Location!");
   
@@ -56,7 +56,7 @@
   return LineNo;
 }
 
-void TGSourceMgr::PrintIncludeStack(SMLoc IncludeLoc) const {
+void SourceMgr::PrintIncludeStack(SMLoc IncludeLoc) const {
   if (IncludeLoc == SMLoc()) return;  // Top of stack.
   
   int CurBuf = FindBufferContainingLoc(IncludeLoc);
@@ -70,7 +70,7 @@
 }
 
 
-void TGSourceMgr::PrintError(SMLoc ErrorLoc, const std::string &Msg) const {
+void SourceMgr::PrintError(SMLoc ErrorLoc, const std::string &Msg) const {
   raw_ostream &OS = errs();
   
   // First thing to do: find the current buffer containing the specified

Modified: llvm/trunk/utils/TableGen/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CMakeLists.txt?rev=73844&r1=73843&r2=73844&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/CMakeLists.txt (original)
+++ llvm/trunk/utils/TableGen/CMakeLists.txt Sat Jun 20 22:41:50 2009
@@ -17,7 +17,6 @@
   SubtargetEmitter.cpp
   TGLexer.cpp
   TGParser.cpp
-  TGSourceMgr.cpp
   TGValueTypes.cpp
   TableGen.cpp
   TableGenBackend.cpp

Modified: llvm/trunk/utils/TableGen/TGLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TGLexer.cpp?rev=73844&r1=73843&r2=73844&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/TGLexer.cpp (original)
+++ llvm/trunk/utils/TableGen/TGLexer.cpp Sat Jun 20 22:41:50 2009
@@ -24,7 +24,7 @@
 #include <cerrno>
 using namespace llvm;
 
-TGLexer::TGLexer(TGSourceMgr &SM) : SrcMgr(SM) {
+TGLexer::TGLexer(SourceMgr &SM) : SrcMgr(SM) {
   CurBuffer = 0;
   CurBuf = SrcMgr.getMemoryBuffer(CurBuffer);
   CurPtr = CurBuf->getBufferStart();

Modified: llvm/trunk/utils/TableGen/TGLexer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TGLexer.h?rev=73844&r1=73843&r2=73844&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/TGLexer.h (original)
+++ llvm/trunk/utils/TableGen/TGLexer.h Sat Jun 20 22:41:50 2009
@@ -22,7 +22,7 @@
 
 namespace llvm {
 class MemoryBuffer;
-class TGSourceMgr;
+class SourceMgr;
 class SMLoc;
   
 namespace tgtok {
@@ -58,7 +58,7 @@
 
 /// TGLexer - TableGen Lexer class.
 class TGLexer {
-  TGSourceMgr &SrcMgr;
+  SourceMgr &SrcMgr;
   
   const char *CurPtr;
   const MemoryBuffer *CurBuf;
@@ -77,7 +77,7 @@
   // include files in.
   std::vector<std::string> IncludeDirectories;
 public:
-  TGLexer(TGSourceMgr &SrcMgr);
+  TGLexer(SourceMgr &SrcMgr);
   ~TGLexer() {}
   
   void setIncludeDirs(const std::vector<std::string> &Dirs) {

Modified: llvm/trunk/utils/TableGen/TGParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TGParser.h?rev=73844&r1=73843&r2=73844&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/TGParser.h (original)
+++ llvm/trunk/utils/TableGen/TGParser.h Sat Jun 20 22:41:50 2009
@@ -47,7 +47,7 @@
   /// current value.
   MultiClass *CurMultiClass;
 public:
-  TGParser(TGSourceMgr &SrcMgr) : Lex(SrcMgr), CurMultiClass(0) {}
+  TGParser(SourceMgr &SrcMgr) : Lex(SrcMgr), CurMultiClass(0) {}
   
   void setIncludeDirs(const std::vector<std::string> &D){Lex.setIncludeDirs(D);}
 

Modified: llvm/trunk/utils/TableGen/TableGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TableGen.cpp?rev=73844&r1=73843&r2=73844&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/TableGen.cpp (original)
+++ llvm/trunk/utils/TableGen/TableGen.cpp Sat Jun 20 22:41:50 2009
@@ -124,7 +124,7 @@
 // FIXME: Eliminate globals from tblgen.
 RecordKeeper llvm::Records;
 
-static TGSourceMgr SrcMgr;
+static SourceMgr SrcMgr;
 
 void llvm::PrintError(SMLoc ErrorLoc, const std::string &Msg) {
   SrcMgr.PrintError(ErrorLoc, Msg);
@@ -136,7 +136,7 @@
 /// file.
 static bool ParseFile(const std::string &Filename,
                       const std::vector<std::string> &IncludeDirs,
-                      TGSourceMgr &SrcMgr) {
+                      SourceMgr &SrcMgr) {
   std::string ErrorStr;
   MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrorStr);
   if (F == 0) {





More information about the llvm-commits mailing list