Skip to content

Conversation

@mingmingl-llvm
Copy link
Contributor

@mingmingl-llvm mingmingl-llvm commented Jan 3, 2025

If I read InputSectionBase::relsOrRelas correctly, it will make at most one array-ref non-empty; one-off counter (as debugging log) shows the number of empty member containers is 2 or 3 in a real build. Fix the typo if this is the case.

@llvmbot
Copy link
Member

llvmbot commented Jan 3, 2025

@llvm/pr-subscribers-lld

Author: Mingming Liu (mingmingl-llvm)

Changes

If I read InputSectionBase::relsOrRelas correctly, it will make at most one array-ref non-empty; the number of empty member containers is 2 or 3 in a real build (counters from one-off debugging logs). Fix the typo if this is the case.


Full diff: https://github.com/llvm/llvm-project/pull/121545.diff

1 Files Affected:

  • (modified) lld/ELF/InputSection.h (+1-1)
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 303452fed60d86..b891875688bb28 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -33,7 +33,7 @@ class SyntheticSection;
 template <class ELFT> class ObjFile;
 class OutputSection;
 
-// Returned by InputSectionBase::relsOrRelas. At most one member is empty.
+// Returned by InputSectionBase::relsOrRelas. At least two members are empty.
 template <class ELFT> struct RelsOrRelas {
   Relocs<typename ELFT::Rel> rels;
   Relocs<typename ELFT::Rela> relas;

@llvmbot
Copy link
Member

llvmbot commented Jan 3, 2025

@llvm/pr-subscribers-lld-elf

Author: Mingming Liu (mingmingl-llvm)

Changes

If I read InputSectionBase::relsOrRelas correctly, it will make at most one array-ref non-empty; the number of empty member containers is 2 or 3 in a real build (counters from one-off debugging logs). Fix the typo if this is the case.


Full diff: https://github.com/llvm/llvm-project/pull/121545.diff

1 Files Affected:

  • (modified) lld/ELF/InputSection.h (+1-1)
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 303452fed60d86..b891875688bb28 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -33,7 +33,7 @@ class SyntheticSection;
 template <class ELFT> class ObjFile;
 class OutputSection;
 
-// Returned by InputSectionBase::relsOrRelas. At most one member is empty.
+// Returned by InputSectionBase::relsOrRelas. At least two members are empty.
 template <class ELFT> struct RelsOrRelas {
   Relocs<typename ELFT::Rel> rels;
   Relocs<typename ELFT::Rela> relas;

@mingmingl-llvm
Copy link
Contributor Author

thanks for taking a look!

@mingmingl-llvm mingmingl-llvm merged commit ee9be86 into llvm:main Jan 3, 2025
11 checks passed
@mingmingl-llvm mingmingl-llvm deleted the typo branch January 3, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants