Linker::LoadObject(const sys::Path &FN) {
std::string ParseErrorMessage;
Module *Result = 0;
-
+
std::auto_ptr<MemoryBuffer> Buffer(MemoryBuffer::getFileOrSTDIN(FN.c_str()));
if (Buffer.get())
Result = ParseBitcodeFile(Buffer.get(), Context, &ParseErrorMessage);
else
ParseErrorMessage = "Error reading file '" + FN.str() + "'";
-
+
if (Result)
return std::auto_ptr<Module>(Result);
Error = "Bitcode file '" + FN.str() + "' could not be loaded";
// Try the libX.so (or .dylib) form
FullPath.eraseSuffix();
- FullPath.appendSuffix(&(LTDL_SHLIB_EXT[1]));
+ FullPath.appendSuffix(sys::Path::GetDLLSuffix());
if (FullPath.isDynamicLibrary()) // Native shared library?
return FullPath;
if (FullPath.isBitcodeFile()) // .so file containing bitcode?