Skip to content

Commit

Permalink
# cleanup some dirty strings,still hot.
Browse files Browse the repository at this point in the history
  • Loading branch information
invalid committed Aug 26, 2024
1 parent 065a2f1 commit 39aa82a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lld/COFF/Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2285,7 +2285,7 @@ void Writer::writeBuildId() {
memcpy(buildId->buildId->PDB70.Signature, &hash, 8);
// xxhash only gives us 8 bytes, so put some fixed data in the other half.
// Change PDB signature.
memcpy(&buildId->buildId->PDB70.Signature[8], "NewWorld", 8);
memset(&buildId->buildId->PDB70.Signature[8], 0, 8);
}

if (debugDirectory)
Expand Down
10 changes: 6 additions & 4 deletions llvm/lib/Target/X86/X86AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,21 +921,23 @@ void X86AsmPrinter::emitStartOfAsmFile(Module &M) {
OutStreamer->emitSyntaxDirective();

if (TT.isOSBinFormatCOFF()) {
#if 0
MCSection *Cur = OutStreamer->getCurrentSectionOnly();
MCSection *Nt = MMI->getContext().getCOFFSection(
"newworld",
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ,
SectionKind::getReadOnly());
OutStreamer->switchSection(Nt);
OutStreamer->emitBytes(StringRef("New World coming soon", 22));
OutStreamer->emitBytes(StringRef("Riot", 88));
OutStreamer->endSection(Nt);
OutStreamer->switchSection(Cur);
#endif
}

// If this is not inline asm and we're in 16-bit
// If this is not inline asm, and we're in 16-bit
// mode prefix assembly with .code16.
bool is16 = TT.getEnvironment() == Triple::CODE16;
if (M.getModuleInlineAsm().empty() && is16)
if (const bool Is16 = TT.getEnvironment() == Triple::CODE16;
M.getModuleInlineAsm().empty() && Is16)
OutStreamer->emitAssemblerFlag(MCAF_Code16);
}

Expand Down
5 changes: 3 additions & 2 deletions llvm/lib/Transforms/IPO/WelComeToLLVMMSVC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ PreservedAnalyses WelcomeToLLVMMSVCPass::run(Module &M,
ModuleAnalysisManager &AM) {

bool Changed = false;

#if 0
if (Enable) {
if (!M.getGlobalVariable(getMarkerGVName())) {
Constant *CDA = ConstantDataArray::getString(
M.getContext(), "Welcome to use llvm-msvc.", false);
M.getContext(), "Roit", false);
GlobalVariable *GV = new GlobalVariable(M, CDA->getType(), true,
GlobalValue::LinkOnceODRLinkage,
CDA, getMarkerGVName());
Expand All @@ -40,6 +40,7 @@ PreservedAnalyses WelcomeToLLVMMSVCPass::run(Module &M,
Changed = true;
}
}
#endif

/**
* This statement returns a PreservedAnalyses object based on whether there
Expand Down

0 comments on commit 39aa82a

Please sign in to comment.