summaryrefslogtreecommitdiffstats
path: root/llvm/tools/opt/opt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/opt/opt.cpp')
-rw-r--r--llvm/tools/opt/opt.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 6c770858930..218e5f0b1de 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -268,12 +268,8 @@ int main(int argc, char **argv) {
// Load the input module...
std::auto_ptr<Module> M;
if (Bitcode) {
- MemoryBuffer *Buffer;
- if (InputFilename == "-") {
- Buffer = MemoryBuffer::getSTDIN();
- } else {
- Buffer = MemoryBuffer::getFile(&InputFilename[0], InputFilename.size());
- }
+ MemoryBuffer *Buffer
+ = MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size());
if (Buffer == 0)
ErrorMessage = "Error reading file '" + InputFilename + "'";
OpenPOWER on IntegriCloud