Compared to llvm 10, why llvm 15 replace all the "->" by "." in .cpp and .h file?

Compared to llvm 10, why llvm 15 replace all the “->” by “.” in .cpp and .h file?

Without specific examples it’s hard to answer this question. Most likely reason is that some variable/parameter/member changed from a pointer to a reference.

1 Like

Thanks for your reply.
one of the case is like :slight_smile:

template <class ELFT> Triple::ArchType ELFObjectFile<ELFT>::getArch() const {
  bool IsLittleEndian = ELFT::TargetEndianness == support::little;
  switch (EF.getHeader()->e_machine) {

as you can see in
EF.getHeader()->e_machine
llvm 15.0.0 changes it to
EF.getHeader().e_machine

I found your example in llvm\include\llvm\Object\ELFObjectFile.h.

EF has type ELFFile (see line 267).
ELFFile is defined in ELF.h. Method getHeader() is on line 191.
git blame of this file shows the line was modified by commit 4845531f
git log -1 4845531f explains that it changes various pointers to references.

I hope this example will allow you to answer similar questions on your own.

1 Like

Thank you for your patient review of my question.
I learned from you how to find out the reasons of code change through git record, Thank you so much !