summaryrefslogtreecommitdiff
path: root/lib/AsmParser/Parser.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-07-22 18:36:00 +0000
committerChris Lattner <sabre@nondot.org>2001-07-22 18:36:00 +0000
commita28504313d4c3fe87173a71b511dd4c8e25c3312 (patch)
treed4badd0bbe33e6e77c51cb5a569e1a4314e69674 /lib/AsmParser/Parser.cpp
parent86b5f3c52417c2d85595844a73fd2134d8975038 (diff)
downloadllvm-a28504313d4c3fe87173a71b511dd4c8e25c3312.tar.gz
llvm-a28504313d4c3fe87173a71b511dd4c8e25c3312.tar.bz2
llvm-a28504313d4c3fe87173a71b511dd4c8e25c3312.tar.xz
Remove dependence on command line library. Silly anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/Parser.cpp')
-rw-r--r--lib/AsmParser/Parser.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/AsmParser/Parser.cpp b/lib/AsmParser/Parser.cpp
index 57c831e9e1..626fe263ad 100644
--- a/lib/AsmParser/Parser.cpp
+++ b/lib/AsmParser/Parser.cpp
@@ -12,19 +12,19 @@
// The useful interface defined by this file... Parse an ascii file, and return
// the internal representation in a nice slice'n'dice'able representation.
//
-Module *ParseAssemblyFile(const ToolCommandLine &Opts) throw (ParseException) {
+Module *ParseAssemblyFile(const string &Filename) throw (ParseException) {
FILE *F = stdin;
- if (Opts.getInputFilename() != "-")
- F = fopen(Opts.getInputFilename().c_str(), "r");
+ if (Filename != "-")
+ F = fopen(Filename.c_str(), "r");
if (F == 0) {
- throw ParseException(Opts, string("Could not open file '") +
- Opts.getInputFilename() + "'");
+ throw ParseException(Filename, string("Could not open file '") +
+ Filename + "'");
}
// TODO: If this throws an exception, F is not closed.
- Module *Result = RunVMAsmParser(Opts, F);
+ Module *Result = RunVMAsmParser(Filename, F);
if (F != stdin)
fclose(F);
@@ -38,7 +38,7 @@ Module *ParseAssemblyFile(const ToolCommandLine &Opts) throw (ParseException) {
for (unsigned i = 0; i < Errors.size(); i++)
Message += Errors[i] + "\n";
- throw ParseException(Opts, Message);
+ throw ParseException(Filename, Message);
}
}
return Result;
@@ -50,14 +50,14 @@ Module *ParseAssemblyFile(const ToolCommandLine &Opts) throw (ParseException) {
//===------------------------------------------------------------------------===
-ParseException::ParseException(const ToolCommandLine &opts,
- const string &message, int lineNo, int colNo)
- : Opts(opts), Message(message) {
+ParseException::ParseException(const string &filename, const string &message,
+ int lineNo, int colNo)
+ : Filename(filename), Message(message) {
LineNo = lineNo; ColumnNo = colNo;
}
ParseException::ParseException(const ParseException &E)
- : Opts(E.Opts), Message(E.Message) {
+ : Filename(E.Filename), Message(E.Message) {
LineNo = E.LineNo;
ColumnNo = E.ColumnNo;
}
@@ -66,10 +66,10 @@ const string ParseException::getMessage() const { // Includes info from options
string Result;
char Buffer[10];
- if (Opts.getInputFilename() == "-")
+ if (Filename == "-")
Result += "<stdin>";
else
- Result += Opts.getInputFilename();
+ Result += Filename;
if (LineNo != -1) {
sprintf(Buffer, "%d", LineNo);