1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
Use sys::Path not FileUtilities to check file types

llvm-svn: 18865
This commit is contained in:
Reid Spencer 2004-12-13 03:01:26 +00:00
parent 36c15ff8e1
commit 8563fa6493
2 changed files with 7 additions and 5 deletions

View File

@ -119,13 +119,14 @@ void DumpSymbolNamesFromModule (Module *M) {
void DumpSymbolNamesFromFile (std::string &Filename) {
std::string ErrorMessage;
if (Filename != "-" && !FileOpenable (Filename)) {
sys::Path aPath(Filename);
if (Filename != "-" && !aPath.readable()) {
std::cerr << ToolName << ": " << Filename << ": " << strerror (errno)
<< "\n";
return;
}
// Note: Currently we do not support reading an archive from stdin.
if (Filename == "-" || IsBytecode (Filename)) {
if (Filename == "-" || aPath.isBytecodeFile()) {
Module *Result = ParseBytecodeFile(Filename, &ErrorMessage);
if (Result) {
DumpSymbolNamesFromModule (Result);
@ -133,7 +134,7 @@ void DumpSymbolNamesFromFile (std::string &Filename) {
std::cerr << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
return;
}
} else if (IsArchive(Filename)) {
} else if (aPath.isArchive()) {
Archive* archive = Archive::OpenAndLoad(sys::Path(Filename));
if (!archive)
std::cerr << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";

View File

@ -780,8 +780,9 @@ public:
if (finalPhase == LINKING) {
// Insert the platform-specific system libraries to the path list
LibraryPaths.push_back(sys::Path::GetSystemLibraryPath1());
LibraryPaths.push_back(sys::Path::GetSystemLibraryPath2());
std::vector<sys::Path> SysLibs;
sys::Path::GetSystemLibraryPaths(SysLibs);
LibraryPaths.insert(LibraryPaths.end(), SysLibs.begin(), SysLibs.end());
// Set up the linking action with llvm-ld
Action* link = new Action();