[clang-tidy] Make ClangTidyOptionsProvider::getOptions return by value.

Returning by reference limits possible implementations and doesn't bring any
benefits as all callers make copies of the returned value anyway.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@226553 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alexander Kornienko 2015-01-20 09:48:51 +00:00
Родитель 19fdec9929
Коммит b4899652cc
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -159,7 +159,7 @@ FileOptionsProvider::FileOptionsProvider(
// FIXME: This method has some common logic with clang::format::getStyle().
// Consider pulling out common bits to a findParentFileWithName function or
// similar.
const ClangTidyOptions &FileOptionsProvider::getOptions(StringRef FileName) {
ClangTidyOptions FileOptionsProvider::getOptions(StringRef FileName) {
DEBUG(llvm::dbgs() << "Getting options for file " << FileName << "...\n");
SmallString<256> FilePath(FileName);

Просмотреть файл

@ -95,7 +95,7 @@ public:
/// \brief Returns options applying to a specific translation unit with the
/// specified \p FileName.
virtual const ClangTidyOptions &getOptions(llvm::StringRef FileName) = 0;
virtual ClangTidyOptions getOptions(llvm::StringRef FileName) = 0;
};
/// \brief Implementation of the \c ClangTidyOptionsProvider interface, which
@ -108,7 +108,7 @@ public:
const ClangTidyGlobalOptions &getGlobalOptions() override {
return GlobalOptions;
}
const ClangTidyOptions &getOptions(llvm::StringRef /*FileName*/) override {
ClangTidyOptions getOptions(llvm::StringRef /*FileName*/) override {
return DefaultOptions;
}
@ -187,7 +187,7 @@ public:
const ClangTidyOptions &OverrideOptions,
const ConfigFileHandlers &ConfigHandlers);
const ClangTidyOptions &getOptions(llvm::StringRef FileName) override;
ClangTidyOptions getOptions(llvm::StringRef FileName) override;
private:
/// \brief Try to read configuration files from \p Directory using registered