summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/Parser.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-06-27 04:33:58 +0000
committerAlp Toker <alp@nuanti.com>2014-06-27 04:33:58 +0000
commit5ebb7b311223bcd21d2b3d25413d1edacefcc63d (patch)
treeacd3732ac3d49c105b8fd588f2f46603f4993d2e /llvm/lib/AsmParser/Parser.cpp
parent493f91b6dedaf5dfb636b10dc30eb2b0d8cb2ff4 (diff)
downloadbcm5719-llvm-5ebb7b311223bcd21d2b3d25413d1edacefcc63d.tar.gz
bcm5719-llvm-5ebb7b311223bcd21d2b3d25413d1edacefcc63d.zip
ParseIR: don't take ownership of the MemoryBuffer
clang was needlessly duplicating whole memory buffer contents in an attempt to satisfy unclear ownership semantics. Let's just hide internal LLVM quirks and present a simple non-owning interface. The public C API preserves previous behaviour for stability. llvm-svn: 211861
Diffstat (limited to 'llvm/lib/AsmParser/Parser.cpp')
-rw-r--r--llvm/lib/AsmParser/Parser.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/AsmParser/Parser.cpp b/llvm/lib/AsmParser/Parser.cpp
index 067cac8578c..2138fde5eb2 100644
--- a/llvm/lib/AsmParser/Parser.cpp
+++ b/llvm/lib/AsmParser/Parser.cpp
@@ -54,8 +54,7 @@ Module *llvm::ParseAssemblyFile(const std::string &Filename, SMDiagnostic &Err,
Module *llvm::ParseAssemblyString(const char *AsmString, Module *M,
SMDiagnostic &Err, LLVMContext &Context) {
MemoryBuffer *F =
- MemoryBuffer::getMemBuffer(StringRef(AsmString, strlen(AsmString)),
- "<string>");
+ MemoryBuffer::getMemBuffer(StringRef(AsmString), "<string>");
return ParseAssembly(F, M, Err, Context);
}
OpenPOWER on IntegriCloud