[clang-tools-extra] r271285 - [include-fixer] Inline trivial methods.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Tue May 31 07:40:10 PDT 2016


Author: d0k
Date: Tue May 31 09:40:10 2016
New Revision: 271285

URL: http://llvm.org/viewvc/llvm-project?rev=271285&view=rev
Log:
[include-fixer] Inline trivial methods.

Putting them into the .cpp file is both more verbose and slower than
having them in the header. No functional change intended.

Modified:
    clang-tools-extra/trunk/include-fixer/find-all-symbols/SymbolInfo.cpp
    clang-tools-extra/trunk/include-fixer/find-all-symbols/SymbolInfo.h

Modified: clang-tools-extra/trunk/include-fixer/find-all-symbols/SymbolInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/find-all-symbols/SymbolInfo.cpp?rev=271285&r1=271284&r2=271285&view=diff
==============================================================================
--- clang-tools-extra/trunk/include-fixer/find-all-symbols/SymbolInfo.cpp (original)
+++ clang-tools-extra/trunk/include-fixer/find-all-symbols/SymbolInfo.cpp Tue May 31 09:40:10 2016
@@ -78,20 +78,6 @@ SymbolInfo::SymbolInfo(llvm::StringRef N
     : Name(Name), Type(Type), FilePath(FilePath), Contexts(Contexts),
       LineNumber(LineNumber), NumOccurrences(NumOccurrences) {}
 
-llvm::StringRef SymbolInfo::getName() const { return Name; }
-
-SymbolKind SymbolInfo::getSymbolKind() const { return Type; }
-
-llvm::StringRef SymbolInfo::getFilePath() const { return FilePath; }
-
-const std::vector<SymbolInfo::Context> &SymbolInfo::getContexts() const {
-  return Contexts;
-}
-
-int SymbolInfo::getLineNumber() const { return LineNumber; }
-
-unsigned SymbolInfo::getNumOccurrences() const { return NumOccurrences; }
-
 bool SymbolInfo::operator==(const SymbolInfo &Symbol) const {
   return std::tie(Name, Type, FilePath, LineNumber, Contexts) ==
          std::tie(Symbol.Name, Symbol.Type, Symbol.FilePath, Symbol.LineNumber,

Modified: clang-tools-extra/trunk/include-fixer/find-all-symbols/SymbolInfo.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/find-all-symbols/SymbolInfo.h?rev=271285&r1=271284&r2=271285&view=diff
==============================================================================
--- clang-tools-extra/trunk/include-fixer/find-all-symbols/SymbolInfo.h (original)
+++ clang-tools-extra/trunk/include-fixer/find-all-symbols/SymbolInfo.h Tue May 31 09:40:10 2016
@@ -55,22 +55,24 @@ public:
              unsigned NumOccurrences = 0);
 
   /// \brief Get symbol name.
-  llvm::StringRef getName() const;
+  llvm::StringRef getName() const { return Name; }
 
   /// \brief Get symbol type.
-  SymbolKind getSymbolKind() const;
+  SymbolKind getSymbolKind() const { return Type; }
 
   /// \brief Get a relative file path where symbol comes from.
-  llvm::StringRef getFilePath() const;
+  llvm::StringRef getFilePath() const { return FilePath; }
 
   /// \brief Get symbol contexts.
-  const std::vector<SymbolInfo::Context> &getContexts() const;
+  const std::vector<SymbolInfo::Context> &getContexts() const {
+    return Contexts;
+  }
 
   /// \brief Get a 1-based line number of the symbol's declaration.
-  int getLineNumber() const;
+  int getLineNumber() const { return LineNumber; }
 
   /// \brief The number of times this symbol was found during an indexing run.
-  unsigned getNumOccurrences() const;
+  unsigned getNumOccurrences() const { return NumOccurrences; }
 
   bool operator<(const SymbolInfo &Symbol) const;
 




More information about the cfe-commits mailing list