diff options
author | Dan Gohman <gohman@apple.com> | 2009-09-08 22:20:35 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-09-08 22:20:35 +0000 |
commit | f31657990191d5b2bb1eb3bd95020fc3375f0e3d (patch) | |
tree | 5e170bb6abddf76e773581fda8a7ade5387d8565 /lib | |
parent | f1c3d5010f465057600c9085bdb15a702ef4a598 (diff) | |
download | external_llvm-f31657990191d5b2bb1eb3bd95020fc3375f0e3d.zip external_llvm-f31657990191d5b2bb1eb3bd95020fc3375f0e3d.tar.gz external_llvm-f31657990191d5b2bb1eb3bd95020fc3375f0e3d.tar.bz2 |
Use MemoryBuffer::getBufferIdentifier() in the AsmPrinter instead
of requiring a name be passed in. This makes it use "<stdin>"
instead of "-" and makes it more consistent with the Bitcode reader.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AsmParser/Parser.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/AsmParser/Parser.cpp b/lib/AsmParser/Parser.cpp index 3fc913b..331a233 100644 --- a/lib/AsmParser/Parser.cpp +++ b/lib/AsmParser/Parser.cpp @@ -22,7 +22,6 @@ using namespace llvm; Module *llvm::ParseAssembly(MemoryBuffer *F, - const std::string &Name, Module *M, SMDiagnostic &Err, LLVMContext &Context) { @@ -34,7 +33,7 @@ Module *llvm::ParseAssembly(MemoryBuffer *F, return LLParser(F, SM, Err, M).Run() ? 0 : M; // Otherwise create a new module. - OwningPtr<Module> M2(new Module(Name, Context)); + OwningPtr<Module> M2(new Module(F->getBufferIdentifier(), Context)); if (LLParser(F, SM, Err, M2.get()).Run()) return 0; return M2.take(); @@ -50,7 +49,7 @@ Module *llvm::ParseAssemblyFile(const std::string &Filename, SMDiagnostic &Err, return 0; } - return ParseAssembly(F, Filename, 0, Err, Context); + return ParseAssembly(F, 0, Err, Context); } Module *llvm::ParseAssemblyString(const char *AsmString, Module *M, @@ -59,5 +58,5 @@ Module *llvm::ParseAssemblyString(const char *AsmString, Module *M, MemoryBuffer::getMemBuffer(AsmString, AsmString+strlen(AsmString), "<string>"); - return ParseAssembly(F, "<string>", M, Err, Context); + return ParseAssembly(F, M, Err, Context); } |