Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2369)

Unified Diff: src/gdb-jit.cc

Issue 1111733002: [clang] Use -Wshorten-64-to-32 to enable warnings about 64bit to 32bit truncations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Win warnings. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flags.cc ('k') | src/snapshot/mksnapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gdb-jit.cc
diff --git a/src/gdb-jit.cc b/src/gdb-jit.cc
index 0664c6091a68f299db7822a69c06cf12eeb6c25f..2de4e66b4950cb4d7d464db98246001def2deb98 100644
--- a/src/gdb-jit.cc
+++ b/src/gdb-jit.cc
@@ -179,7 +179,7 @@ class DebugSectionBase : public ZoneObject {
uintptr_t start = writer->position();
if (WriteBodyInternal(writer)) {
uintptr_t end = writer->position();
- header->offset = start;
+ header->offset = static_cast<uint32_t>(start);
#if defined(__MACH_O)
header->addr = 0;
#endif
@@ -465,7 +465,7 @@ class ELFStringTable : public ELFSection {
void ELFSection::PopulateHeader(Writer::Slot<ELFSection::Header> header,
ELFStringTable* strtab) {
- header->name = strtab->Add(name_);
+ header->name = static_cast<uint32_t>(strtab->Add(name_));
header->type = type_;
header->alignment = align_;
PopulateHeader(header);
@@ -813,7 +813,7 @@ class ELFSymbol BASE_EMBEDDED {
void Write(Writer::Slot<SerializedLayout> s, ELFStringTable* t) {
// Convert symbol names from strings to indexes in the string table.
- s->name = t->Add(name);
+ s->name = static_cast<uint32_t>(t->Add(name));
s->value = value;
s->size = size;
s->info = info;
@@ -1638,7 +1638,7 @@ void UnwindInfoSection::WriteLength(Writer* w,
}
DCHECK((w->position() - initial_position) % kPointerSize == 0);
- length_slot->set(w->position() - initial_position);
+ length_slot->set(static_cast<uint32_t>(w->position() - initial_position));
}
@@ -1653,7 +1653,7 @@ UnwindInfoSection::UnwindInfoSection(CodeDescription* desc)
int UnwindInfoSection::WriteCIE(Writer* w) {
Writer::Slot<uint32_t> cie_length_slot = w->CreateSlotHere<uint32_t>();
- uint32_t cie_position = w->position();
+ uint32_t cie_position = static_cast<uint32_t>(w->position());
// Write out the CIE header. Currently no 'common instructions' are
// emitted onto the CIE; every FDE has its own set of instructions.
@@ -1674,7 +1674,7 @@ int UnwindInfoSection::WriteCIE(Writer* w) {
void UnwindInfoSection::WriteFDE(Writer* w, int cie_position) {
// The only FDE for this function. The CFA is the current RBP.
Writer::Slot<uint32_t> fde_length_slot = w->CreateSlotHere<uint32_t>();
- int fde_position = w->position();
+ int fde_position = static_cast<uint32_t>(w->position());
w->Write<int32_t>(fde_position - cie_position + 4);
w->Write<uintptr_t>(desc_->CodeStart());
@@ -2067,7 +2067,8 @@ static void AddJITCodeEntry(CodeMap* map, const AddressRange& range,
SNPrintF(Vector<char>(file_name, kMaxFileNameSize), "/tmp/elfdump%s%d.o",
(name_hint != NULL) ? name_hint : "", file_num++);
- WriteBytes(file_name, entry->symfile_addr_, entry->symfile_size_);
+ WriteBytes(file_name, entry->symfile_addr_,
+ static_cast<int>(entry->symfile_size_));
}
#endif
« no previous file with comments | « src/flags.cc ('k') | src/snapshot/mksnapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698