[llvm-bugs] [Bug 33688] New: Should not hit the disk when reading annotations

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 4 07:53:42 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33688

            Bug ID: 33688
           Summary: Should not hit the disk when reading annotations
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Modules
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vvasilev at cern.ch
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

echo 'void* func(char* p)   __attribute__((annotate("blah"))); void*
func(char* p){return p;}' > HEADER.h

   clang++ -std=c++14 -x c++-header -o HEADER.h.pch HEADER.h
   chmod a-r HEADER.h
   echo 'char i; void* ptr = func(&i);' | clang++ -v -std=c++14 -Xclang
-fno-validate-pch -include-pch HEADER.h.pch -c -Xclang -emit-llvm -o -
-x c++ -


creates an error - again because it touches disk where it shouldn't,
with this backtrace:


#0  clang::TextDiagnosticPrinter::HandleDiagnostic (this=0xbbab1d0,
Level=clang::DiagnosticsEngine::Fatal, Info=...) at
/home/axel/build/llvm-orig/src/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:111
#1  0x0000000003faf738 in clang::DiagnosticIDs::EmitDiag
(this=0xbba9790, Diag=..., DiagLevel=clang::DiagnosticIDs::Fatal) at
/home/axel/build/llvm-orig/src/tools/clang/lib/Basic/DiagnosticIDs.cpp:682
#2  0x0000000003faf698 in clang::DiagnosticIDs::ProcessDiag
(this=0xbba9790, Diag=...) at
/home/axel/build/llvm-orig/src/tools/clang/lib/Basic/DiagnosticIDs.cpp:674
#3  0x0000000003fa516a in clang::DiagnosticsEngine::ProcessDiag
(this=0xbbaa450) at
/home/axel/build/llvm-orig/src/tools/clang/include/clang/Basic/Diagnostic.h:879
#4  0x0000000003fa1f94 in
clang::DiagnosticsEngine::EmitCurrentDiagnostic (this=0xbbaa450,
Force=false) at
/home/axel/build/llvm-orig/src/tools/clang/lib/Basic/Diagnostic.cpp:418
#5  0x0000000001e4cc6c in clang::DiagnosticBuilder::Emit
(this=0x7fffffff7c10) at
/home/axel/build/llvm-orig/src/tools/clang/include/clang/Basic/Diagnostic.h:1013
#6  0x0000000001e4cc9a in clang::DiagnosticBuilder::~DiagnosticBuilder
(this=0x7fffffff7c10, __in_chrg=<optimized out>)
    at
/home/axel/build/llvm-orig/src/tools/clang/include/clang/Basic/Diagnostic.h:1036
#7  0x0000000003fb297a in clang::SrcMgr::ContentCache::getBuffer
(this=0xbbb92d8, Diag=..., SM=..., Loc=..., Invalid=0x7fffffff82c0)
    at
/home/axel/build/llvm-orig/src/tools/clang/lib/Basic/SourceManager.cpp:123
#8  0x0000000003fb76c6 in ComputeLineNumbers (Diag=..., FI=0xbbb92d8,
Alloc=..., SM=..., Invalid=@0x7fffffff82c0: false) at
/home/axel/build/llvm-orig/src/tools/clang/lib/Basic/SourceManager.cpp:1186
#9  0x0000000003fb800a in clang::SourceManager::getLineNumber
(this=0xbbad1a0, FID=..., FilePos=63, Invalid=0x7fffffff833f)
    at
/home/axel/build/llvm-orig/src/tools/clang/lib/Basic/SourceManager.cpp:1298
#10 0x0000000003fb8724 in clang::SourceManager::getPresumedLoc
(this=0xbbad1a0, Loc=..., UseLineDirectives=true) at
/home/axel/build/llvm-orig/src/tools/clang/lib/Basic/SourceManager.cpp:1462
#11 0x0000000004192a13 in
clang::CodeGen::CodeGenModule::EmitAnnotationUnit (this=0xbbe1620,
Loc=...) at
/home/axel/build/llvm-orig/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:1494
#12 0x0000000004192bda in
clang::CodeGen::CodeGenModule::EmitAnnotateAttr (this=0xbbe1620,
GV=0xbbc2dd8, AA=0xbbeacb0, L=...)
    at
/home/axel/build/llvm-orig/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:1513
#13 0x0000000004192d82 in
clang::CodeGen::CodeGenModule::AddGlobalAnnotations (this=0xbbe1620,
D=0xbbeaa28, GV=0xbbc2dd8)
    at
/home/axel/build/llvm-orig/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:1531
#14 0x00000000041999ed in
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition
(this=0xbbe1620, GD=..., GV=0xbbc2dd8)
    at
/home/axel/build/llvm-orig/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:3178
#15 0x00000000041950e0 in
clang::CodeGen::CodeGenModule::EmitGlobalDefinition (this=0xbbe1620,
GD=..., GV=0x0) at
/home/axel/build/llvm-orig/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:2016
#16 0x000000000419412c in clang::CodeGen::CodeGenModule::EmitGlobal
(this=0xbbe1620, GD=...) at
/home/axel/build/llvm-orig/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:1792
#17 0x000000000419d7e7 in
clang::CodeGen::CodeGenModule::EmitTopLevelDecl (this=0xbbe1620,
D=0xbbeaa28) at
/home/axel/build/llvm-orig/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:3892

-- 
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/20170704/eaa8cddb/attachment-0001.html>


More information about the llvm-bugs mailing list