[LLVMbugs] [Bug 20095] New: opt -print-callgraph outputs unescaped \x01 characters from symbol names.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jun 21 11:55:19 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20095

            Bug ID: 20095
           Summary: opt -print-callgraph outputs unescaped \x01 characters
                    from symbol names.
           Product: tools
           Version: 3.4
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: opt
          Assignee: unassignedbugs at nondot.org
          Reporter: gwk.lists at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Apparently OSX (or maybe LLVM) uses \01 (SOH) characters for some symbol names,
e.g. @"\01_fputs" (I'm curious why such strange symbols are used?). These are
escaped in the IR from clang -S -emit-llvm. However, when opt prints them out
using -print-callgraph it does not escape them, which seems wrong. below is a
repro shell script. grep will output lines that contain actual SOH characters;
these are not visible on the command line but cause my post-processing script
to choke.

  printf "#include <stdio.h>\nint main() { fputs(\"hi\\\\n\", stdout); return
0; }\n" > hi.c
  clang -S -emit-llvm -o hi.llvm hi.c
  opt -analyze -print-callgraph hi.llvm 2> hi.cg
  grep $'\x01' hi.cg 

also, despite the fact that the -print-callgraph option is clearly working, opt
is outputting the following weird message to stdout:
Printing analysis 'Print a call graph':
Pass::print not implemented for pass: 'Print a call graph'!

this is with the clang 3.4.1 binary build for darwin distributed by llvm.org.

$ clang --version
clang version 3.4.1 (tags/RELEASE_34/dot1-rc2)
Target: x86_64-apple-darwin13.2.0
Thread model: posix

$ opt --version
LLVM (http://llvm.org/):
  LLVM version 3.4.1
  Optimized build.
  Default target: x86_64-apple-darwin13.2.0
  Host CPU: core-avx-i

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140621/044658a1/attachment.html>


More information about the llvm-bugs mailing list