Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmth committed Apr 30, 2023
1 parent 9460fc9 commit 74b20b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
12 changes: 6 additions & 6 deletions llvm-plugin/src/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl FunctionAnalysisManager {
///
/// Panics if the given analysis wasn't registered, or if this function was
/// called within the given analysis itself.
pub fn get_result<'a, A>(&self, function: &FunctionValue<'a>) -> &A::Result
pub fn get_result<A>(&self, function: &FunctionValue<'_>) -> &A::Result
where
A: crate::LlvmFunctionAnalysis,
{
Expand Down Expand Up @@ -61,7 +61,7 @@ impl FunctionAnalysisManager {
///
/// Panics if the given analysis wasn't registered, or if this function was
/// called within the given analysis itself.
pub fn get_cached_result<'a, A>(&self, function: &FunctionValue<'a>) -> Option<&A::Result>
pub fn get_cached_result<A>(&self, function: &FunctionValue<'_>) -> Option<&A::Result>
where
A: crate::LlvmFunctionAnalysis,
{
Expand Down Expand Up @@ -171,7 +171,7 @@ impl ModuleAnalysisManager {
///
/// Panics if the given analysis wasn't registered, or if this function was
/// called within the given analysis itself.
pub fn get_result<'a, A>(&self, module: &Module<'a>) -> &A::Result
pub fn get_result<A>(&self, module: &Module<'_>) -> &A::Result
where
A: crate::LlvmModuleAnalysis,
{
Expand All @@ -198,7 +198,7 @@ impl ModuleAnalysisManager {
///
/// Panics if the given analysis wasn't registered, or if this function was
/// called within the given analysis itself.
pub fn get_cached_result<'a, A>(&self, module: &Module<'a>) -> Option<&A::Result>
pub fn get_cached_result<A>(&self, module: &Module<'_>) -> Option<&A::Result>
where
A: crate::LlvmModuleAnalysis,
{
Expand All @@ -219,9 +219,9 @@ impl ModuleAnalysisManager {

/// Returns a [FunctionAnalysisManagerProxy], which is essentially an interface
/// allowing management of analyses at the function level.
pub fn get_function_analysis_manager_proxy<'a>(
pub fn get_function_analysis_manager_proxy(
&self,
module: &Module<'a>,
module: &Module<'_>,
) -> FunctionAnalysisManagerProxy {
let proxy = crate::get_function_analysis_manager_module_proxy(
self.inner,
Expand Down
18 changes: 7 additions & 11 deletions llvm-plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ pub trait LlvmModulePass {
/// If this function makes modifications on the given module IR, it
/// should return `PreservedAnalyses::None` to indicate to the
/// pass manager that all analyses are now invalidated.
fn run_pass<'a>(
fn run_pass(
&self,
module: &mut Module<'a>,
module: &mut Module<'_>,
manager: &ModuleAnalysisManager,
) -> PreservedAnalyses;
}
Expand All @@ -170,9 +170,9 @@ pub trait LlvmFunctionPass {
/// If this function makes modifications on the given function IR, it
/// should return `PreservedAnalyses::None` to indicate to the
/// pass manager that all analyses are now invalidated.
fn run_pass<'a>(
fn run_pass(
&self,
function: &mut FunctionValue<'a>,
function: &mut FunctionValue<'_>,
manager: &FunctionAnalysisManager,
) -> PreservedAnalyses;
}
Expand All @@ -194,11 +194,7 @@ pub trait LlvmModuleAnalysis {
/// The returned result will be moved into a [Box](`std::boxed::Box`)
/// before being given to the pass manager. This one will then add it to
/// its internal cache, to avoid unnecessary calls to this entrypoint.
fn run_analysis<'a>(
&self,
module: &Module<'a>,
manager: &ModuleAnalysisManager,
) -> Self::Result;
fn run_analysis(&self, module: &Module<'_>, manager: &ModuleAnalysisManager) -> Self::Result;

/// Identifier for the analysis type.
///
Expand Down Expand Up @@ -257,9 +253,9 @@ pub trait LlvmFunctionAnalysis {
/// The returned result will be moved into a [Box](`std::boxed::Box`)
/// before being given to the pass manager. This one will then add it to
/// its internal cache, to avoid unnecessary calls to this entrypoint.
fn run_analysis<'a>(
fn run_analysis(
&self,
module: &FunctionValue<'a>,
module: &FunctionValue<'_>,
manager: &FunctionAnalysisManager,
) -> Self::Result;

Expand Down

0 comments on commit 74b20b9

Please sign in to comment.