Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
bfff42c
Revert "[libc++][format] P3953R3: Rename `std::runtime_format` (#1896…
thurstond Apr 14, 2026
5753b3f
[AMDGPU] Preserve metadata in all barrier lowering paths (#191916)
hidekisaito Apr 14, 2026
aab5c10
[Offload] Revert part of #187138. Workaround #191910 (#191925)
ye-luo Apr 14, 2026
12f636d
Revert "[libclc][CMake] Use clang/llvm-ar on Windows (#186726)" (#191…
wenju-he Apr 14, 2026
2874480
[MLIR][Python] Migrate `result(infer_type=True)` to a new field speci…
PragmaTwice Apr 14, 2026
93871c5
[CIR][CUDA] Global emission for fatbin symbols (#187636)
RiverDave Apr 14, 2026
42ce5c1
[bazel] Restore MLIR bytecode tests. (#191938)
jpienaar Apr 14, 2026
92dde79
[CIR] Add addLLVMUsed and addLLVMCompilerUsed methods to CIRGenModule…
skc7 Apr 14, 2026
f2a71ca
[clang][OpenMP][test] Use -fopenmp=libomp explicitly in driver smoke …
leonardo-roman-carrillo Apr 14, 2026
c2624b5
[NFC] Use stable_sort to fix the basic-block-sections-code-prefetch.l…
rlavaee Apr 14, 2026
93a6725
[ToolChains][FreeBSD] Set default Linker to LLD for FreeBSD (#190596)
aokblast Apr 14, 2026
8619a5e
[flang][OpenMP] Avoid marking named main programs as declare target (…
Saieiei Apr 14, 2026
f4e1a51
[bolt] Remove unused argument of DataExtractor constructor (NFC) (#19…
s-barannikov Apr 14, 2026
d9c02ff
[XRay] Remove unused argument of DataExtractor constructor (NFC) (#19…
s-barannikov Apr 14, 2026
b8b5962
[NFC] clang-format llvm/lib/CodeGen/InsertCodePrefetch.cpp. (#191959)
rlavaee Apr 14, 2026
4ea9b49
[clangd] Update TidyFastChecks.inc via TidyFastChecks.py (#191096)
nataliakokoromyti Apr 14, 2026
6a88394
[RISCV] Add Zvzip intrinsics (#186342)
wangpc-pp Apr 14, 2026
8c9ce12
[clang][bytecode] Use qualified name in `Function::dump()` (#191958)
tbaederr Apr 14, 2026
78cd6c9
[LifetimeSafety] Detect use-after-scope through fields in member call…
NeKon69 Apr 14, 2026
c61b070
[clang][bytecode] Use `CopyArray` for primitive ArrayInitLoops (#191956)
tbaederr Apr 14, 2026
4b4aa3b
[DAG] Add funnel-shift matchers to SDPatternMatch (Fixes #185880) (#1…
0bVdnt Apr 14, 2026
08fb464
[AVX-512] Fix for disjoint-or-fold (VGF2P8AFFINEQB) (#190896)
Ko496-glitch Apr 14, 2026
dd034ae
[X86] Fix VPMOVPattern folding for extended registers (#191760)
realqhc Apr 14, 2026
c838322
[libc++] LWG4511: Inconsistency between the deduction guide of `std::…
eiytoq Apr 14, 2026
2332c5d
[LV] Remove legacy selectVectorizationFactor and assert (NFCI) (#190838)
fhahn Apr 14, 2026
0756e59
[AArch64] Hint regalloc to choose distinct predicate for MATCH/CMP (#…
sdesmalen-arm Apr 14, 2026
eb9a9b9
[mlir][tosa] Create and use utility to print shapes (#191774)
lhutton1 Apr 14, 2026
fa720e7
[mlir][tosa] Optimize non-narrowing float casts (#191439)
IanTaylerLessa-arm Apr 14, 2026
8beed11
[Driver][HIP] Do not default to `hidden` visibility for AMDGCNSPIRV (…
AlexVlx Apr 14, 2026
bdec04f
[AArch64] Add new dot insts. to cost model (#189642)
Lukacma Apr 14, 2026
a044447
[NFC][SPIR-V] Fix cbuffer.ll test to pass spirv-val validation (#191940)
aobolensk Apr 14, 2026
06c1aa3
[CoroEarly][IR] Clarify semantic of llvm.coro.end (#191752)
NewSigma Apr 14, 2026
1b804e2
[LifetimeSafety] Track origins through std::function (#191123)
aeft Apr 14, 2026
7c3b499
[llvm][DebugInfo] formatv in DWARFDebugMacro (#191987)
kwk Apr 14, 2026
90ccb1c
[llvm][DebugInfo] formatv in DWARFDebugLine (#191986)
kwk Apr 14, 2026
444ffde
[llvm][DebugInfo] formatv in DWARFDebugFrame (#191984)
kwk Apr 14, 2026
3fe0bdf
[LFI][AArch64] Add AArch64 LFI rewrites for system instructions (#186…
zyedidia Apr 14, 2026
cabb972
[mlir][spirv] Mark several SPIR-V TOSA Ext Inst ops as NoMemoryEffect…
davidegrohmann Apr 14, 2026
4c543ac
[llvm][DebugInfo] formatv in DWARFDebugRangeList (#191989)
kwk Apr 14, 2026
1e68dcc
[llvm][DebugInfo] formatv in DWARFDebugRnglists (#191991)
kwk Apr 14, 2026
d023386
[llvm][DebugInfo] formatv in DWARFDie (#191992)
kwk Apr 14, 2026
8417922
[lldb] Start using formatv() in RegisterContextUnwind (NFCI) (#191576)
s-barannikov Apr 14, 2026
20c2216
[llvm][DebugInfo] formatv in DWARFListTable (#191996)
kwk Apr 14, 2026
2e07997
[llvm][DebugInfo] formatv in DWARFTypeUnit (#191997)
kwk Apr 14, 2026
9f1da15
[llvm][DebugInfo] formatv in DWARFUnwindTablePrinter (#191999)
kwk Apr 14, 2026
cf3a6c8
[llvm][DebugInfo] formatv in LVCodeViewVisitor (#192010)
kwk Apr 14, 2026
34e5b95
[llvm][DebugInfo] formatv in LVBinaryReader (#192009)
kwk Apr 14, 2026
453d0e2
[llvm][DebugInfo] formatv in LVScope (#192008)
kwk Apr 14, 2026
65c462a
[llvm][DebugInfo] formatv in LVRange (#192006)
kwk Apr 14, 2026
8a5dc12
[llvm][DebugInfo] formatv in LVObject (#192004)
kwk Apr 14, 2026
941b0f4
[llvm][DebugInfo] formatv in LVLocation (#192003)
kwk Apr 14, 2026
2b593be
[llvm][DebugInfo] formatv in LVElement (#192002)
kwk Apr 14, 2026
297510f
[BOLT][runtime] harden profile file open. (#191669)
devnexen Apr 14, 2026
8b5b987
[BOLT][runtime] fix readlink bound check in getBinaryPath. (#191666)
devnexen Apr 14, 2026
1207be6
[lldb] Use UNWIND_LOG macro in more places in RegisterContextUnwind (…
s-barannikov Apr 14, 2026
270e065
Reapply "[libc++][format] P3953R3: Rename `std::runtime_format` (#189…
frederick-vs-ja Apr 14, 2026
c533cb2
merge main into amd-staging
z1-cciauto Apr 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions bolt/lib/Core/BinaryContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2128,8 +2128,7 @@ ArrayRef<uint8_t> BinaryContext::extractData(uint64_t Address,

void BinaryContext::printData(raw_ostream &OS, ArrayRef<uint8_t> Data,
uint64_t Offset) const {
DataExtractor DE(Data, AsmInfo->isLittleEndian(),
AsmInfo->getCodePointerSize());
DataExtractor DE(Data, AsmInfo->isLittleEndian());
uint64_t DataOffset = 0;
while (DataOffset + 4 <= Data.size()) {
OS << format(" %08" PRIx64 ": \t.word\t0x", Offset + DataOffset);
Expand Down Expand Up @@ -2425,8 +2424,7 @@ ErrorOr<uint64_t> BinaryContext::getUnsignedValueAtAddress(uint64_t Address,
if (Section->isVirtual())
return 0;

DataExtractor DE(Section->getContents(), AsmInfo->isLittleEndian(),
AsmInfo->getCodePointerSize());
DataExtractor DE(Section->getContents(), AsmInfo->isLittleEndian());
auto ValueOffset = static_cast<uint64_t>(Address - Section->getAddress());
return DE.getUnsigned(&ValueOffset, Size);
}
Expand All @@ -2440,8 +2438,7 @@ ErrorOr<int64_t> BinaryContext::getSignedValueAtAddress(uint64_t Address,
if (Section->isVirtual())
return 0;

DataExtractor DE(Section->getContents(), AsmInfo->isLittleEndian(),
AsmInfo->getCodePointerSize());
DataExtractor DE(Section->getContents(), AsmInfo->isLittleEndian());
auto ValueOffset = static_cast<uint64_t>(Address - Section->getAddress());
return DE.getSigned(&ValueOffset, Size);
}
Expand Down
8 changes: 2 additions & 6 deletions bolt/lib/Core/DIEBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,7 @@ void DIEBuilder::updateReferences() {
// Handling references in location expressions.
for (LocWithReference &LocExpr : getState().LocWithReferencesToProcess) {
SmallVector<uint8_t, 32> Buffer;
DataExtractor Data(StringRef((const char *)LocExpr.BlockData.data(),
LocExpr.BlockData.size()),
LocExpr.U.isLittleEndian(),
LocExpr.U.getAddressByteSize());
DataExtractor Data(LocExpr.BlockData, LocExpr.U.isLittleEndian());
DWARFExpression Expr(Data, LocExpr.U.getAddressByteSize(),
LocExpr.U.getFormParams().Format);
cloneExpression(Data, Expr, LocExpr.U, Buffer, CloneExpressionStage::PATCH);
Expand Down Expand Up @@ -794,8 +791,7 @@ void DIEBuilder::cloneBlockAttribute(
if (DWARFAttribute::mayHaveLocationExpr(AttrSpec.Attr) &&
(Val.isFormClass(DWARFFormValue::FC_Block) ||
Val.isFormClass(DWARFFormValue::FC_Exprloc))) {
DataExtractor Data(StringRef((const char *)Bytes.data(), Bytes.size()),
U.isLittleEndian(), U.getAddressByteSize());
DataExtractor Data(Bytes, U.isLittleEndian());
DWARFExpression Expr(Data, U.getAddressByteSize(),
U.getFormParams().Format);
if (cloneExpression(Data, Expr, U, Buffer, CloneExpressionStage::INIT))
Expand Down
2 changes: 1 addition & 1 deletion bolt/lib/Core/DebugData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ static void parseAndPopulateDebugLineStr(BinarySection &LineStrSection,
MCDwarfLineStr &LineStr,
BinaryContext &BC) {
DataExtractor StrData(LineStrSection.getContents(),
BC.DwCtx->isLittleEndian(), 0);
BC.DwCtx->isLittleEndian());
uint64_t Offset = 0;
while (StrData.isValidOffset(Offset)) {
const uint64_t StrOffset = Offset;
Expand Down
6 changes: 2 additions & 4 deletions bolt/lib/Core/DebugNames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ DWARF5AcceleratorTable::DWARF5AcceleratorTable(
// for the .debug_names contributions they are in .debug_str section.
if (BC.getNumDWOCUs()) {
DataExtractor StrData(BC.DwCtx->getDWARFObj().getStrSection(),
BC.DwCtx->isLittleEndian(), 0);
BC.DwCtx->isLittleEndian());
uint64_t Offset = 0;
uint64_t StrOffset = 0;
while (StrData.isValidOffset(Offset)) {
Expand Down Expand Up @@ -136,9 +136,7 @@ static bool shouldIncludeVariable(const DWARFUnit &Unit, const DIE &Die) {
constructVect(LocAttrInfo.getDIELoc().values());
else
constructVect(LocAttrInfo.getDIEBlock().values());
ArrayRef<uint8_t> Expr = ArrayRef<uint8_t>(Sblock);
DataExtractor Data(StringRef((const char *)Expr.data(), Expr.size()),
Unit.getContext().isLittleEndian(), 0);
DataExtractor Data(Sblock, Unit.getContext().isLittleEndian());
DWARFExpression LocExpr(Data, Unit.getAddressByteSize(),
Unit.getFormParams().Format);
for (const DWARFExpression::Operation &Expr : LocExpr)
Expand Down
2 changes: 1 addition & 1 deletion bolt/lib/Profile/BoltAddressTranslation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ void BoltAddressTranslation::writeMaps(uint64_t &PrevAddress, raw_ostream &OS) {
}

std::error_code BoltAddressTranslation::parse(raw_ostream &OS, StringRef Buf) {
DataExtractor DE = DataExtractor(Buf, true, 8);
DataExtractor DE = DataExtractor(Buf, true);
uint64_t Offset = 0;
if (Buf.size() < 12)
return make_error_code(llvm::errc::io_error);
Expand Down
3 changes: 1 addition & 2 deletions bolt/lib/Rewrite/BuildIDRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ Error BuildIDRewriter::sectionInitializer() {
continue;

StringRef Buf = NoteSection.getContents();
DataExtractor DE = DataExtractor(Buf, BC.AsmInfo->isLittleEndian(),
BC.AsmInfo->getCodePointerSize());
DataExtractor DE = DataExtractor(Buf, BC.AsmInfo->isLittleEndian());
DataExtractor::Cursor Cursor(0);
while (Cursor && !DE.eof(Cursor)) {
const uint32_t NameSz = DE.getU32(Cursor);
Expand Down
7 changes: 2 additions & 5 deletions bolt/lib/Rewrite/DWARFRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,10 +1139,7 @@ void DWARFRewriter::updateUnitDebugInfo(
const_cast<DIEBlock *>(&LocAttrInfo.getDIEBlock());
AttrLocValList = static_cast<DIEValueList *>(BlockAttr);
}
ArrayRef<uint8_t> Expr = ArrayRef<uint8_t>(Sblock);
DataExtractor Data(
StringRef((const char *)Expr.data(), Expr.size()),
Unit.getContext().isLittleEndian(), 0);
DataExtractor Data(Sblock, Unit.getContext().isLittleEndian());
DWARFExpression LocExpr(Data, Unit.getAddressByteSize(),
Unit.getFormParams().Format);
uint32_t PrevOffset = 0;
Expand Down Expand Up @@ -1745,7 +1742,7 @@ static void UpdateStrAndStrOffsets(StringRef StrDWOContent,
const uint64_t NumOffsets =
(StrOffsetsContent.size() - HeaderOffset) / SizeOfOffset;

DataExtractor Extractor(StrOffsetsContent, IsLittleEndian, 0);
DataExtractor Extractor(StrOffsetsContent, IsLittleEndian);
uint64_t ExtractionOffset = HeaderOffset;

using StringFragment = DWARFUnitIndex::Entry::SectionContribution;
Expand Down
3 changes: 1 addition & 2 deletions bolt/lib/Rewrite/GNUPropertyRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ Error GNUPropertyRewriter::sectionInitializer() {
uint32_t FeaturesAcc = 0;

StringRef Buf = Sec->getContents();
DataExtractor DE(Buf, BC.AsmInfo->isLittleEndian(),
BC.AsmInfo->getCodePointerSize());
DataExtractor DE(Buf, BC.AsmInfo->isLittleEndian());
DataExtractor::Cursor Cursor(0);
while (Cursor && !DE.eof(Cursor)) {
const uint32_t NameSz = DE.getU32(Cursor);
Expand Down
60 changes: 26 additions & 34 deletions bolt/lib/Rewrite/LinuxKernelRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,8 @@ class AddressExtractor : public DataExtractor {
uint64_t DataAddress;

public:
AddressExtractor(StringRef Data, uint64_t DataAddress, bool IsLittleEndian,
uint8_t AddressSize)
: DataExtractor(Data, IsLittleEndian, AddressSize),
DataAddress(DataAddress) {}
AddressExtractor(StringRef Data, uint64_t DataAddress, bool IsLittleEndian)
: DataExtractor(Data, IsLittleEndian), DataAddress(DataAddress) {}

/// Extract 32-bit PC-relative address/pointer.
uint64_t getPCRelAddress32(Cursor &C) {
Expand Down Expand Up @@ -515,8 +513,7 @@ Error LinuxKernelRewriter::processSMPLocks() {
"bad size of .smp_locks section");

AddressExtractor AE(SMPLocksSection->getContents(), SectionAddress,
BC.AsmInfo->isLittleEndian(),
BC.AsmInfo->getCodePointerSize());
BC.AsmInfo->isLittleEndian());
AddressExtractor::Cursor Cursor(0);
while (Cursor && Cursor.tell() < SectionSize) {
const uint64_t Offset = Cursor.tell();
Expand Down Expand Up @@ -591,11 +588,10 @@ Error LinuxKernelRewriter::readORCTables() {
"ORC entries number mismatch detected");

DataExtractor OrcDE(ORCUnwindSection->getContents(),
BC.AsmInfo->isLittleEndian(),
BC.AsmInfo->getCodePointerSize());
AddressExtractor IPAE(
ORCUnwindIPSection->getContents(), ORCUnwindIPSection->getAddress(),
BC.AsmInfo->isLittleEndian(), BC.AsmInfo->getCodePointerSize());
BC.AsmInfo->isLittleEndian());
AddressExtractor IPAE(ORCUnwindIPSection->getContents(),
ORCUnwindIPSection->getAddress(),
BC.AsmInfo->isLittleEndian());
DataExtractor::Cursor ORCCursor(0);
DataExtractor::Cursor IPCursor(0);
uint64_t PrevIP = 0;
Expand Down Expand Up @@ -944,9 +940,9 @@ Error LinuxKernelRewriter::validateORCTables() {
if (!ORCUnwindIPSection)
return Error::success();

AddressExtractor IPAE(
ORCUnwindIPSection->getOutputContents(), ORCUnwindIPSection->getAddress(),
BC.AsmInfo->isLittleEndian(), BC.AsmInfo->getCodePointerSize());
AddressExtractor IPAE(ORCUnwindIPSection->getOutputContents(),
ORCUnwindIPSection->getAddress(),
BC.AsmInfo->isLittleEndian());
AddressExtractor::Cursor IPCursor(0);
uint64_t PrevIP = 0;
for (uint32_t Index = 0; Index < NumORCEntries; ++Index) {
Expand Down Expand Up @@ -1003,8 +999,7 @@ Error LinuxKernelRewriter::readStaticCalls() {

const uint64_t SectionAddress = StaticCallSection->getAddress();
AddressExtractor AE(StaticCallSection->getContents(), SectionAddress,
BC.AsmInfo->isLittleEndian(),
BC.AsmInfo->getCodePointerSize());
BC.AsmInfo->isLittleEndian());
AddressExtractor::Cursor Cursor(StaticCallTableAddress - SectionAddress);
uint32_t EntryID = 0;
while (Cursor && Cursor.tell() < Stop->getAddress() - SectionAddress) {
Expand Down Expand Up @@ -1111,9 +1106,9 @@ Error LinuxKernelRewriter::readExceptionTable() {
return createStringError(errc::executable_format_error,
"exception table size error");

AddressExtractor AE(
ExceptionsSection->getContents(), ExceptionsSection->getAddress(),
BC.AsmInfo->isLittleEndian(), BC.AsmInfo->getCodePointerSize());
AddressExtractor AE(ExceptionsSection->getContents(),
ExceptionsSection->getAddress(),
BC.AsmInfo->isLittleEndian());
AddressExtractor::Cursor Cursor(0);
uint32_t EntryID = 0;
while (Cursor && Cursor.tell() < ExceptionsSection->getSize()) {
Expand Down Expand Up @@ -1216,8 +1211,7 @@ Error LinuxKernelRewriter::readParaInstructions() {
return Error::success();

DataExtractor DE(ParavirtualPatchSection->getContents(),
BC.AsmInfo->isLittleEndian(),
BC.AsmInfo->getCodePointerSize());
BC.AsmInfo->isLittleEndian());
uint32_t EntryID = 0;
DataExtractor::Cursor Cursor(0);
while (Cursor && !DE.eof(Cursor)) {
Expand Down Expand Up @@ -1316,9 +1310,9 @@ Error LinuxKernelRewriter::readBugTable() {
return createStringError(errc::executable_format_error,
"bug table size error");

AddressExtractor AE(
BugTableSection->getContents(), BugTableSection->getAddress(),
BC.AsmInfo->isLittleEndian(), BC.AsmInfo->getCodePointerSize());
AddressExtractor AE(BugTableSection->getContents(),
BugTableSection->getAddress(),
BC.AsmInfo->isLittleEndian());
AddressExtractor::Cursor Cursor(0);
uint32_t EntryID = 0;
while (Cursor && Cursor.tell() < BugTableSection->getSize()) {
Expand Down Expand Up @@ -1482,9 +1476,9 @@ Error LinuxKernelRewriter::readAltInstructions() {
Error LinuxKernelRewriter::tryReadAltInstructions(uint32_t AltInstFeatureSize,
bool AltInstHasPadLen,
bool ParseOnly) {
AddressExtractor AE(
AltInstrSection->getContents(), AltInstrSection->getAddress(),
BC.AsmInfo->isLittleEndian(), BC.AsmInfo->getCodePointerSize());
AddressExtractor AE(AltInstrSection->getContents(),
AltInstrSection->getAddress(),
BC.AsmInfo->isLittleEndian());
AddressExtractor::Cursor Cursor(0);
uint64_t EntryID = 0;
while (Cursor && !AE.eof(Cursor)) {
Expand Down Expand Up @@ -1614,9 +1608,9 @@ Error LinuxKernelRewriter::readPCIFixupTable() {
return createStringError(errc::executable_format_error,
"PCI fixup table size error");

AddressExtractor AE(
PCIFixupSection->getContents(), PCIFixupSection->getAddress(),
BC.AsmInfo->isLittleEndian(), BC.AsmInfo->getCodePointerSize());
AddressExtractor AE(PCIFixupSection->getContents(),
PCIFixupSection->getAddress(),
BC.AsmInfo->isLittleEndian());
AddressExtractor::Cursor Cursor(0);
uint64_t EntryID = 0;
while (Cursor && !AE.eof(Cursor)) {
Expand Down Expand Up @@ -1730,8 +1724,7 @@ Error LinuxKernelRewriter::readStaticKeysJumpTable() {

const uint64_t SectionAddress = StaticKeysJumpSection->getAddress();
AddressExtractor AE(StaticKeysJumpSection->getContents(), SectionAddress,
BC.AsmInfo->isLittleEndian(),
BC.AsmInfo->getCodePointerSize());
BC.AsmInfo->isLittleEndian());
AddressExtractor::Cursor Cursor(StaticKeysJumpTableAddress - SectionAddress);
uint32_t EntryID = 0;
while (Cursor && Cursor.tell() < Stop->getAddress() - SectionAddress) {
Expand Down Expand Up @@ -1932,8 +1925,7 @@ Error LinuxKernelRewriter::updateStaticKeysJumpTablePostEmit() {

const uint64_t SectionAddress = StaticKeysJumpSection->getAddress();
AddressExtractor AE(StaticKeysJumpSection->getOutputContents(),
SectionAddress, BC.AsmInfo->isLittleEndian(),
BC.AsmInfo->getCodePointerSize());
SectionAddress, BC.AsmInfo->isLittleEndian());
AddressExtractor::Cursor Cursor(StaticKeysJumpTableAddress - SectionAddress);
const BinaryData *Stop = BC.getBinaryDataByName("__stop___jump_table");
uint32_t EntryID = 0;
Expand Down
6 changes: 2 additions & 4 deletions bolt/lib/Rewrite/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2800,8 +2800,7 @@ void RewriteInstance::readDynamicRelrRelocations(BinarySection &Section) {
auto ExtractAddendValue = [&](uint64_t Address) -> uint64_t {
ErrorOr<BinarySection &> Section = BC->getSectionForAddress(Address);
assert(Section && "cannot get section for data address from RELR");
DataExtractor DE = DataExtractor(Section->getContents(),
BC->AsmInfo->isLittleEndian(), PSize);
DataExtractor DE(Section->getContents(), BC->AsmInfo->isLittleEndian());
uint64_t Offset = Address - Section->getAddress();
return DE.getUnsigned(&Offset, PSize);
};
Expand All @@ -2814,8 +2813,7 @@ void RewriteInstance::readDynamicRelrRelocations(BinarySection &Section) {
BC->addDynamicRelocation(Address, nullptr, RType, Addend);
};

DataExtractor DE = DataExtractor(Section.getContents(),
BC->AsmInfo->isLittleEndian(), PSize);
DataExtractor DE(Section.getContents(), BC->AsmInfo->isLittleEndian());
uint64_t Offset = 0, Address = 0;
uint64_t RelrCount = DynamicRelrSize / DynamicRelrEntrySize;
while (RelrCount--) {
Expand Down
3 changes: 1 addition & 2 deletions bolt/lib/Rewrite/SDTRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ void SDTRewriter::readSection() {
return;

StringRef Buf = SDTSection->getContents();
DataExtractor DE = DataExtractor(Buf, BC.AsmInfo->isLittleEndian(),
BC.AsmInfo->getCodePointerSize());
DataExtractor DE = DataExtractor(Buf, BC.AsmInfo->isLittleEndian());
uint64_t Offset = 0;

while (DE.isValidOffset(Offset)) {
Expand Down
2 changes: 1 addition & 1 deletion bolt/lib/Target/X86/X86MCPlusBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
assert(Offset + I.DataSize <= ConstantData.size() &&
"invalid offset for given constant data");
int64_t ImmVal =
DataExtractor(ConstantData, true, 8).getSigned(&Offset, I.DataSize);
DataExtractor(ConstantData, true).getSigned(&Offset, I.DataSize);

// Compute the new opcode.
unsigned NewOpcode = 0;
Expand Down
1 change: 1 addition & 0 deletions bolt/runtime/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ typedef int int32_t;
#define O_CREAT 64
#define O_TRUNC 512
#define O_APPEND 1024
#define O_CLOEXEC 524288

// Functions that are required by freestanding environment. Compiler may
// generate calls to these implicitly.
Expand Down
9 changes: 5 additions & 4 deletions bolt/runtime/instr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,9 @@ static char *getBinaryPath() {
char *C = strCopy(FindBuf, DirPath, NameMax);
C = strCopy(C, d->d_name, NameMax - (C - FindBuf));
*C = '\0';
uint32_t Ret = __readlink(FindBuf, TargetPath, sizeof(TargetPath));
assert(Ret != -1 && Ret != BufSize, "readlink error");
uint64_t Ret = __readlink(FindBuf, TargetPath, sizeof(TargetPath));
assert(static_cast<int64_t>(Ret) >= 0 && Ret < sizeof(TargetPath),
"readlink error");
TargetPath[Ret] = '\0';
__close(FDdir);
return TargetPath;
Expand Down Expand Up @@ -1500,8 +1501,8 @@ int openProfile() {
Ptr = strCopy(Ptr, ".fdata", BufSize - (Ptr - Buf + 1));
}
*Ptr++ = '\0';
uint64_t FD = __open(Buf, O_WRONLY | O_TRUNC | O_CREAT,
/*mode=*/0666);
uint64_t FD = __open(Buf, O_WRONLY | O_TRUNC | O_CREAT | O_CLOEXEC,
/*mode=*/0600);
if (static_cast<int64_t>(FD) < 0) {
report("Error while trying to open profile file for writing: ");
report(Buf);
Expand Down
Loading
Loading