First Last Prev Next    No search results available
Details
: LLVM tools will happily spew bytecode onto your terminal
Bug#: 305
: tools
: opt
Status: RESOLVED
Resolution: FIXED
: All
: All
: 1.0
: P2
: enhancement
: 1.3

:
: quality-of-implementation
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Brian R. Gaeke <gaeke+bugs@uiuc.edu>
Assigned To: Chris Lattner <sabre@nondot.org>
:

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2004-03-30 13:22
Currently, if you say "opt -pass foo.bc", opt will run the pass and then
happily (but uselessly) spew the 
bytecode onto your terminal. This is liable to mess up your terminal modes. The
workaround is well-
known: you have to specify an output file or redirect stdout. This problem is
common to many llvm 
tools.

If autoconf finds that the isatty() call is available, any llvm tool (including
opt) that outputs bytecode 
should refuse to output it onto your terminal -- instead, you should get an
error message. In addition, 
any llvm tool that reads bytecode should refuse to read it from a terminal.
------- Comment #1 From Chris Lattner 2004-03-30 13:23:58 -------
Oooh, that would be nice.  One request though:  "opt a.bc -o - -f" should still
force spewage, though I'm not sure why someone would want this.

That way the error message could say "warning, I would have spewed.  Use -f if
you really want me to" :)

-Chris
------- Comment #2 From Misha Brukman 2004-03-30 13:55:00 -------
What's wrong with the current -disable-output option?
------- Comment #3 From Chris Lattner 2004-03-30 13:55:52 -------
The point is to protect you from ACCIDENTALLY causing bytecode spewage.

-Chris
------- Comment #4 From Chris Lattner 2004-04-01 23:09:29 -------
Ok, I fixed opt to check to see if the output is a terminal, and if so, refuse
to output a bytecode file.  Before we close this bug, I would appreciate it if
someone could autoconfiscate this patch:

http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040329/013422.html

While it's possible to add support for this to extract, gccld, gccas, llvm-link,
llvm-as, and llvm-ar, I don't really think it's worth it.  If someone disagrees,
feel free to go ahead and fix them. :)

-Chris
------- Comment #5 From Chris Lattner 2004-04-04 19:39:51 -------
This is now fixed. opt will no longer spew bytecode files to a TTY unless the -f
option is specified.

-Chris

First Last Prev Next    No search results available