[llvm] r260973 - A signed bitfield's range is [-1, 0], so assigning 1 is technically an overflow. However, the other bitfield requires a signed value (it supports negative offsets), so it is slightly better to retain a signed 1-bit bitfield and use -1 instead of 1. Silences an MSVC warning.
Aaron Ballman via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 16 07:35:51 PST 2016
Author: aaronballman
Date: Tue Feb 16 09:35:51 2016
New Revision: 260973
URL: http://llvm.org/viewvc/llvm-project?rev=260973&view=rev
Log:
A signed bitfield's range is [-1,0], so assigning 1 is technically an overflow. However, the other bitfield requires a signed value (it supports negative offsets), so it is slightly better to retain a signed 1-bit bitfield and use -1 instead of 1. Silences an MSVC warning.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp?rev=260973&r1=260972&r2=260973&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp Tue Feb 16 09:35:51 2016
@@ -495,7 +495,7 @@ void CodeViewDebug::emitDebugInfoForFunc
CodeViewDebug::LocalVarDefRange
CodeViewDebug::createDefRangeMem(uint16_t CVRegister, int Offset) {
LocalVarDefRange DR;
- DR.InMemory = 1;
+ DR.InMemory = -1;
DR.DataOffset = Offset;
assert(DR.DataOffset == Offset && "truncation");
DR.StructOffset = 0;
More information about the llvm-commits
mailing list