Patch by Axel Naumann!
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
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.Comment Actions
Seems reasonable to store this with the token. Do you have performance data?
| include/clang/Serialization/ASTReader.h | ||
|---|---|---|
| 616 | Remove this use pointers directly into blob data from the token record (or BumpPtrAllocate the strings using the preprocessor's allocator if there's some reason you can't use blob data). | |
| lib/Serialization/ASTWriter.cpp | ||
| 4360 | Remove this FIXME | |
Remove this use pointers directly into blob data from the token record (or BumpPtrAllocate the strings using the preprocessor's allocator if there's some reason you can't use blob data).