[cfe-dev] Question about passing -v -save-temps cmd args to clang++

Mahesha S via cfe-dev cfe-dev at lists.llvm.org
Thu Feb 28 23:15:50 PST 2019


Hello all,

This could be a naive question, but still asking it here because of my
limited knowledge on clang/llvm infrastructure.

*Question:* When I pass `-v save-temps` options to clang++, I was expecting
to see the command line for both `opt` and `llc` in the expanded command
line output, but, I don't see it. What am I missing?

*Clang++ Command Line:*  clang++ -v -save-temps hello.cpp

*Expanded Command Line Output:*

clang version 9.0.0 (https://github.com/llvm/llvm-project.git
2d6bb13443d86d650e92b280d4f7df0805eebac7)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/mahesha/LLVM/install/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
 "/home/mahesha/LLVM/install/bin/clang-9" -cc1 -triple
x86_64-unknown-linux-gnu -E -save-temps=cwd -disable-free -main-file-name
hello.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim
-fmath-
errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir
/home/mahesha/LLVM/install/lib/clang/9.0.0 -internal-isystem
 /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0
-internal-isystem /usr/lib/gcc/x86_64-linux
-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/backward
-internal-isystem /usr/local/include -internal-isystem /home
/mahesha/LLVM/install/lib/clang/9.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilat
ion-dir /home/mahesha/Scratch -ferror-limit 19 -fmessage-length 211
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o hello.ii -x c++ hello.cpp -faddrsig
clang -cc1 version 9.0.0 based upon LLVM 9.0.0svn default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
ignoring duplicate directory
"/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0
 /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0
 /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/backward
 /usr/local/include
 /home/mahesha/LLVM/install/lib/clang/9.0.0/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
 "/home/mahesha/LLVM/install/bin/clang-9" -cc1 -triple
x86_64-unknown-linux-gnu -emit-llvm-bc -emit-llvm-uselists -save-temps=cwd
-disable-free -main-file-name hello.cpp -mrelocation-model static
-mthread-model
posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -v -resource-dir /home/mahesha/LLVM/install/li
b/clang/9.0.0 -fdeprecated-macro -fdebug-compilation-dir
/home/mahesha/Scratch -ferror-limit 19 -fmessage-length 211
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics
 -disable-llvm-passes -o hello.bc -x c++-cpp-output hello.ii -faddrsig
clang -cc1 version 9.0.0 based upon LLVM 9.0.0svn default target
x86_64-unknown-linux-gnu
#include "..." search starts here:
End of search list.
 "/home/mahesha/LLVM/install/bin/clang-9" -cc1 -triple
x86_64-unknown-linux-gnu -S -save-temps=cwd -disable-free -main-file-name
hello.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim
-fmath-
errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir
/home/mahesha/LLVM/install/lib/clang/9.0.0 -fdebug-compilati
on-dir /home/mahesha/Scratch -ferror-limit 19 -fmessage-length 211
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o hello.s
-x ir hello.bc -faddrsig
clang -cc1 version 9.0.0 based upon LLVM 9.0.0svn default target
x86_64-unknown-linux-gnu
 "/home/mahesha/LLVM/install/bin/clang-9" -cc1as -triple
x86_64-unknown-linux-gnu -filetype obj -main-file-name hello.cpp
-target-cpu x86-64 -dwarf-version=4 -mrelocation-model static -mrelax-all
-o hello.o hell
o.s
 "/usr/bin/ld" -z relro --hash-style=gnu --eh-frame-hdr -m elf_x86_64
-dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../x86_64-linux-gnu/crt1.o
/usr/lib/gcc/x86_64
-linux-gnu/7.3.0/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/crtbegin.o
-L/usr/lib/gcc/x86_64-linux-gnu/7.3.0
-L/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../x86_64-linux-gnu -L/lib/x86_6
4-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../..
-L/home/mahesha/LLVM/install/bin/../lib -L/lib -L/usr/lib hello.o -lstdc++
-lm -lgcc_s -lgcc -lc -lgcc_s -lg
cc /usr/lib/gcc/x86_64-linux-gnu/7.3.0/crtend.o
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../x86_64-linux-gnu/crtn.o


-- 
Thanks,
Mahesha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190301/5bf222ab/attachment.html>


More information about the cfe-dev mailing list