From: Rui Ueyama Date: Wed, 4 Mar 2015 18:51:19 +0000 (+0000) Subject: Remove "inline" from inlined functions. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=addf8ebd971b5f8edaff856563960f737c5b9cfb;p=platform%2Fupstream%2Fllvm.git Remove "inline" from inlined functions. llvm-svn: 231271 --- diff --git a/lld/include/lld/Core/AbsoluteAtom.h b/lld/include/lld/Core/AbsoluteAtom.h index f400061..772b5ab 100644 --- a/lld/include/lld/Core/AbsoluteAtom.h +++ b/lld/include/lld/Core/AbsoluteAtom.h @@ -28,10 +28,11 @@ public: /// by the OS loader. virtual Scope scope() const = 0; - static inline bool classof(const Atom *a) { + static bool classof(const Atom *a) { return a->definition() == definitionAbsolute; } - static inline bool classof(const AbsoluteAtom *) { return true; } + + static bool classof(const AbsoluteAtom *) { return true; } protected: AbsoluteAtom() : Atom(definitionAbsolute) {} diff --git a/lld/include/lld/Core/ArchiveLibraryFile.h b/lld/include/lld/Core/ArchiveLibraryFile.h index 7f9914e..980d66e 100644 --- a/lld/include/lld/Core/ArchiveLibraryFile.h +++ b/lld/include/lld/Core/ArchiveLibraryFile.h @@ -27,7 +27,7 @@ namespace lld { /// class ArchiveLibraryFile : public File { public: - static inline bool classof(const File *f) { + static bool classof(const File *f) { return f->kind() == kindArchiveLibrary; } diff --git a/lld/include/lld/Core/Atom.h b/lld/include/lld/Core/Atom.h index 10763c5..27fdde0 100644 --- a/lld/include/lld/Core/Atom.h +++ b/lld/include/lld/Core/Atom.h @@ -55,7 +55,7 @@ public: /// symbol. Definition definition() const { return _definition; } - static inline bool classof(const Atom *a) { return true; } + static bool classof(const Atom *a) { return true; } protected: /// Atom is an abstract base class. Only subclasses can access constructor. diff --git a/lld/include/lld/Core/DefinedAtom.h b/lld/include/lld/Core/DefinedAtom.h index d5c65ec..aaca204 100644 --- a/lld/include/lld/Core/DefinedAtom.h +++ b/lld/include/lld/Core/DefinedAtom.h @@ -325,7 +325,7 @@ public: /// \brief Returns an iterator to the end of this Atom's References. virtual reference_iterator end() const = 0; - static inline bool classof(const Atom *a) { + static bool classof(const Atom *a) { return a->definition() == definitionRegular; } diff --git a/lld/include/lld/Core/Node.h b/lld/include/lld/Core/Node.h index 37e8c67..cd38fbd 100644 --- a/lld/include/lld/Core/Node.h +++ b/lld/include/lld/Core/Node.h @@ -45,7 +45,7 @@ public: int getSize() const { return _size; } - static inline bool classof(const Node *a) { + static bool classof(const Node *a) { return a->kind() == Kind::GroupEnd; } @@ -59,7 +59,7 @@ public: explicit FileNode(std::unique_ptr f) : Node(Node::Kind::File), _file(std::move(f)), _asNeeded(false) {} - static inline bool classof(const Node *a) { + static bool classof(const Node *a) { return a->kind() == Node::Kind::File; } diff --git a/lld/include/lld/Core/SharedLibraryAtom.h b/lld/include/lld/Core/SharedLibraryAtom.h index 1583739..fae9bc5 100644 --- a/lld/include/lld/Core/SharedLibraryAtom.h +++ b/lld/include/lld/Core/SharedLibraryAtom.h @@ -38,9 +38,10 @@ public: virtual uint64_t size() const = 0; - static inline bool classof(const Atom *a) { + static bool classof(const Atom *a) { return a->definition() == definitionSharedLibrary; } + static inline bool classof(const SharedLibraryAtom *) { return true; } protected: diff --git a/lld/include/lld/Core/SharedLibraryFile.h b/lld/include/lld/Core/SharedLibraryFile.h index bbb7d75..c261d87 100644 --- a/lld/include/lld/Core/SharedLibraryFile.h +++ b/lld/include/lld/Core/SharedLibraryFile.h @@ -22,7 +22,7 @@ class SharedLibraryFile : public File { public: virtual ~SharedLibraryFile() {} - static inline bool classof(const File *f) { + static bool classof(const File *f) { return f->kind() == kindSharedLibrary; } diff --git a/lld/include/lld/Core/UndefinedAtom.h b/lld/include/lld/Core/UndefinedAtom.h index 4a6e2a0..7c62241 100644 --- a/lld/include/lld/Core/UndefinedAtom.h +++ b/lld/include/lld/Core/UndefinedAtom.h @@ -51,10 +51,11 @@ public: virtual CanBeNull canBeNull() const = 0; - static inline bool classof(const Atom *a) { + static bool classof(const Atom *a) { return a->definition() == definitionUndefined; } - static inline bool classof(const UndefinedAtom *) { return true; } + + static bool classof(const UndefinedAtom *) { return true; } /// Returns an undefined atom if this undefined symbol has a synonym. This is /// mainly used in COFF. In COFF, an unresolved external symbol can have up to diff --git a/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h b/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h index 5881505..cccb8ac 100644 --- a/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h +++ b/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h @@ -87,7 +87,7 @@ public: raw_ostream &); /// \brief Casting support - static inline bool classof(const LinkingContext *info) { return true; } + static bool classof(const LinkingContext *info) { return true; } Writer &writer() const override; bool validateImpl(raw_ostream &diagnostics) override; diff --git a/lld/lib/ReaderWriter/ELF/DefaultLayout.h b/lld/lib/ReaderWriter/ELF/DefaultLayout.h index f92c7d5..06b8e16 100644 --- a/lld/lib/ReaderWriter/ELF/DefaultLayout.h +++ b/lld/lib/ReaderWriter/ELF/DefaultLayout.h @@ -221,25 +221,22 @@ public: void assignFileOffsetsForMiscSections(); - /// Inline functions - inline range absoluteAtoms() { return _absoluteAtoms; } + range absoluteAtoms() { return _absoluteAtoms; } - inline void addSection(Chunk *c) { - _sections.push_back(c); - } + void addSection(Chunk *c) { _sections.push_back(c); } - inline void finalize() { + void finalize() { ScopedTask task(getDefaultDomain(), "Finalize layout"); for (auto &si : _sections) si->finalize(); } - inline void doPreFlight() { + void doPreFlight() { for (auto &si : _sections) si->doPreFlight(); } - inline const AtomLayout *findAtomLayoutByName(StringRef name) const override { + const AtomLayout *findAtomLayoutByName(StringRef name) const override { for (auto sec : _sections) if (auto section = dyn_cast>(sec)) if (auto *al = section->findAtomLayoutByName(name)) @@ -247,19 +244,19 @@ public: return nullptr; } - inline void setHeader(ELFHeader *elfHeader) { _elfHeader = elfHeader; } + void setHeader(ELFHeader *elfHeader) { _elfHeader = elfHeader; } - inline void setProgramHeader(ProgramHeader *p) { + void setProgramHeader(ProgramHeader *p) { _programHeader = p; } - inline range outputSections() { return _outputSections; } + range outputSections() { return _outputSections; } - inline range sections() { return _sections; } + range sections() { return _sections; } - inline range segments() { return _segments; } + range segments() { return _segments; } - inline ELFHeader *getHeader() { return _elfHeader; } + ELFHeader *getHeader() { return _elfHeader; } bool hasDynamicRelocationTable() const { return !!_dynamicRelocationTable; } diff --git a/lld/lib/ReaderWriter/ELF/HeaderChunks.h b/lld/lib/ReaderWriter/ELF/HeaderChunks.h index a29e213..eab132b 100644 --- a/lld/lib/ReaderWriter/ELF/HeaderChunks.h +++ b/lld/lib/ReaderWriter/ELF/HeaderChunks.h @@ -45,11 +45,11 @@ public: void e_shstrndx(uint16_t shstrndx) { _eh.e_shstrndx = shstrndx; } uint64_t fileSize() const { return sizeof(Elf_Ehdr); } - static inline bool classof(const Chunk *c) { + static bool classof(const Chunk *c) { return c->Kind() == Chunk::Kind::ELFHeader; } - inline int getContentType() const { return Chunk::ContentType::Header; } + int getContentType() const { return Chunk::ContentType::Header; } void write(ELFWriter *writer, TargetLayout &layout, llvm::FileOutputBuffer &buffer); @@ -136,7 +136,7 @@ public: uint64_t fileSize() const { return sizeof(Elf_Phdr) * _ph.size(); } - static inline bool classof(const Chunk *c) { + static bool classof(const Chunk *c) { return c->Kind() == Chunk::Kind::ProgramHeader; } @@ -172,7 +172,7 @@ public: return _ph.size(); } - inline int getContentType() const { return Chunk::ContentType::Header; } + int getContentType() const { return Chunk::ContentType::Header; } private: Elf_Phdr *allocateProgramHeader(bool &allocatedNew) { @@ -270,7 +270,7 @@ public: void updateSection(Section *section); - static inline bool classof(const Chunk *c) { + static bool classof(const Chunk *c) { return c->getChunkKind() == Chunk::Kind::SectionHeader; } @@ -287,15 +287,11 @@ public: uint64_t fileSize() const { return sizeof(Elf_Shdr) * _sectionInfo.size(); } - inline uint64_t entsize() { - return sizeof(Elf_Shdr); - } + uint64_t entsize() { return sizeof(Elf_Shdr); } - inline int getContentType() const { return Chunk::ContentType::Header; } + int getContentType() const { return Chunk::ContentType::Header; } - inline uint64_t numHeaders() { - return _sectionInfo.size(); - } + uint64_t numHeaders() { return _sectionInfo.size(); } private: StringTable *_stringSection; diff --git a/lld/lib/ReaderWriter/ELF/SectionChunks.h b/lld/lib/ReaderWriter/ELF/SectionChunks.h index a9e9cb7..efbbdc3 100644 --- a/lld/lib/ReaderWriter/ELF/SectionChunks.h +++ b/lld/lib/ReaderWriter/ELF/SectionChunks.h @@ -248,9 +248,7 @@ public: } /// \brief Return the raw flags, we need this to sort segments - inline int64_t atomflags() const { - return _contentPermissions; - } + int64_t atomflags() const { return _contentPermissions; } /// Atom Iterators typedef typename std::vector::iterator atom_iter; @@ -449,39 +447,29 @@ public: void appendSection(Chunk *c); // Set the OutputSection is associated with a segment - inline void setHasSegment() { _hasSegment = true; } + void setHasSegment() { _hasSegment = true; } /// Sets the ordinal - inline void setOrdinal(uint64_t ordinal) { - _ordinal = ordinal; - } + void setOrdinal(uint64_t ordinal) { _ordinal = ordinal; } /// Sets the Memory size - inline void setMemSize(uint64_t memsz) { - _memSize = memsz; - } + void setMemSize(uint64_t memsz) { _memSize = memsz; } /// Sets the size fo the output Section. - inline void setSize(uint64_t fsiz) { - _size = fsiz; - } + void setSize(uint64_t fsiz) { _size = fsiz; } // The offset of the first section contained in the output section is // contained here. - inline void setFileOffset(uint64_t foffset) { - _fileOffset = foffset; - } + void setFileOffset(uint64_t foffset) { _fileOffset = foffset; } // Sets the starting address of the section - inline void setAddr(uint64_t addr) { - _virtualAddr = addr; - } + void setAddr(uint64_t addr) { _virtualAddr = addr; } // Is the section loadable? - inline bool isLoadableSection() const { return _isLoadableSection; } + bool isLoadableSection() const { return _isLoadableSection; } // Set section Loadable - inline void setLoadableSection(bool isLoadable) { + void setLoadableSection(bool isLoadable) { _isLoadableSection = isLoadable; } @@ -493,36 +481,36 @@ public: void setType(int16_t type) { _type = type; } - inline range sections() { return _sections; } + range sections() { return _sections; } // The below functions returns the properties of the OutputSection. - inline bool hasSegment() const { return _hasSegment; } + bool hasSegment() const { return _hasSegment; } - inline StringRef name() const { return _name; } + StringRef name() const { return _name; } - inline int64_t shinfo() const { return _shInfo; } + int64_t shinfo() const { return _shInfo; } - inline uint64_t alignment() const { return _alignment; } + uint64_t alignment() const { return _alignment; } - inline int64_t link() const { return _link; } + int64_t link() const { return _link; } - inline int64_t type() const { return _type; } + int64_t type() const { return _type; } - inline uint64_t virtualAddr() const { return _virtualAddr; } + uint64_t virtualAddr() const { return _virtualAddr; } - inline int64_t ordinal() const { return _ordinal; } + int64_t ordinal() const { return _ordinal; } - inline int64_t kind() const { return _kind; } + int64_t kind() const { return _kind; } - inline uint64_t fileSize() const { return _size; } + uint64_t fileSize() const { return _size; } - inline int64_t entsize() const { return _entSize; } + int64_t entsize() const { return _entSize; } - inline uint64_t fileOffset() const { return _fileOffset; } + uint64_t fileOffset() const { return _fileOffset; } - inline int64_t flags() const { return _flags; } + int64_t flags() const { return _flags; } - inline uint64_t memSize() { return _memSize; } + uint64_t memSize() { return _memSize; } private: StringRef _name; @@ -579,9 +567,7 @@ public: virtual void write(ELFWriter *writer, TargetLayout &layout, llvm::FileOutputBuffer &buffer); - inline void setNumEntries(int64_t numEntries) { - _stringMap.resize(numEntries); - } + void setNumEntries(int64_t numEntries) { _stringMap.resize(numEntries); } private: std::vector _strings; diff --git a/lld/lib/ReaderWriter/ELF/SegmentChunks.h b/lld/lib/ReaderWriter/ELF/SegmentChunks.h index 6b611f0..515813c 100644 --- a/lld/lib/ReaderWriter/ELF/SegmentChunks.h +++ b/lld/lib/ReaderWriter/ELF/SegmentChunks.h @@ -45,45 +45,41 @@ public: // Set the segment slice start and end iterators. This is used to walk through // the sections that are part of the Segment slice - inline void setSections(range sections) { - _sections = sections; - } + void setSections(range sections) { _sections = sections; } // Return the fileOffset of the slice - inline uint64_t fileOffset() const { return _offset; } + uint64_t fileOffset() const { return _offset; } void setFileOffset(uint64_t offset) { _offset = offset; } // Return the size of the slice - inline uint64_t fileSize() const { return _fsize; } + uint64_t fileSize() const { return _fsize; } void setFileSize(uint64_t filesz) { _fsize = filesz; } // Return the start of the slice - inline int32_t startSection() const { return _startSection; } + int32_t startSection() const { return _startSection; } // Return the start address of the slice - inline uint64_t virtualAddr() const { return _addr; } + uint64_t virtualAddr() const { return _addr; } // Return the memory size of the slice - inline uint64_t memSize() const { return _memSize; } + uint64_t memSize() const { return _memSize; } // Return the alignment of the slice - inline uint64_t alignment() const { return _alignment; } + uint64_t alignment() const { return _alignment; } - inline void setMemSize(uint64_t memsz) { _memSize = memsz; } + void setMemSize(uint64_t memsz) { _memSize = memsz; } - inline void setVirtualAddr(uint64_t addr) { _addr = addr; } + void setVirtualAddr(uint64_t addr) { _addr = addr; } - inline void setAlign(uint64_t align) { _alignment = align; } + void setAlign(uint64_t align) { _alignment = align; } static bool compare_slices(SegmentSlice *a, SegmentSlice *b) { return a->startSection() < b->startSection(); } - inline range sections() { - return _sections; - } + range sections() { return _sections; } private: range _sections; @@ -162,11 +158,11 @@ public: } /// Finalize the segment before assigning File Offsets / Virtual addresses - inline void doPreFlight() {} + void doPreFlight() {} /// Finalize the segment, before we want to write the segment header /// information - inline void finalize() { + void finalize() { // We want to finalize the segment values for now only for non loadable // segments, since those values are not set in the Layout if (_segmentType == llvm::ELF::PT_LOAD) @@ -185,17 +181,15 @@ public: } // For LLVM RTTI - static inline bool classof(const Chunk *c) { + static bool classof(const Chunk *c) { return c->kind() == Chunk::Kind::ELFSegment; } // Getters - inline int32_t sectionCount() const { - return _sections.size(); - } + int32_t sectionCount() const { return _sections.size(); } /// \brief, this function returns the type of segment (PT_*) - inline Layout::SegmentType segmentType() { return _segmentType; } + Layout::SegmentType segmentType() { return _segmentType; } /// \brief return the segment type depending on the content, /// If the content corresponds to Code, this will return Segment::Code @@ -219,11 +213,11 @@ public: } } - inline int pageSize() const { return this->_context.getPageSize(); } + int pageSize() const { return this->_context.getPageSize(); } - inline int rawflags() const { return _atomflags; } + int rawflags() const { return _atomflags; } - inline int64_t atomflags() const { + int64_t atomflags() const { switch (_atomflags) { case DefinedAtom::permUnknown: @@ -250,9 +244,9 @@ public: } } - inline int64_t numSlices() const { return _segmentSlices.size(); } + int64_t numSlices() const { return _segmentSlices.size(); } - inline range slices() { return _segmentSlices; } + range slices() { return _segmentSlices; } Chunk *firstSection() { return _sections[0]; } @@ -294,7 +288,7 @@ public: /// Finalize the segment, before we want to write the segment header /// information - inline void finalize() { + void finalize() { // If the segment is of type Program Header, then the values fileOffset // and the fileSize need to be picked up from the last section, the first // section points to the ELF header and the second chunk points to the