projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a bug introduced during refactoring a couple of months ago. Cortex-M3 does not...
[oota-llvm.git]
/
lib
/
Linker
/
LinkItems.cpp
diff --git
a/lib/Linker/LinkItems.cpp
b/lib/Linker/LinkItems.cpp
index 1be2becc86c38a704422c980bee378a86f7c12b3..52a0d175a5cdd8bd66a81b04b05279bc46eea4a4 100644
(file)
--- a/
lib/Linker/LinkItems.cpp
+++ b/
lib/Linker/LinkItems.cpp
@@
-15,9
+15,10
@@
#include "llvm/Linker.h"
#include "llvm/Module.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Linker.h"
#include "llvm/Module.h"
#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/S
ystem
/Path.h"
+#include "llvm/S
upport
/Path.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/system_error.h"
using namespace llvm;
// LinkItems - This function is the main entry point into linking. It takes a
using namespace llvm;
// LinkItems - This function is the main entry point into linking. It takes a
@@
-160,19
+161,19
@@
bool Linker::LinkInFile(const sys::Path &File, bool &is_native) {
// Check for a file of name "-", which means "read standard input"
if (File.str() == "-") {
std::auto_ptr<Module> M;
// Check for a file of name "-", which means "read standard input"
if (File.str() == "-") {
std::auto_ptr<Module> M;
- if (MemoryBuffer *Buffer = MemoryBuffer::getSTDIN(&Error)) {
+ OwningPtr<MemoryBuffer> Buffer;
+ error_code ec;
+ if (!(ec = MemoryBuffer::getSTDIN(Buffer))) {
if (!Buffer->getBufferSize()) {
if (!Buffer->getBufferSize()) {
- delete Buffer;
Error = "standard input is empty";
} else {
Error = "standard input is empty";
} else {
- M.reset(ParseBitcodeFile(Buffer, Context, &Error));
- delete Buffer;
+ M.reset(ParseBitcodeFile(Buffer.get(), Context, &Error));
if (M.get())
if (!LinkInModule(M.get(), &Error))
return false;
}
}
if (M.get())
if (!LinkInModule(M.get(), &Error))
return false;
}
}
- return error("Cannot link stdin: " +
Error
);
+ return error("Cannot link stdin: " +
ec.message()
);
}
// Determine what variety of file it is.
}
// Determine what variety of file it is.