[PATCH] D34984: Store token literal data in PCH. Avoids disk read on PreProc expansion.
Vassil Vassilev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 4 07:43:50 PDT 2017
v.g.vassilev added a subscriber: karies.
v.g.vassilev added a comment.
What would be the best way to test this. Shall we put:
echo '#define LITERAL 42' > HEADER.h
clang++ -std=c++14 -x c++-header -o HEADER.h.pch HEADER.h
chmod a-r HEADER.h
echo 'void f(int); void g() { f(12); }' | clang++ -std=c++14 -Xclang
-fno-validate-pch -include-pch HEADER.h.pch -c -Xclang -emit-llvm -o -
-x c++ -
# works, we see the IR
echo 'void f(int); void g() { f(LITERAL); }' | clang++ -std=c++14
-Xclang -fno-validate-pch -include-pch HEADER.h.pch -c -Xclang
-emit-llvm -o - -x c++ -
fatal error: cannot open file
'/home/axel/build/tmp/clang-repro-PCH-touches-disk-for-literal/HEADER.h':
Permission denied
1 error generated.
Repository:
rL LLVM
https://reviews.llvm.org/D34984
More information about the cfe-commits
mailing list