Personal channel of @lancern

Topics: programming, hacking, memes, life, and more. Forward anything as you wish.

Join the discussion group for more fun.

Discord: https://discord.gg/RwUx9et7
GFW 改变干扰 Docker 官方安装脚本域名方式

有消息¹称当前 get.docker.comdownload.docker.com 中国大陆可以直连。但经测试,首次可以正常访问,但会重置后续连接,并不是真正停止干扰,这么做可能只是为了营造网络不稳定的假相,与干扰 GitHub 的方式类似。

Docker Hub 域名 hub.docker.com 依然完全无法直连。(本文有更新)

—— [1] V2EX
想看 cpp coroutine 展开的结果,搜了下果然 cppinsights 已经做了,挺好用的 https://cppinsights.io/s/81e9e954
Lancern's Treasure Chest
今天发现,执行 clang++ -S -Xclang -emit-llvm -o foo.s foo.cpp 将导致 clang 将 LLVM IR 输出写入名为 foo.s 的文件,而执行 clang++ -S -fsyntax-only -Xclang -emit-llvm -o foo.s foo.cpp 将导致 clang 将 LLVM IR 输出写入名为 foo.ll 的文件 经进一步检查,发现这是因为 -fsyntax-only 的存在会导致 clang driver 不再向 clang…
为什么会发现这个,是因为咱在调 compiler-explorer 屎山,发现他们生成 LLVM IR 输出的代码是这么写的:

1. 调用 clang 并传递 -Xclang -emit-llvm -S -fsyntax-only -o /tmp/example.s /tmp/example.cpp
2. 在 clang 执行完毕之后直接开读 example.ll 作为 LLVM IR 输出

起初还以为在这两步之间存在某种奇妙逻辑将 example.s 拷贝至 example.ll ,最后发现是依赖了上述的奇妙 clang 行为
今天发现,执行

clang++ -S -Xclang -emit-llvm -o foo.s foo.cpp


将导致 clang 将 LLVM IR 输出写入名为 foo.s 的文件,而执行

clang++ -S -fsyntax-only -Xclang -emit-llvm -o foo.s foo.cpp


将导致 clang 将 LLVM IR 输出写入名为 foo.ll 的文件

经进一步检查,发现这是因为 -fsyntax-only 的存在会导致 clang driver 不再向 clang -cc1 传递 -o 参数,而 -emit-llvm 又需要一个输出文件,因此 clang -cc1 生成了一个默认的输出文件名即 foo.ll
Back to Top