зеркало из https://github.com/microsoft/clang-1.git
Better handing of stdin/stdout for -emit-llvm-bc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45345 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
2d6c065fa9
Коммит
8bd848f1e8
|
@ -644,14 +644,14 @@ ASTConsumer *clang::CreateBCWriter(const std::string& InFile,
|
|||
std::string FileName = OutputFile;
|
||||
|
||||
std::ostream *Out;
|
||||
if (!OutputFile.size()) {
|
||||
if (OutputFile == "-" || InFile == "-")
|
||||
Out = llvm::cout.stream();
|
||||
else if (!OutputFile.size()) {
|
||||
llvm::sys::Path Path(InFile);
|
||||
Path.eraseSuffix();
|
||||
Path.appendSuffix("bc");
|
||||
FileName = Path.toString();
|
||||
Out = new std::ofstream(FileName.c_str());
|
||||
} else if (OutputFile == "-") {
|
||||
Out = llvm::cout.stream();
|
||||
} else {
|
||||
Out = new std::ofstream(FileName.c_str());
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче