From 8a449bb8432156f5109db28d9138931668107cb5 Mon Sep 17 00:00:00 2001 From: Nicholas Chaimov Date: Thu, 5 Dec 2024 14:58:23 -0800 Subject: [PATCH] Replace example plugin with file for instrumentor plugin --- CMakeLists.txt | 2 +- ...s.cpp => salt_instrument_flang_plugin.cpp} | 34 ++++++++----------- 2 files changed, 16 insertions(+), 20 deletions(-) rename src/{PrintFlangFunctionNames.cpp => salt_instrument_flang_plugin.cpp} (62%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2768679..da4ab81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -282,7 +282,7 @@ if(MLIR_FOUND AND Flang_FOUND) list(TRANSFORM SALT_FLANG_PLUGIN_HEADER_FILES PREPEND "${CMAKE_SOURCE_DIR}/include/") set(SALT_FLANG_PLUGIN_SRCS - PrintFlangFunctionNames.cpp + salt_instrument_flang_plugin.cpp ) list(TRANSFORM SALT_FLANG_PLUGIN_SRCS PREPEND "${CMAKE_SOURCE_DIR}/src/") diff --git a/src/PrintFlangFunctionNames.cpp b/src/salt_instrument_flang_plugin.cpp similarity index 62% rename from src/PrintFlangFunctionNames.cpp rename to src/salt_instrument_flang_plugin.cpp index 4a84c3b..7ed29f5 100644 --- a/src/PrintFlangFunctionNames.cpp +++ b/src/salt_instrument_flang_plugin.cpp @@ -1,22 +1,18 @@ -//===-- PrintFlangFunctionNames.cpp ---------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// Small example Flang plugin to count/print Functions & Subroutines names. -// It walks the Parse Tree using a Visitor struct that has Post functions for -// FunctionStmt and SubroutineStmt to access the names of functions & -// subroutines. It also has Pre functions for FunctionSubprogram and -// SubroutineSubprogram so a Bool can be set to show that it is the definition -// of a function/subroutine, and not print those that are in an Interface. -// This plugin does not recognise Statement Functions or Module Procedures, -// which could be dealt with through StmtFunctionStmt and MpSubprogramStmt nodes -// respectively. -// -//===----------------------------------------------------------------------===// +/* +Copyright (C) 2024, ParaTools, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ #include "flang/Frontend/FrontendActions.h" #include "flang/Frontend/FrontendPluginRegistry.h"