mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 10:32:48 +02:00
[Remarks] Allow empty temporary remark files
When parsing bitstream remarks, allow external remark files to be empty, which means there are no remarks to be parsed. In the same way, dsymutil should not produce a remark file.
This commit is contained in:
parent
f319b282ab
commit
600ec0d5c6
@ -428,8 +428,13 @@ Error BitstreamRemarkParser::processExternalFilePath(
|
||||
MemoryBuffer::getFile(FullPath);
|
||||
if (std::error_code EC = BufferOrErr.getError())
|
||||
return createFileError(FullPath, EC);
|
||||
|
||||
TmpRemarkBuffer = std::move(*BufferOrErr);
|
||||
|
||||
// Don't try to parse the file if it's empty.
|
||||
if (TmpRemarkBuffer->getBufferSize() == 0)
|
||||
return make_error<EndOfFileError>();
|
||||
|
||||
// Create a separate parser used for parsing the separate file.
|
||||
ParserHelper = BitstreamParserHelper(TmpRemarkBuffer->getBuffer());
|
||||
// Advance and check until we can parse the meta block.
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
Remarks compilation:
|
||||
for FILE in basic1.c basic2.c basic3.c; do
|
||||
clang -gline-tables-only -c $FILE -fsave-optimization-record=bitstream -foptimization-remarks-file=/tmp/${FILE%.c}.macho.remarks.x86_64.opt.bitstream -mllvm -remarks-section -o ${FILE%.c}.macho.remarks.x86_64.o
|
||||
clang -gline-tables-only -c $FILE -fsave-optimization-record=bitstream -foptimization-record-file=/remarks/${FILE%.c}.macho.remarks.x86_64.opt.bitstream -o ${FILE%.c}.macho.remarks.x86_64.o
|
||||
done
|
||||
clang basic1.macho.remarks.x86_64.o basic2.macho.remarks.x86_64.o basic3.macho.remarks.x86_64.o -o basic.macho.remarks.x86_64 -Wl,-dead_strip
|
||||
|
||||
|
BIN
test/tools/dsymutil/Inputs/remarks/basic.macho.remarks.empty.x86_64
Executable file
BIN
test/tools/dsymutil/Inputs/remarks/basic.macho.remarks.empty.x86_64
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
RUN: rm -rf %t
|
||||
RUN: mkdir -p %t
|
||||
RUN: cat %p/../Inputs/remarks/basic.macho.remarks.empty.x86_64 > %t/basic.macho.remarks.empty.x86_64
|
||||
|
||||
RUN: dsymutil -oso-prepend-path=%p/../Inputs -remarks-prepend-path=%p/../Inputs %t/basic.macho.remarks.empty.x86_64
|
||||
|
||||
Check that the remark file in the bundle does not exist:
|
||||
RUN: not cat %t/basic.macho.remarks.empty.x86_64.dSYM/Contents/Resources/Remarks/basic.macho.remarks.empty.x86_64 2>&1
|
Loading…
Reference in New Issue
Block a user