[lld] r233737 - Rename identifiers starting with an underscore and a uppercase letter.
David Blaikie
dblaikie at gmail.com
Tue Mar 31 12:40:17 PDT 2015
On Tue, Mar 31, 2015 at 12:33 PM, Rui Ueyama <ruiu at google.com> wrote:
> Author: ruiu
> Date: Tue Mar 31 14:33:25 2015
> New Revision: 233737
>
> URL: http://llvm.org/viewvc/llvm-project?rev=233737&view=rev
> Log:
> Rename identifiers starting with an underscore and a uppercase letter.
>
> Identifiers starting with _[A-Z] is reserved for the language.
> User programs shouldn't use such identifiers.
>
*thumbs up* I did a few of these a few weeks ago - good stuff.
>
> Modified:
> lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp
> lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
> lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp
>
> Modified: lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp?rev=233737&r1=233736&r2=233737&view=diff
>
> ==============================================================================
> --- lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp
> (original)
> +++ lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp Tue
> Mar 31 14:33:25 2015
> @@ -245,7 +245,7 @@ protected:
>
> public:
> AArch64RelocationPass(const ELFLinkingContext &ctx)
> - : _file(ctx), _ctx(ctx), _null(nullptr), _PLT0(nullptr),
> _got0(nullptr),
> + : _file(ctx), _ctx(ctx), _null(nullptr), _plt0(nullptr),
> _got0(nullptr),
> _got1(nullptr) {}
>
> /// \brief Do the pass.
> @@ -289,9 +289,9 @@ public:
>
> // Add all created atoms to the link.
> uint64_t ordinal = 0;
> - if (_PLT0) {
> - _PLT0->setOrdinal(ordinal++);
> - mf->addAtom(*_PLT0);
> + if (_plt0) {
> + _plt0->setOrdinal(ordinal++);
> + mf->addAtom(*_plt0);
> }
> for (auto &plt : _pltVector) {
> plt->setOrdinal(ordinal++);
> @@ -301,7 +301,7 @@ public:
> _null->setOrdinal(ordinal++);
> mf->addAtom(*_null);
> }
> - if (_PLT0) {
> + if (_plt0) {
> _got0->setOrdinal(ordinal++);
> _got1->setOrdinal(ordinal++);
> mf->addAtom(*_got0);
> @@ -342,7 +342,7 @@ protected:
> /// \brief The got and plt entries for .PLT0. This is used to call into
> the
> /// dynamic linker for symbol resolution.
> /// @{
> - PLT0Atom *_PLT0;
> + PLT0Atom *_plt0;
> GOTAtom *_got0;
> GOTAtom *_got1;
> /// @}
> @@ -394,22 +394,22 @@ public:
> : AArch64RelocationPass(ctx) {}
>
> const PLT0Atom *getPLT0() {
> - if (_PLT0)
> - return _PLT0;
> + if (_plt0)
> + return _plt0;
> // Fill in the null entry.
> getNullGOT();
> - _PLT0 = new (_file._alloc) AArch64PLT0Atom(_file);
> + _plt0 = new (_file._alloc) AArch64PLT0Atom(_file);
> _got0 = new (_file._alloc) AArch64GOTAtom(_file, ".got.plt");
> _got1 = new (_file._alloc) AArch64GOTAtom(_file, ".got.plt");
> - _PLT0->addReferenceELF_AArch64(R_AARCH64_ADR_GOT_PAGE, 4, _got0, 0);
> - _PLT0->addReferenceELF_AArch64(R_AARCH64_LD64_GOT_LO12_NC, 8, _got1,
> 0);
> - _PLT0->addReferenceELF_AArch64(ADD_AARCH64_GOTRELINDEX, 12, _got1, 0);
> + _plt0->addReferenceELF_AArch64(R_AARCH64_ADR_GOT_PAGE, 4, _got0, 0);
> + _plt0->addReferenceELF_AArch64(R_AARCH64_LD64_GOT_LO12_NC, 8, _got1,
> 0);
> + _plt0->addReferenceELF_AArch64(ADD_AARCH64_GOTRELINDEX, 12, _got1, 0);
> #ifndef NDEBUG
> - _PLT0->_name = "__PLT0";
> + _plt0->_name = "__PLT0";
> _got0->_name = "__got0";
> _got1->_name = "__got1";
> #endif
> - return _PLT0;
> + return _plt0;
> }
>
> const PLTAtom *getPLTEntry(const Atom *a) {
>
> Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp?rev=233737&r1=233736&r2=233737&view=diff
>
> ==============================================================================
> --- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
> (original)
> +++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp Tue
> Mar 31 14:33:25 2015
> @@ -164,7 +164,7 @@ protected:
>
> public:
> GOTPLTPass(const ELFLinkingContext &ctx)
> - : _file(ctx), _null(nullptr), _PLT0(nullptr), _got0(nullptr) {}
> + : _file(ctx), _null(nullptr), _plt0(nullptr), _got0(nullptr) {}
>
> /// \brief Do the pass.
> ///
> @@ -182,9 +182,9 @@ public:
>
> // Add all created atoms to the link.
> uint64_t ordinal = 0;
> - if (_PLT0) {
> - _PLT0->setOrdinal(ordinal++);
> - mf->addAtom(*_PLT0);
> + if (_plt0) {
> + _plt0->setOrdinal(ordinal++);
> + mf->addAtom(*_plt0);
> }
> for (auto &plt : _pltVector) {
> plt->setOrdinal(ordinal++);
> @@ -224,7 +224,7 @@ protected:
> /// \brief The got and plt entries for .PLT0. This is used to call into
> the
> /// dynamic linker for symbol resolution.
> /// @{
> - PLT0Atom *_PLT0;
> + PLT0Atom *_plt0;
> GOTAtom *_got0;
> /// @}
> };
> @@ -239,14 +239,14 @@ public:
> }
>
> const PLT0Atom *getPLT0() {
> - if (_PLT0)
> - return _PLT0;
> - _PLT0 = new (_file._alloc) HexagonPLT0Atom(_file);
> - _PLT0->addReferenceELF_Hexagon(R_HEX_B32_PCREL_X, 0, _got0, 0);
> - _PLT0->addReferenceELF_Hexagon(R_HEX_6_PCREL_X, 4, _got0, 4);
> + if (_plt0)
> + return _plt0;
> + _plt0 = new (_file._alloc) HexagonPLT0Atom(_file);
> + _plt0->addReferenceELF_Hexagon(R_HEX_B32_PCREL_X, 0, _got0, 0);
> + _plt0->addReferenceELF_Hexagon(R_HEX_6_PCREL_X, 4, _got0, 4);
> DEBUG_WITH_TYPE("PLT", llvm::dbgs() << "[ PLT0/GOT0 ] "
> << "Adding plt0/got0 \n");
> - return _PLT0;
> + return _plt0;
> }
>
> const PLTAtom *getPLTEntry(const Atom *a) {
>
> Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp?rev=233737&r1=233736&r2=233737&view=diff
>
> ==============================================================================
> --- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp
> (original)
> +++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp Tue Mar
> 31 14:33:25 2015
> @@ -244,7 +244,7 @@ protected:
>
> public:
> RelocationPass(const ELFLinkingContext &ctx)
> - : _file(ctx), _ctx(ctx), _null(nullptr), _PLT0(nullptr),
> _got0(nullptr),
> + : _file(ctx), _ctx(ctx), _null(nullptr), _plt0(nullptr),
> _got0(nullptr),
> _got1(nullptr) {}
>
> /// \brief Do the pass.
> @@ -264,9 +264,9 @@ public:
>
> // Add all created atoms to the link.
> uint64_t ordinal = 0;
> - if (_PLT0) {
> - _PLT0->setOrdinal(ordinal++);
> - mf->addAtom(*_PLT0);
> + if (_plt0) {
> + _plt0->setOrdinal(ordinal++);
> + mf->addAtom(*_plt0);
> }
> for (auto &plt : _pltVector) {
> plt->setOrdinal(ordinal++);
> @@ -276,7 +276,7 @@ public:
> _null->setOrdinal(ordinal++);
> mf->addAtom(*_null);
> }
> - if (_PLT0) {
> + if (_plt0) {
> _got0->setOrdinal(ordinal++);
> _got1->setOrdinal(ordinal++);
> mf->addAtom(*_got0);
> @@ -327,7 +327,7 @@ protected:
> /// \brief The got and plt entries for .PLT0. This is used to call into
> the
> /// dynamic linker for symbol resolution.
> /// @{
> - PLT0Atom *_PLT0;
> + PLT0Atom *_plt0;
> GOTAtom *_got0;
> GOTAtom *_got1;
> /// @}
> @@ -379,20 +379,20 @@ public:
> : RelocationPass(ctx) {}
>
> const PLT0Atom *getPLT0() {
> - if (_PLT0)
> - return _PLT0;
> + if (_plt0)
> + return _plt0;
> // Fill in the null entry.
> getNullGOT();
> - _PLT0 = new (_file._alloc) X86_64PLT0Atom(_file);
> + _plt0 = new (_file._alloc) X86_64PLT0Atom(_file);
> _got0 = new (_file._alloc) X86_64GOTAtom(_file, ".got.plt");
> _got1 = new (_file._alloc) X86_64GOTAtom(_file, ".got.plt");
> - _PLT0->addReferenceELF_x86_64(R_X86_64_PC32, 2, _got0, -4);
> - _PLT0->addReferenceELF_x86_64(R_X86_64_PC32, 8, _got1, -4);
> + _plt0->addReferenceELF_x86_64(R_X86_64_PC32, 2, _got0, -4);
> + _plt0->addReferenceELF_x86_64(R_X86_64_PC32, 8, _got1, -4);
> #ifndef NDEBUG
> _got0->_name = "__got0";
> _got1->_name = "__got1";
> #endif
> - return _PLT0;
> + return _plt0;
> }
>
> const PLTAtom *getPLTEntry(const Atom *a) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150331/d43e02ee/attachment.html>
More information about the llvm-commits
mailing list