summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-prof/llvm-prof.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-16 03:29:14 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-16 03:29:14 +0000
commit39a0ffc3949a746d0a09c9a3e01c183c9216da04 (patch)
treed045dd753f87830314c4fede77145544f5650b6a /llvm/tools/llvm-prof/llvm-prof.cpp
parent716d01a612022608467fb7071ef4669dd326e007 (diff)
downloadbcm5719-llvm-39a0ffc3949a746d0a09c9a3e01c183c9216da04.tar.gz
bcm5719-llvm-39a0ffc3949a746d0a09c9a3e01c183c9216da04.zip
MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
llvm-svn: 121958
Diffstat (limited to 'llvm/tools/llvm-prof/llvm-prof.cpp')
-rw-r--r--llvm/tools/llvm-prof/llvm-prof.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/llvm-prof/llvm-prof.cpp b/llvm/tools/llvm-prof/llvm-prof.cpp
index aa9cf004c74..9d0b46833be 100644
--- a/llvm/tools/llvm-prof/llvm-prof.cpp
+++ b/llvm/tools/llvm-prof/llvm-prof.cpp
@@ -264,11 +264,11 @@ int main(int argc, char **argv) {
// Read in the bitcode file...
std::string ErrorMessage;
+ OwningPtr<MemoryBuffer> Buffer;
error_code ec;
Module *M = 0;
- if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(BitcodeFile, ec)) {
- M = ParseBitcodeFile(Buffer, Context, &ErrorMessage);
- delete Buffer;
+ if (!(ec = MemoryBuffer::getFileOrSTDIN(BitcodeFile, Buffer))) {
+ M = ParseBitcodeFile(Buffer.get(), Context, &ErrorMessage);
} else
ErrorMessage = ec.message();
if (M == 0) {
OpenPOWER on IntegriCloud