summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-21 03:41:50 +0000
committerChris Lattner <sabre@nondot.org>2009-06-21 03:41:50 +0000
commit8070ea3f068980d08cc10381f4c9369d19a91353 (patch)
tree90dce9a5009eec0859f57ddb959279d841635de9
parent1e3a8a492471f5dc3f50452af9eb9a2dfb1aeb39 (diff)
downloadllvm-8070ea3f068980d08cc10381f4c9369d19a91353.tar.gz
llvm-8070ea3f068980d08cc10381f4c9369d19a91353.tar.bz2
llvm-8070ea3f068980d08cc10381f4c9369d19a91353.tar.xz
Rename TGSourceMgr -> SourceMgr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73844 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/SourceMgr.h18
-rw-r--r--lib/Support/CMakeLists.txt1
-rw-r--r--lib/Support/SourceMgr.cpp10
-rw-r--r--utils/TableGen/CMakeLists.txt1
-rw-r--r--utils/TableGen/TGLexer.cpp2
-rw-r--r--utils/TableGen/TGLexer.h6
-rw-r--r--utils/TableGen/TGParser.h2
-rw-r--r--utils/TableGen/TableGen.cpp4
8 files changed, 22 insertions, 22 deletions
diff --git a/include/llvm/Support/SourceMgr.h b/include/llvm/Support/SourceMgr.h
index d097afd1b9..953cf897b9 100644
--- a/include/llvm/Support/SourceMgr.h
+++ b/include/llvm/Support/SourceMgr.h
@@ -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 @@ public:
}
};
-/// 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 @@ class TGSourceMgr {
/// 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!");
diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt
index 7c8ce706b6..e7a76cc3f2 100644
--- a/lib/Support/CMakeLists.txt
+++ b/lib/Support/CMakeLists.txt
@@ -19,6 +19,7 @@ add_llvm_library(LLVMSupport
PrettyStackTrace.cpp
SlowOperationInformer.cpp
SmallPtrSet.cpp
+ SourceMgr.cpp
Statistic.cpp
Streams.cpp
StringExtras.cpp
diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp
index 1d0bccb34b..40a6f43f5e 100644
--- a/lib/Support/SourceMgr.cpp
+++ b/lib/Support/SourceMgr.cpp
@@ -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 @@ TGSourceMgr::~TGSourceMgr() {
/// 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 @@ int TGSourceMgr::FindBufferContainingLoc(SMLoc Loc) const {
/// 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 @@ unsigned TGSourceMgr::FindLineNumber(SMLoc Loc, int BufferID) const {
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::PrintIncludeStack(SMLoc IncludeLoc) const {
}
-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
diff --git a/utils/TableGen/CMakeLists.txt b/utils/TableGen/CMakeLists.txt
index 3f982e0c77..6ec1d99679 100644
--- a/utils/TableGen/CMakeLists.txt
+++ b/utils/TableGen/CMakeLists.txt
@@ -17,7 +17,6 @@ add_executable(tblgen
SubtargetEmitter.cpp
TGLexer.cpp
TGParser.cpp
- TGSourceMgr.cpp
TGValueTypes.cpp
TableGen.cpp
TableGenBackend.cpp
diff --git a/utils/TableGen/TGLexer.cpp b/utils/TableGen/TGLexer.cpp
index 2f619e4db0..578930c85f 100644
--- a/utils/TableGen/TGLexer.cpp
+++ b/utils/TableGen/TGLexer.cpp
@@ -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();
diff --git a/utils/TableGen/TGLexer.h b/utils/TableGen/TGLexer.h
index 82f312a338..38a1d2f2ee 100644
--- a/utils/TableGen/TGLexer.h
+++ b/utils/TableGen/TGLexer.h
@@ -22,7 +22,7 @@
namespace llvm {
class MemoryBuffer;
-class TGSourceMgr;
+class SourceMgr;
class SMLoc;
namespace tgtok {
@@ -58,7 +58,7 @@ namespace tgtok {
/// TGLexer - TableGen Lexer class.
class TGLexer {
- TGSourceMgr &SrcMgr;
+ SourceMgr &SrcMgr;
const char *CurPtr;
const MemoryBuffer *CurBuf;
@@ -77,7 +77,7 @@ class TGLexer {
// include files in.
std::vector<std::string> IncludeDirectories;
public:
- TGLexer(TGSourceMgr &SrcMgr);
+ TGLexer(SourceMgr &SrcMgr);
~TGLexer() {}
void setIncludeDirs(const std::vector<std::string> &Dirs) {
diff --git a/utils/TableGen/TGParser.h b/utils/TableGen/TGParser.h
index 8602357418..d06e9585cb 100644
--- a/utils/TableGen/TGParser.h
+++ b/utils/TableGen/TGParser.h
@@ -47,7 +47,7 @@ class TGParser {
/// 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);}
diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp
index a1b768ee7b..0d5d86fdd6 100644
--- a/utils/TableGen/TableGen.cpp
+++ b/utils/TableGen/TableGen.cpp
@@ -124,7 +124,7 @@ namespace {
// 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 @@ void llvm::PrintError(SMLoc ErrorLoc, const std::string &Msg) {
/// 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) {