mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-11 17:08:42 +00:00
[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. llvm-svn: 226553
This commit is contained in:
parent
bb917683b6
commit
9115a3af02
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user