diff --git a/libs/libarchfpga/src/arch_check.cpp b/libs/libarchfpga/src/arch_check.cpp index 75c96aa3cfb..237edbc3d11 100644 --- a/libs/libarchfpga/src/arch_check.cpp +++ b/libs/libarchfpga/src/arch_check.cpp @@ -1,5 +1,7 @@ #include +#include +#include "arch_util.h" #include "logic_types.h" #include "vtr_log.h" #include "arch_error.h" diff --git a/libs/libarchfpga/src/arch_check.h b/libs/libarchfpga/src/arch_check.h index b057cbde347..cd154d022ee 100644 --- a/libs/libarchfpga/src/arch_check.h +++ b/libs/libarchfpga/src/arch_check.h @@ -1,5 +1,4 @@ -#ifndef ARCH_CHECK_H -#define ARCH_CHECK_H +#pragma once /** * This file includes all the definitions of functions which purpose is to @@ -8,12 +7,9 @@ * All new functions corresponding to the architecture checking should end up here. */ -#include "arch_types.h" -#include "arch_util.h" - -#include "physical_types_util.h" - -#include "vtr_util.h" +#include +#include "logic_types.h" +#include "physical_types.h" #ifdef __cplusplus extern "C" { @@ -76,5 +72,3 @@ void check_models(t_arch* arch); #ifdef __cplusplus } #endif - -#endif diff --git a/libs/libarchfpga/src/arch_error.h b/libs/libarchfpga/src/arch_error.h index 0dae1d8592e..b6f3cc3f9e0 100644 --- a/libs/libarchfpga/src/arch_error.h +++ b/libs/libarchfpga/src/arch_error.h @@ -1,5 +1,4 @@ -#ifndef ARCH_ERROR_H -#define ARCH_ERROR_H +#pragma once #include "vtr_error.h" #include @@ -14,5 +13,3 @@ class ArchFpgaError : public vtr::VtrError { ArchFpgaError(std::string msg = "", std::string new_filename = "", size_t new_linenumber = -1) : vtr::VtrError(msg, new_filename, new_linenumber) {} }; - -#endif diff --git a/libs/libarchfpga/src/arch_types.h b/libs/libarchfpga/src/arch_types.h index bc2e65a4ca2..6b4f4338a60 100644 --- a/libs/libarchfpga/src/arch_types.h +++ b/libs/libarchfpga/src/arch_types.h @@ -1,3 +1,4 @@ +#pragma once /* * Data types describing the FPGA architecture. * @@ -5,13 +6,6 @@ * Authors: Jason Luu and Kenneth Kent */ -#ifndef ARCH_TYPES_H -#define ARCH_TYPES_H - -#include "logic_types.h" -#include "physical_types.h" -#include "cad_types.h" - /* Input file parsing. */ #define TOKENS " \t\n" @@ -25,5 +19,3 @@ enum class e_arch_format { VTR, /// #include #include "physical_types.h" @@ -114,4 +112,3 @@ void link_physical_logical_types(std::vector& PhysicalTile std::vector& LogicalBlockTypes); void setup_pin_classes(t_physical_tile_type* type); -#endif diff --git a/libs/libarchfpga/src/cad_types.h b/libs/libarchfpga/src/cad_types.h index af0aac9a994..9b4610f029b 100644 --- a/libs/libarchfpga/src/cad_types.h +++ b/libs/libarchfpga/src/cad_types.h @@ -1,10 +1,8 @@ +#pragma once /* * Data types used to give architectural hints for the CAD algorithm */ -#ifndef CAD_TYPES_H -#define CAD_TYPES_H -#include "logic_types.h" #include "physical_types.h" struct t_pack_pattern_connections; @@ -128,5 +126,3 @@ struct t_cluster_placement_primitive { float base_cost; /* cost independent of current status of packing */ float incremental_cost; /* cost dependent on current status of packing */ }; - -#endif diff --git a/libs/libarchfpga/src/clock_types.h b/libs/libarchfpga/src/clock_types.h index ac622d29a95..bde96f56436 100644 --- a/libs/libarchfpga/src/clock_types.h +++ b/libs/libarchfpga/src/clock_types.h @@ -1,8 +1,6 @@ -#ifndef CLOCK_TYPES_H -#define CLOCK_TYPES_H +#pragma once #include -#include enum class e_clock_type { SPINE, @@ -59,5 +57,3 @@ struct t_clock_connection_arch { std::string locationy; float fc; }; - -#endif diff --git a/libs/libarchfpga/src/device_grid.h b/libs/libarchfpga/src/device_grid.h index c04e3f8dc4e..1c89164d8d9 100644 --- a/libs/libarchfpga/src/device_grid.h +++ b/libs/libarchfpga/src/device_grid.h @@ -1,5 +1,4 @@ -#ifndef DEVICE_GRID -#define DEVICE_GRID +#pragma once #include #include @@ -149,5 +148,3 @@ class DeviceGrid { std::vector limiting_resources_; }; - -#endif diff --git a/libs/libarchfpga/src/echo_arch.h b/libs/libarchfpga/src/echo_arch.h index 4e9d2300167..38a8c4f8146 100644 --- a/libs/libarchfpga/src/echo_arch.h +++ b/libs/libarchfpga/src/echo_arch.h @@ -1,11 +1,9 @@ -#ifndef ECHO_ARCH_H -#define ECHO_ARCH_H +#pragma once -#include "arch_types.h" +#include +#include "physical_types.h" void EchoArch(const char* EchoFile, const std::vector& PhysicalTileTypes, const std::vector& LogicalBlockTypes, const t_arch* arch); - -#endif diff --git a/libs/libarchfpga/src/histogram.cpp b/libs/libarchfpga/src/histogram.cpp index aa00ec2ae6b..4d6cf9eaca9 100644 --- a/libs/libarchfpga/src/histogram.cpp +++ b/libs/libarchfpga/src/histogram.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include "vtr_log.h" diff --git a/libs/libarchfpga/src/histogram.h b/libs/libarchfpga/src/histogram.h index 29a0ae47040..2d46e24b6be 100644 --- a/libs/libarchfpga/src/histogram.h +++ b/libs/libarchfpga/src/histogram.h @@ -1,7 +1,7 @@ -#ifndef VPR_HISTOGRAM_H -#define VPR_HISTOGRAM_H +#pragma once #include +#include #include struct HistogramBucket { @@ -22,5 +22,3 @@ void print_histogram(std::vector histogram); float get_histogram_mode(std::vector histogram); std::vector format_histogram(std::vector histogram, size_t width = 80); - -#endif diff --git a/libs/libarchfpga/src/logic_types.h b/libs/libarchfpga/src/logic_types.h index cf9e4b5751c..602ec5c2f12 100644 --- a/libs/libarchfpga/src/logic_types.h +++ b/libs/libarchfpga/src/logic_types.h @@ -1,3 +1,4 @@ +#pragma once /* * Data types describing the logic (technology-mapped) models that the architecture can implement. * Logic models include LUT (.names), flipflop (.latch), inpad, outpad, memory slice, etc. @@ -10,9 +11,6 @@ * Date: April, 2025 */ -#ifndef LOGIC_TYPES_H -#define LOGIC_TYPES_H - #include "vtr_assert.h" #include "vtr_list.h" #include "vtr_memory.h" @@ -275,5 +273,3 @@ class LogicalModels { /// @brief A lookup between the name of a logical model and its ID. std::unordered_map model_name_to_logical_model_id_; }; - -#endif diff --git a/libs/libarchfpga/src/parse_switchblocks.h b/libs/libarchfpga/src/parse_switchblocks.h index 93777f965b6..fd5664818b9 100644 --- a/libs/libarchfpga/src/parse_switchblocks.h +++ b/libs/libarchfpga/src/parse_switchblocks.h @@ -1,9 +1,8 @@ -#ifndef PARSE_SWITCHBLOCKS_H -#define PARSE_SWITCHBLOCKS_H +#pragma once -#include +#include "physical_types.h" #include "pugixml.hpp" -#include "pugixml_util.hpp" +#include "pugixml_loc.hpp" #include "vtr_expr_eval.h" /**** Function Declarations ****/ @@ -18,5 +17,3 @@ void check_switchblock(const t_switchblock_inf* sb, const t_arch* arch); /* returns integer result according to the specified formula and data */ int get_sb_formula_raw_result(vtr::FormulaParser& formula_parser, const char* formula, const vtr::t_formula_data& mydata); - -#endif /* PARSE_SWITCHBLOCKS_H */ diff --git a/libs/libarchfpga/src/physical_types.h b/libs/libarchfpga/src/physical_types.h index 27b787f7c6b..cef4e506eb0 100644 --- a/libs/libarchfpga/src/physical_types.h +++ b/libs/libarchfpga/src/physical_types.h @@ -1,3 +1,4 @@ +#pragma once /* * Data types describing the physical components on the FPGA architecture. * @@ -24,8 +25,6 @@ * Authors: Jason Luu and Kenneth Kent */ -#pragma once - #include #include #include @@ -34,12 +33,9 @@ #include #include #include -#include -#include #include #include "vtr_ndmatrix.h" -#include "vtr_hash.h" #include "vtr_bimap.h" #include "vtr_string_interning.h" diff --git a/libs/libarchfpga/src/physical_types_util.cpp b/libs/libarchfpga/src/physical_types_util.cpp index 74ad3aa6f1e..c0535943391 100644 --- a/libs/libarchfpga/src/physical_types_util.cpp +++ b/libs/libarchfpga/src/physical_types_util.cpp @@ -1,10 +1,7 @@ -#include +#include #include "vtr_assert.h" -#include "vtr_memory.h" #include "vtr_util.h" -#include "arch_types.h" -#include "arch_util.h" #include "arch_error.h" #include "physical_types_util.h" diff --git a/libs/libarchfpga/src/physical_types_util.h b/libs/libarchfpga/src/physical_types_util.h index 84cad62a845..a89ff092b47 100644 --- a/libs/libarchfpga/src/physical_types_util.h +++ b/libs/libarchfpga/src/physical_types_util.h @@ -1,8 +1,4 @@ - #pragma once - -#include "physical_types.h" - /******************************************************************** * * * Physical types utility functions * @@ -114,6 +110,8 @@ * and CLK_2 (physical pin) from the BUFG (logical block) and CLOCK TILE (physical tile). */ +#include "physical_types.h" + ///@brief Returns true if the absolute physical pin index is an output of the given physical tile type bool is_opin(int ipin, t_physical_tile_type_ptr type); diff --git a/libs/libarchfpga/src/read_fpga_interchange_arch.cpp b/libs/libarchfpga/src/read_fpga_interchange_arch.cpp index 24bfcf8113a..c2e476e500e 100644 --- a/libs/libarchfpga/src/read_fpga_interchange_arch.cpp +++ b/libs/libarchfpga/src/read_fpga_interchange_arch.cpp @@ -1,10 +1,15 @@ - #include "read_fpga_interchange_arch.h" -#include "logic_types.h" #ifdef VTR_ENABLE_CAPNPROTO +#include +#include "LogicalNetlist.capnp.h" +#include "logic_types.h" +#include "DeviceResources.capnp.h" +#include "LogicalNetlist.capnp.h" +#include "capnp/serialize.h" + #include #include #include @@ -26,6 +31,15 @@ #include "arch_error.h" #include "arch_util.h" +#else // VTR_ENABLE_CAPNPROTO + +#include +#include "physical_types.h" +#include "vtr_error.h" + +#endif // VTR_ENABLE_CAPNPROTO + +#ifdef VTR_ENABLE_CAPNPROTO /* * FPGA Interchange Device frontend * diff --git a/libs/libarchfpga/src/read_fpga_interchange_arch.h b/libs/libarchfpga/src/read_fpga_interchange_arch.h index 753b44d3010..cdae78fb516 100644 --- a/libs/libarchfpga/src/read_fpga_interchange_arch.h +++ b/libs/libarchfpga/src/read_fpga_interchange_arch.h @@ -1,18 +1,7 @@ -#ifndef READ_FPGAINTERCHANGE_ARCH_FILE_H -#define READ_FPGAINTERCHANGE_ARCH_FILE_H +#pragma once -#include "arch_types.h" - -#ifdef VTR_ENABLE_CAPNPROTO - -#include "DeviceResources.capnp.h" -#include "LogicalNetlist.capnp.h" -#include "capnp/serialize.h" -#include "capnp/serialize-packed.h" -#include -#include - -#endif // VTR_ENABLE_CAPNPROTO +#include +#include "physical_types.h" #ifdef __cplusplus extern "C" { @@ -34,5 +23,3 @@ void FPGAInterchangeReadArch(const char* FPGAInterchangeDeviceFile, #ifdef __cplusplus } #endif - -#endif diff --git a/libs/libarchfpga/src/read_xml_arch_file.h b/libs/libarchfpga/src/read_xml_arch_file.h index b6763493a4c..11a327a66b5 100644 --- a/libs/libarchfpga/src/read_xml_arch_file.h +++ b/libs/libarchfpga/src/read_xml_arch_file.h @@ -1,7 +1,7 @@ -#ifndef READ_XML_ARCH_FILE_H -#define READ_XML_ARCH_FILE_H +#pragma once -#include "arch_types.h" +#include +#include "physical_types.h" #ifdef __cplusplus extern "C" { @@ -21,5 +21,3 @@ void XmlReadArch(const char* ArchFile, #ifdef __cplusplus } #endif - -#endif diff --git a/libs/libarchfpga/src/read_xml_arch_file_noc_tag.h b/libs/libarchfpga/src/read_xml_arch_file_noc_tag.h index ab5015ecc0e..aee99406926 100644 --- a/libs/libarchfpga/src/read_xml_arch_file_noc_tag.h +++ b/libs/libarchfpga/src/read_xml_arch_file_noc_tag.h @@ -1,6 +1,4 @@ - -#ifndef VTR_READ_XML_ARCH_FILE_NOC_TAG_H -#define VTR_READ_XML_ARCH_FILE_NOC_TAG_H +#pragma once #include "pugixml.hpp" #include "pugixml_loc.hpp" @@ -37,5 +35,3 @@ struct t_mesh_region { /// The number of NoC routers in each row or column. int mesh_size; }; - -#endif //VTR_READ_XML_ARCH_FILE_NOC_TAG_H diff --git a/libs/libarchfpga/src/read_xml_util.h b/libs/libarchfpga/src/read_xml_util.h index b5fa4fbf704..e9cf49d1e18 100644 --- a/libs/libarchfpga/src/read_xml_util.h +++ b/libs/libarchfpga/src/read_xml_util.h @@ -1,5 +1,4 @@ -#ifndef READ_XML_UTIL_H -#define READ_XML_UTIL_H +#pragma once #include "pugixml.hpp" #include "pugixml_loc.hpp" @@ -24,5 +23,3 @@ void bad_attribute_value(const pugi::xml_attribute attr, InstPort make_inst_port(std::string str, pugi::xml_node node, const pugiutil::loc_data& loc_data); InstPort make_inst_port(pugi::xml_attribute attr, pugi::xml_node node, const pugiutil::loc_data& loc_data); - -#endif diff --git a/libs/libarchfpga/src/write_models_bb.h b/libs/libarchfpga/src/write_models_bb.h index 251ebf51aad..1bd872e8bba 100644 --- a/libs/libarchfpga/src/write_models_bb.h +++ b/libs/libarchfpga/src/write_models_bb.h @@ -1,10 +1,7 @@ -#ifndef WRITE_MODELS_BB_H -#define WRITE_MODELS_BB_H +#pragma once -#include "arch_types.h" +#include "physical_types.h" void WriteModels_bb(const char* ArchFile, const char* VEchoFile, const t_arch* arch); - -#endif diff --git a/libs/liblog/src/log.h b/libs/liblog/src/log.h index a350a64c558..8670608f68a 100644 --- a/libs/liblog/src/log.h +++ b/libs/liblog/src/log.h @@ -1,3 +1,4 @@ +#pragma once /** * Lightweight logging tool. Automatically prepend messages with prefixes and store in log file. * @@ -7,9 +8,6 @@ * Date: Sept 5, 2014 */ -#ifndef LOG_H -#define LOG_H - void log_set_output_file(const char* filename); void log_print_direct(const char* message, ...); @@ -18,5 +16,3 @@ void log_print_warning(const char* filename, unsigned int line_num, const char* void log_print_error(const char* filename, unsigned int line_num, const char* message, ...); void log_close(); - -#endif diff --git a/libs/libpugiutil/src/pugixml_loc.hpp b/libs/libpugiutil/src/pugixml_loc.hpp index 0f597a593b1..23088fcfcd4 100644 --- a/libs/libpugiutil/src/pugixml_loc.hpp +++ b/libs/libpugiutil/src/pugixml_loc.hpp @@ -1,5 +1,4 @@ -#ifndef PUGIXML_LOC_H -#define PUGIXML_LOC_H +#pragma once /* * This file contains utilities for the PUGI XML parser, * hanlding the retrieval of line numbers (useful for error messages) @@ -47,5 +46,3 @@ class loc_data { std::vector offsets_; }; } // namespace pugiutil - -#endif diff --git a/libs/libpugiutil/src/pugixml_util.hpp b/libs/libpugiutil/src/pugixml_util.hpp index 3bb60779fc0..54b27fa8ade 100644 --- a/libs/libpugiutil/src/pugixml_util.hpp +++ b/libs/libpugiutil/src/pugixml_util.hpp @@ -1,5 +1,4 @@ -#ifndef PUGIXML_UTIL_H -#define PUGIXML_UTIL_H +#pragma once /* * This file contains utilities for the PUGI XML parser. * @@ -195,5 +194,3 @@ bool check_node(const pugi::xml_node node, const ReqOpt req_opt = REQUIRED); } // namespace pugiutil - -#endif diff --git a/libs/librrgraph/src/base/check_rr_graph.cpp b/libs/librrgraph/src/base/check_rr_graph.cpp index 027806f6cc2..0ccb3751139 100644 --- a/libs/librrgraph/src/base/check_rr_graph.cpp +++ b/libs/librrgraph/src/base/check_rr_graph.cpp @@ -1,5 +1,4 @@ #include "vtr_log.h" -#include "vtr_memory.h" #include "vtr_util.h" #include "vpr_error.h" @@ -9,7 +8,6 @@ #include "physical_types_util.h" #include "describe_rr_node.h" -#include "rr_graph_utils.h" /*********************** Subroutines local to this module *******************/ diff --git a/libs/librrgraph/src/base/check_rr_graph.h b/libs/librrgraph/src/base/check_rr_graph.h index a869a1a7e0d..828438faab3 100644 --- a/libs/librrgraph/src/base/check_rr_graph.h +++ b/libs/librrgraph/src/base/check_rr_graph.h @@ -1,5 +1,4 @@ -#ifndef CHECK_RR_GRAPH_H -#define CHECK_RR_GRAPH_H +#pragma once #include "device_grid.h" #include "rr_graph_view.h" @@ -20,5 +19,3 @@ void check_rr_node(const RRGraphView& rr_graph, const enum e_route_type route_type, const int inode, bool is_flat); - -#endif diff --git a/libs/librrgraph/src/base/check_rr_graph_obj.h b/libs/librrgraph/src/base/check_rr_graph_obj.h index 5b5041277b4..fe3bdc23ba1 100644 --- a/libs/librrgraph/src/base/check_rr_graph_obj.h +++ b/libs/librrgraph/src/base/check_rr_graph_obj.h @@ -1,11 +1,7 @@ -#ifndef CHECK_RR_GRAPH_OBJ_H -#define CHECK_RR_GRAPH_OBJ_H - +#pragma once /* Include header files which include data structures used by * the function declaration */ #include "rr_graph_obj.h" bool check_rr_graph(const RRGraph& rr_graph); - -#endif diff --git a/libs/librrgraph/src/base/get_parallel_segs.h b/libs/librrgraph/src/base/get_parallel_segs.h index f25eb564056..cfd1189417f 100644 --- a/libs/librrgraph/src/base/get_parallel_segs.h +++ b/libs/librrgraph/src/base/get_parallel_segs.h @@ -1,5 +1,4 @@ -#ifndef GET_PARALLEL_SEGS_H -#define GET_PARALLEL_SEGS_H +#pragma once #include "rr_graph_type.h" #include "physical_types.h" @@ -19,5 +18,3 @@ std::vector get_parallel_segs(const std::vector& segment_inf, t_unified_to_parallel_seg_index& seg_index_map, enum e_parallel_axis parallel_axis); - -#endif \ No newline at end of file diff --git a/libs/librrgraph/src/base/metadata_storage.h b/libs/librrgraph/src/base/metadata_storage.h index c261ff28aa8..db703d2de4c 100644 --- a/libs/librrgraph/src/base/metadata_storage.h +++ b/libs/librrgraph/src/base/metadata_storage.h @@ -1,6 +1,7 @@ -#ifndef _METADATA_STORAGE_H_ -#define _METADATA_STORAGE_H_ +#pragma once +#include "physical_types.h" +#include "vtr_flat_map.h" #include "vtr_string_interning.h" /** @@ -111,5 +112,3 @@ class MetadataStorage { mutable std::vector> data_; mutable vtr::flat_map map_; }; - -#endif /* _METADATA_STORAGE_H_ */ diff --git a/libs/librrgraph/src/base/rr_edge.h b/libs/librrgraph/src/base/rr_edge.h index 0fb3ac244ff..0f95a96167f 100644 --- a/libs/librrgraph/src/base/rr_edge.h +++ b/libs/librrgraph/src/base/rr_edge.h @@ -1,6 +1,6 @@ -#ifndef RR_EDGE_H -#define RR_EDGE_H +#pragma once +#include "physical_types.h" #include "rr_graph_fwd.h" struct t_rr_edge_info { @@ -27,5 +27,3 @@ struct t_rr_edge_info { }; typedef std::vector t_rr_edge_info_set; - -#endif /* RR_EDGE */ diff --git a/libs/librrgraph/src/base/rr_graph_builder.cpp b/libs/librrgraph/src/base/rr_graph_builder.cpp index 4bf9680322a..45e58a7db15 100644 --- a/libs/librrgraph/src/base/rr_graph_builder.cpp +++ b/libs/librrgraph/src/base/rr_graph_builder.cpp @@ -3,9 +3,6 @@ #include "vtr_time.h" #include #include -//#include - -//#include "globals.h" RRGraphBuilder::RRGraphBuilder() {} diff --git a/libs/librrgraph/src/base/rr_graph_builder.h b/libs/librrgraph/src/base/rr_graph_builder.h index 487457e7bc5..d1db7af2d45 100644 --- a/libs/librrgraph/src/base/rr_graph_builder.h +++ b/libs/librrgraph/src/base/rr_graph_builder.h @@ -1,6 +1,4 @@ -#ifndef RR_GRAPH_BUILDER_H -#define RR_GRAPH_BUILDER_H - +#pragma once /** * @file * @brief This file defines the RRGraphBuilder data structure which allows data modification on a routing resource graph @@ -13,6 +11,7 @@ * - This is the only data structure allowed to modify a routing resource graph * */ + #include "rr_graph_storage.h" #include "rr_spatial_lookup.h" #include "metadata_storage.h" @@ -427,5 +426,3 @@ class RRGraphBuilder { */ MetadataStorage> rr_edge_metadata_; }; - -#endif diff --git a/libs/librrgraph/src/base/rr_graph_cost.h b/libs/librrgraph/src/base/rr_graph_cost.h index 00c14c912c2..dc651f72344 100644 --- a/libs/librrgraph/src/base/rr_graph_cost.h +++ b/libs/librrgraph/src/base/rr_graph_cost.h @@ -1,5 +1,4 @@ -#ifndef RR_GRAPH_COST_H -#define RR_GRAPH_COST_H +#pragma once enum e_base_cost_type { DELAY_NORMALIZED, @@ -19,5 +18,3 @@ enum e_cost_indices { IPIN_COST_INDEX, CHANX_COST_INDEX_START }; - -#endif \ No newline at end of file diff --git a/libs/librrgraph/src/base/rr_graph_fwd.h b/libs/librrgraph/src/base/rr_graph_fwd.h index 41d0b8f3d58..1d3b15f7a02 100644 --- a/libs/librrgraph/src/base/rr_graph_fwd.h +++ b/libs/librrgraph/src/base/rr_graph_fwd.h @@ -1,5 +1,4 @@ -#ifndef RR_GRAPH_OBJ_FWD_H -#define RR_GRAPH_OBJ_FWD_H +#pragma once #include @@ -29,5 +28,3 @@ typedef vtr::StrongId RRIndexedDataId; typedef vtr::StrongId RRSwitchId; typedef vtr::StrongId RRSegmentId; typedef vtr::StrongId NodeRCIndex; - -#endif diff --git a/libs/librrgraph/src/base/rr_graph_obj.cpp b/libs/librrgraph/src/base/rr_graph_obj.cpp index 211c49990bf..59654aa0992 100644 --- a/libs/librrgraph/src/base/rr_graph_obj.cpp +++ b/libs/librrgraph/src/base/rr_graph_obj.cpp @@ -4,12 +4,8 @@ ***********************************************************************/ #include #include -#include -#include -#include "vtr_vector_map.h" #include "vtr_log.h" -#include "vtr_util.h" #include "vtr_assert.h" #include "rr_graph_obj.h" #include "rr_graph_obj_utils.h" diff --git a/libs/librrgraph/src/base/rr_graph_obj.h b/libs/librrgraph/src/base/rr_graph_obj.h index f3a3f8c8477..59aa34edc1f 100644 --- a/libs/librrgraph/src/base/rr_graph_obj.h +++ b/libs/librrgraph/src/base/rr_graph_obj.h @@ -1,3 +1,4 @@ +#pragma once /************************************************************************ * This file introduces a class to model a Routing Resource Graph (RRGraph or RRG) * which is widely used by placers, routers, analyzers etc. @@ -186,8 +187,6 @@ * } * ***********************************************************************/ -#ifndef RR_GRAPH_OBJ_H -#define RR_GRAPH_OBJ_H /* * Notes in include header files in a head file @@ -196,14 +195,13 @@ */ /* Header files should be included in a sequence */ /* Standard header files required go first */ -#include #include /* EXTERNAL library header files go second*/ +#include "physical_types.h" #include "vtr_vector.h" #include "vtr_range.h" #include "vtr_geometry.h" -#include "arch_types.h" /* VPR header files go third */ #include "rr_node_types.h" @@ -833,5 +831,3 @@ class RRGraph { typedef std::vector>>>> NodeLookup; mutable NodeLookup node_lookup_; }; - -#endif diff --git a/libs/librrgraph/src/base/rr_graph_obj_utils.h b/libs/librrgraph/src/base/rr_graph_obj_utils.h index 910b0ce3acd..708f4f389ec 100644 --- a/libs/librrgraph/src/base/rr_graph_obj_utils.h +++ b/libs/librrgraph/src/base/rr_graph_obj_utils.h @@ -1,10 +1,8 @@ -#ifndef RR_GRAPH_OBJ_UTILS_H -#define RR_GRAPH_OBJ_UTILS_H - +#pragma once /* Include header files which include data structures used by * the function declaration */ -#include + #include "vtr_vector_map.h" /* @@ -161,5 +159,3 @@ ValueContainer update_valid_refs(const ValueContainer& values, const IdContainer } return updated; } - -#endif diff --git a/libs/librrgraph/src/base/rr_graph_storage.cpp b/libs/librrgraph/src/base/rr_graph_storage.cpp index 216d3770cac..a29762d6fcc 100644 --- a/libs/librrgraph/src/base/rr_graph_storage.cpp +++ b/libs/librrgraph/src/base/rr_graph_storage.cpp @@ -1,7 +1,6 @@ #include #include "arch_types.h" #include "rr_graph_storage.h" -#include "vtr_expr_eval.h" #include "vtr_error.h" #include diff --git a/libs/librrgraph/src/base/rr_graph_storage.h b/libs/librrgraph/src/base/rr_graph_storage.h index 2f6702f24f3..1fef9c29e1f 100644 --- a/libs/librrgraph/src/base/rr_graph_storage.h +++ b/libs/librrgraph/src/base/rr_graph_storage.h @@ -1,7 +1,5 @@ -#ifndef RR_GRAPH_STORAGE -#define RR_GRAPH_STORAGE +#pragma once -#include #include #include "vtr_vector.h" @@ -15,7 +13,6 @@ #include "vtr_memory.h" #include "vtr_strong_id_range.h" #include "vtr_array_view.h" -#include #include #include @@ -1193,5 +1190,3 @@ class t_rr_graph_view { const std::unordered_map& virtual_clock_network_root_idx_; }; - -#endif /* _RR_GRAPH_STORAGE_ */ diff --git a/libs/librrgraph/src/base/rr_graph_storage_utils.h b/libs/librrgraph/src/base/rr_graph_storage_utils.h index a2c9dfdeb70..1d60707d66d 100644 --- a/libs/librrgraph/src/base/rr_graph_storage_utils.h +++ b/libs/librrgraph/src/base/rr_graph_storage_utils.h @@ -1,11 +1,12 @@ -#ifndef RR_GRAPH_STORAGE_UTILS_H -#define RR_GRAPH_STORAGE_UTILS_H +#pragma once + +#include +#include // Make room in a vector, with amortized O(1) time by using a pow2 growth pattern. // // This enables potentially random insertion into a vector with amortized O(1) // time. - template void make_room_in_vector(T* vec, size_t elem_position) { if (elem_position < vec->size()) { @@ -23,5 +24,3 @@ void make_room_in_vector(T* vec, size_t elem_position) { vec->resize(elem_position + 1); } - -#endif \ No newline at end of file diff --git a/libs/librrgraph/src/base/rr_graph_type.h b/libs/librrgraph/src/base/rr_graph_type.h index 05c0cad0818..cb4caff72d8 100644 --- a/libs/librrgraph/src/base/rr_graph_type.h +++ b/libs/librrgraph/src/base/rr_graph_type.h @@ -1,5 +1,4 @@ -#ifndef RR_GRAPH_TYPE_H -#define RR_GRAPH_TYPE_H +#pragma once #include #include "physical_types.h" @@ -46,5 +45,3 @@ enum class e_graph_type { * @see get_parallel_segs for more details. */ typedef std::unordered_multimap> t_unified_to_parallel_seg_index; - -#endif \ No newline at end of file diff --git a/libs/librrgraph/src/base/rr_graph_utils.cpp b/libs/librrgraph/src/base/rr_graph_utils.cpp index 6a76ac6bac2..a728ed04593 100644 --- a/libs/librrgraph/src/base/rr_graph_utils.cpp +++ b/libs/librrgraph/src/base/rr_graph_utils.cpp @@ -1,7 +1,5 @@ -#include -#include - #include "rr_graph_utils.h" +#include #include "vpr_error.h" #include "rr_graph_obj.h" #include "rr_graph_builder.h" diff --git a/libs/librrgraph/src/base/rr_graph_utils.h b/libs/librrgraph/src/base/rr_graph_utils.h index 7ede4baafb9..b6bb43f625c 100644 --- a/libs/librrgraph/src/base/rr_graph_utils.h +++ b/libs/librrgraph/src/base/rr_graph_utils.h @@ -1,16 +1,15 @@ +#pragma once /** * @file rr_graph_utils.h * * @brief This file includes the most-utilized functions that manipulate the RRGraph object. */ -#ifndef RR_GRAPH_UTILS_H -#define RR_GRAPH_UTILS_H - /* Include header files which include data structures used by * the function declaration */ #include +#include "rr_graph_builder.h" #include "rr_graph_fwd.h" #include "rr_node_types.h" #include "rr_graph_view.h" @@ -99,4 +98,3 @@ int seg_index_of_sblock(const RRGraphView& rr_graph, int from_node, int to_node) * @return limited_to_opin */ bool inter_layer_connections_limited_to_opin(const RRGraphView& rr_graph); -#endif \ No newline at end of file diff --git a/libs/librrgraph/src/base/rr_graph_view.h b/libs/librrgraph/src/base/rr_graph_view.h index 49a3f92bf97..9eaf60cb5b8 100644 --- a/libs/librrgraph/src/base/rr_graph_view.h +++ b/libs/librrgraph/src/base/rr_graph_view.h @@ -1,6 +1,4 @@ -#ifndef RR_GRAPH_VIEW_H -#define RR_GRAPH_VIEW_H - +#pragma once /** * @file * @brief The RRGraphView encapsulates a read-only routing resource graph as most @@ -55,9 +53,12 @@ * attributes, particularly geometry information (type, x, y, etc.). * \endinternal */ -#include "rr_graph_builder.h" + +#include "metadata_storage.h" #include "rr_node.h" #include "physical_types.h" +#include "rr_spatial_lookup.h" +#include "vtr_geometry.h" class RRGraphView { /* -- Constructors -- */ @@ -283,7 +284,6 @@ class RRGraphView { * @note To return true, the RRNode must be completely contained within the specified bounding box, * with the edges of the bounding box being inclusive. */ - inline bool node_is_inside_bounding_box(RRNodeId node, vtr::Rect bounding_box) const { return (node_xhigh(node) <= bounding_box.xmax() && node_xlow(node) >= bounding_box.xmin() @@ -629,6 +629,7 @@ class RRGraphView { * The main (perhaps only) current use of this metadata is the fasm tool of symbiflow, * which needs extra metadata on which programming bits control which switch in order to produce a bitstream.*/ const MetadataStorage& rr_node_metadata_; + /** * @brief Attributes for each rr_edge * @@ -651,5 +652,3 @@ class RRGraphView { /// switch info for rr nodes const vtr::vector& rr_switch_inf_; }; - -#endif diff --git a/libs/librrgraph/src/base/rr_metadata.h b/libs/librrgraph/src/base/rr_metadata.h index 8bc1577cd08..dd2b9f5b935 100644 --- a/libs/librrgraph/src/base/rr_metadata.h +++ b/libs/librrgraph/src/base/rr_metadata.h @@ -1,5 +1,4 @@ -#ifndef RR_METADATA_H_ -#define RR_METADATA_H_ +#pragma once #include "physical_types.h" #include "rr_graph_builder.h" @@ -15,5 +14,3 @@ void add_rr_edge_metadata(MetadataStorage>& rr_edge_ void add_rr_edge_metadata(MetadataStorage>& rr_edge_metadata, int src_node, int sink_node, short switch_id, vtr::string_view key, vtr::string_view value, const t_arch* arch); } // namespace vpr - -#endif // RR_METADATA_H_ diff --git a/libs/librrgraph/src/base/rr_node.h b/libs/librrgraph/src/base/rr_node.h index f34bb31fa7e..a2cd0aa9b2c 100644 --- a/libs/librrgraph/src/base/rr_node.h +++ b/libs/librrgraph/src/base/rr_node.h @@ -1,5 +1,4 @@ -#ifndef RR_NODE_H -#define RR_NODE_H +#pragma once #include #include "physical_types.h" @@ -7,12 +6,6 @@ #include "rr_graph_fwd.h" #include "rr_node_types.h" -#include "vtr_range.h" - -#include -#include -#include - // t_rr_node is a proxy object for accessing data in t_rr_graph_storage. // // In general, new code should not use this object, but instead directly @@ -150,5 +143,3 @@ struct t_rr_indexed_data { }; #include "rr_node_impl.h" - -#endif diff --git a/libs/librrgraph/src/base/rr_node_fwd.h b/libs/librrgraph/src/base/rr_node_fwd.h index 82807fb01a1..a894594d6ca 100644 --- a/libs/librrgraph/src/base/rr_node_fwd.h +++ b/libs/librrgraph/src/base/rr_node_fwd.h @@ -1,12 +1,6 @@ -#ifndef RR_NODE_FWD_H -#define RR_NODE_FWD_H - -#include -#include "rr_node_types.h" +#pragma once //Forward declaration class t_rr_node; class t_rr_graph_storage; class node_idx_iterator; - -#endif diff --git a/libs/librrgraph/src/base/rr_node_impl.h b/libs/librrgraph/src/base/rr_node_impl.h index 83b93e43b46..4b5f41d62d8 100644 --- a/libs/librrgraph/src/base/rr_node_impl.h +++ b/libs/librrgraph/src/base/rr_node_impl.h @@ -1,5 +1,4 @@ -#ifndef RR_NODE_IMPL_H -#define RR_NODE_IMPL_H +#pragma once // This file provides the inline proxy implemenation for t_rr_node. // See the t_rr_node class comment for additional details. @@ -84,5 +83,3 @@ inline t_edge_size t_rr_node::num_edges() const { inline edge_idx_range t_rr_node::edges() const { return storage_->edges(id_); } - -#endif /* _RR_NODE_IMPL_H_ */ diff --git a/libs/librrgraph/src/base/rr_rc_data.h b/libs/librrgraph/src/base/rr_rc_data.h index 5c2009dc810..60a52a98f5d 100644 --- a/libs/librrgraph/src/base/rr_rc_data.h +++ b/libs/librrgraph/src/base/rr_rc_data.h @@ -1,5 +1,4 @@ -#ifndef _RR_RC_DATA_H_ -#define _RR_RC_DATA_H_ +#pragma once #include "rr_node_types.h" @@ -12,5 +11,3 @@ * The returned indicies index into DeviceContext.rr_rc_data. */ short find_create_rr_rc_data(const float R, const float C, std::vector& rr_rc_data); - -#endif /* _RR_RC_DATA_H_ */ diff --git a/libs/librrgraph/src/base/rr_spatial_lookup.cpp b/libs/librrgraph/src/base/rr_spatial_lookup.cpp index 731dc147fde..3b53404e6f8 100644 --- a/libs/librrgraph/src/base/rr_spatial_lookup.cpp +++ b/libs/librrgraph/src/base/rr_spatial_lookup.cpp @@ -1,5 +1,7 @@ +#include "rr_graph_fwd.h" #include "vtr_assert.h" #include "rr_spatial_lookup.h" +#include RRNodeId RRSpatialLookup::find_node(int layer, int x, diff --git a/libs/librrgraph/src/base/rr_spatial_lookup.h b/libs/librrgraph/src/base/rr_spatial_lookup.h index c69f34b791a..733aa413b86 100644 --- a/libs/librrgraph/src/base/rr_spatial_lookup.h +++ b/libs/librrgraph/src/base/rr_spatial_lookup.h @@ -1,5 +1,4 @@ #pragma once - /** * @file * @brief This RRSpatialLookup class encapsulates @@ -14,6 +13,7 @@ * - Update the look-up with new nodes * - Find the id of a node with given information, e.g., x, y, type etc. */ + #include "vtr_geometry.h" #include "vtr_vector.h" #include "physical_types.h" diff --git a/libs/librrgraph/src/io/rr_graph_reader.cpp b/libs/librrgraph/src/io/rr_graph_reader.cpp index 0bcd843ae34..875587695b8 100644 --- a/libs/librrgraph/src/io/rr_graph_reader.cpp +++ b/libs/librrgraph/src/io/rr_graph_reader.cpp @@ -19,7 +19,6 @@ #include "rr_graph_uxsdcxx.h" #include -#include #include #include "vtr_time.h" @@ -207,4 +206,4 @@ void load_rr_edge_delay_overrides(std::string_view filename, rr_graph_builder.override_edge_switch(edge_id, new_switch_id); } } -} \ No newline at end of file +} diff --git a/libs/librrgraph/src/io/rr_graph_reader.h b/libs/librrgraph/src/io/rr_graph_reader.h index 044345ee721..038addb22fc 100644 --- a/libs/librrgraph/src/io/rr_graph_reader.h +++ b/libs/librrgraph/src/io/rr_graph_reader.h @@ -1,8 +1,6 @@ +#pragma once /* Defines the function used to load an rr graph written in xml format into vpr*/ -#ifndef RR_GRAPH_READER_H -#define RR_GRAPH_READER_H - #include "rr_graph_type.h" #include "rr_graph_cost.h" #include "rr_graph_builder.h" @@ -54,5 +52,3 @@ void load_rr_file(RRGraphBuilder* rr_graph_builder, void load_rr_edge_delay_overrides(std::string_view filename, RRGraphBuilder& rr_graph_builder, const RRGraphView& rr_graph); - -#endif /* RR_GRAPH_READER_H */ diff --git a/libs/librrgraph/src/io/rr_graph_writer.cpp b/libs/librrgraph/src/io/rr_graph_writer.cpp index 291d9ffafa4..341bb67c410 100644 --- a/libs/librrgraph/src/io/rr_graph_writer.cpp +++ b/libs/librrgraph/src/io/rr_graph_writer.cpp @@ -13,8 +13,6 @@ #include "rr_graph_uxsdcxx_serializer.h" #include "rr_graph_uxsdcxx.h" #ifdef VTR_ENABLE_CAPNPROTO -# include "capnp/serialize.h" -# include "ndmatrix_serdes.h" # include "serdes_utils.h" # include "rr_graph_uxsdcxx_capnp.h" #endif diff --git a/libs/librrgraph/src/io/rr_graph_writer.h b/libs/librrgraph/src/io/rr_graph_writer.h index b84fe3e9f6e..d4abbd1697b 100644 --- a/libs/librrgraph/src/io/rr_graph_writer.h +++ b/libs/librrgraph/src/io/rr_graph_writer.h @@ -1,11 +1,9 @@ +#pragma once /* * This function writes the RR_graph generated by VPR into a file in XML format * Information included in the file includes rr nodes, rr switches, the grid, block info, node indices */ -#ifndef RR_GRAPH_WRITER_H -#define RR_GRAPH_WRITER_H - #include "rr_node.h" #include "rr_graph_type.h" #include "rr_graph_builder.h" @@ -26,5 +24,3 @@ void write_rr_graph(RRGraphBuilder* rr_graph_builder, bool echo_enabled, const char* echo_file_name, bool is_flat); - -#endif diff --git a/libs/librrgraph/src/utils/alloc_and_load_rr_indexed_data.cpp b/libs/librrgraph/src/utils/alloc_and_load_rr_indexed_data.cpp index 5d65c348205..001c03fe898 100644 --- a/libs/librrgraph/src/utils/alloc_and_load_rr_indexed_data.cpp +++ b/libs/librrgraph/src/utils/alloc_and_load_rr_indexed_data.cpp @@ -1,23 +1,21 @@ #include /* Needed only for sqrt call (remove if sqrt removed) */ #include #include +#include #include -#include /* Needed for ortho_Cost_index calculation*/ #include "alloc_and_load_rr_indexed_data.h" +#include "arch_types.h" #include "vtr_assert.h" #include "vtr_log.h" -#include "vtr_memory.h" #include "vtr_math.h" #include "vpr_error.h" #include "rr_graph_utils.h" -#include "read_xml_arch_file.h" #include "rr_graph_cost.h" -#include "rr_graph_type.h" #include "histogram.h" diff --git a/libs/librrgraph/src/utils/alloc_and_load_rr_indexed_data.h b/libs/librrgraph/src/utils/alloc_and_load_rr_indexed_data.h index 1a96141163a..a70946dc565 100644 --- a/libs/librrgraph/src/utils/alloc_and_load_rr_indexed_data.h +++ b/libs/librrgraph/src/utils/alloc_and_load_rr_indexed_data.h @@ -1,5 +1,4 @@ -#ifndef ALLOC_AND_LOAD_RR_INDEXED_DATA_H -#define ALLOC_AND_LOAD_RR_INDEXED_DATA_H +#pragma once #include "rr_graph_view.h" #include "rr_node.h" @@ -21,5 +20,3 @@ std::vector find_ortho_cost_index(const RRGraphView& rr_graph, const std::vector segment_inf_x, const std::vector segment_inf_y, e_parallel_axis parallel_axis); - -#endif \ No newline at end of file diff --git a/libs/librrgraph/src/utils/describe_rr_node.h b/libs/librrgraph/src/utils/describe_rr_node.h index 6b3e9355620..3c44031bb1c 100644 --- a/libs/librrgraph/src/utils/describe_rr_node.h +++ b/libs/librrgraph/src/utils/describe_rr_node.h @@ -1,5 +1,4 @@ -#ifndef DESCRIBE_RR_NODE_H -#define DESCRIBE_RR_NODE_H +#pragma once #include #include "rr_graph_view.h" @@ -11,5 +10,3 @@ std::string describe_rr_node(const RRGraphView& rr_graph, const vtr::vector& rr_indexed_data, RRNodeId inode, bool is_flat); - -#endif \ No newline at end of file diff --git a/libs/libvtrcapnproto/intra_cluster_serdes.h b/libs/libvtrcapnproto/intra_cluster_serdes.h index f5579fc8cde..6d99ff2bc88 100644 --- a/libs/libvtrcapnproto/intra_cluster_serdes.h +++ b/libs/libvtrcapnproto/intra_cluster_serdes.h @@ -1,16 +1,12 @@ +#pragma once // // Created by amin on 1/17/23. // -#ifndef VTR_INTRA_CLUSTER_SERDES_H -#define VTR_INTRA_CLUSTER_SERDES_H - #include #include #include -#include "vtr_ndmatrix.h" -#include "vpr_error.h" #include "matrix.capnp.h" #include "map_lookahead.capnp.h" #include "vpr_types.h" @@ -75,8 +71,3 @@ void FromUnorderedMap( flat_idx++; } } - - - - -#endif //VTR_INTRA_CLUSTER_SERDES_H diff --git a/libs/libvtrcapnproto/mmap_file.h b/libs/libvtrcapnproto/mmap_file.h index ee1a93e83c5..4a93144a80a 100644 --- a/libs/libvtrcapnproto/mmap_file.h +++ b/libs/libvtrcapnproto/mmap_file.h @@ -1,8 +1,7 @@ -#ifndef MMAP_FILE_H_ -#define MMAP_FILE_H_ +#pragma once +#include "capnp/common.h" #include -#include "capnp/message.h" #include "kj/array.h" // Platform independent mmap, useful for reading large capnp's. @@ -15,5 +14,3 @@ class MmapFile { size_t size_; kj::Array data_; }; - -#endif /* MMAP_FILE_H_ */ diff --git a/libs/libvtrcapnproto/ndmatrix_serdes.h b/libs/libvtrcapnproto/ndmatrix_serdes.h index 0282d4583b2..11bf3492d68 100644 --- a/libs/libvtrcapnproto/ndmatrix_serdes.h +++ b/libs/libvtrcapnproto/ndmatrix_serdes.h @@ -1,5 +1,4 @@ -#ifndef NDMATRIX_SERDES_H_ -#define NDMATRIX_SERDES_H_ +#pragma once // Provide generic functions for serializing vtr::NdMatrix to and from Cap'n // proto Matrix. // @@ -56,6 +55,7 @@ // vtr::NdMatrix mat_out; // ToNdMatrix<3, Test::Vec2, Vec2>(&mat_out, test.getVectors(), FromVec2); // } + #include #include "vtr_ndmatrix.h" #include "vpr_error.h" @@ -137,5 +137,3 @@ void FromNdMatrix( copy_fun(&elem, m_in.get(i)); } } - -#endif /* NDMATRIX_SERDES_H_ */ diff --git a/libs/libvtrcapnproto/serdes_utils.cpp b/libs/libvtrcapnproto/serdes_utils.cpp index 2201fa584ea..2190f3539ca 100644 --- a/libs/libvtrcapnproto/serdes_utils.cpp +++ b/libs/libvtrcapnproto/serdes_utils.cpp @@ -1,5 +1,6 @@ #include "serdes_utils.h" +#include "capnp/serialize.h" #include #include diff --git a/libs/libvtrcapnproto/serdes_utils.h b/libs/libvtrcapnproto/serdes_utils.h index 723a14772d8..17ba042faa4 100644 --- a/libs/libvtrcapnproto/serdes_utils.h +++ b/libs/libvtrcapnproto/serdes_utils.h @@ -1,9 +1,9 @@ -#ifndef SERDES_UTILS_H_ -#define SERDES_UTILS_H_ +#pragma once +#include "capnp/message.h" +#include #include #include -#include "capnp/serialize.h" // Platform indepedent way to file message to a file on disk. void writeMessageToFile(const std::string& file, @@ -16,5 +16,3 @@ inline ::capnp::ReaderOptions default_large_capnp_opts() { opts.traversalLimitInWords = std::numeric_limits::max(); return opts; } - -#endif /* SERDES_UTILS_H_ */ diff --git a/libs/libvtrutil/src/picosha2.h b/libs/libvtrutil/src/picosha2.h index 67794f92087..9ad8f82eba3 100644 --- a/libs/libvtrutil/src/picosha2.h +++ b/libs/libvtrutil/src/picosha2.h @@ -1,3 +1,4 @@ +#pragma once /* * The MIT License (MIT) * @@ -21,8 +22,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef PICOSHA2_H -#define PICOSHA2_H //picosha2:20140213 #include #include @@ -353,5 +352,3 @@ std::string hash256_hex_string(const RaContainer& src) { } } //namespace picosha2 - -#endif //PICOSHA2_H diff --git a/libs/libvtrutil/src/specrand.h b/libs/libvtrutil/src/specrand.h index 6216a3a341a..2536efcd55e 100644 --- a/libs/libvtrutil/src/specrand.h +++ b/libs/libvtrutil/src/specrand.h @@ -1,5 +1,4 @@ -#ifndef VPR_SPEC_RAND_H -#define VPR_SPEC_RAND_H +#pragma once /* * For inclusion in the SPEC cpu benchmarks * This file implements the random number generation necessary for the SPEC cpu benchmarks. The functions @@ -115,5 +114,3 @@ class SpecRandomNumberGenerator : public vtr::RandomNumberGeneratorInterface { /// the array for the state vector unsigned long mt[N]; }; - -#endif diff --git a/libs/libvtrutil/src/vpr_error.h b/libs/libvtrutil/src/vpr_error.h index 19813253625..8df3adcc4d9 100644 --- a/libs/libvtrutil/src/vpr_error.h +++ b/libs/libvtrutil/src/vpr_error.h @@ -1,9 +1,7 @@ -#ifndef VPR_ERROR_H -#define VPR_ERROR_H +#pragma once #include #include -#include #include "vtr_error.h" @@ -124,5 +122,3 @@ void vpr_throw_opt(enum e_vpr_error type, const char* psz_func_pretty_name, cons do { \ vpr_throw_opt(type, VPR_THROW_FUNCTION, __func__, __FILE__, __LINE__, __VA_ARGS__); \ } while (false) - -#endif diff --git a/libs/libvtrutil/src/vtr_array.h b/libs/libvtrutil/src/vtr_array.h index 7866bd07c41..01cb408f9cf 100644 --- a/libs/libvtrutil/src/vtr_array.h +++ b/libs/libvtrutil/src/vtr_array.h @@ -2,7 +2,6 @@ #include #include -#include namespace vtr { diff --git a/libs/libvtrutil/src/vtr_assert.h b/libs/libvtrutil/src/vtr_assert.h index e17448a0c89..f159bc2969e 100644 --- a/libs/libvtrutil/src/vtr_assert.h +++ b/libs/libvtrutil/src/vtr_assert.h @@ -1,6 +1,4 @@ -#ifndef VTR_ASSERT_H -#define VTR_ASSERT_H - +#pragma once /** * @file * @brief The header vtr_assert.h defines useful assertion macros for VTR projects. @@ -147,5 +145,3 @@ namespace assert { [[noreturn]] void handle_assert(const char* expr, const char* file, unsigned int line, const char* function, const char* msg); } // namespace assert } // namespace vtr - -#endif //VTR_ASSERT_H diff --git a/libs/libvtrutil/src/vtr_bimap.h b/libs/libvtrutil/src/vtr_bimap.h index 28e11772d89..014aa0a3259 100644 --- a/libs/libvtrutil/src/vtr_bimap.h +++ b/libs/libvtrutil/src/vtr_bimap.h @@ -1,6 +1,4 @@ -#ifndef VTR_BIMAP -#define VTR_BIMAP - +#pragma once /** * @file * @brief The vtr_bimap.h header provides a bi-directonal mapping between key and value which means that it can be addressed by either the key or the value @@ -181,5 +179,3 @@ template using linear_bimap = bimap; } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_cache.h b/libs/libvtrutil/src/vtr_cache.h index deea5311af8..202a4559b3c 100644 --- a/libs/libvtrutil/src/vtr_cache.h +++ b/libs/libvtrutil/src/vtr_cache.h @@ -1,5 +1,4 @@ -#ifndef VTR_CACHE_H_ -#define VTR_CACHE_H_ +#pragma once #include @@ -48,5 +47,3 @@ class Cache { }; } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_color_map.h b/libs/libvtrutil/src/vtr_color_map.h index f313999caf2..94317850e43 100644 --- a/libs/libvtrutil/src/vtr_color_map.h +++ b/libs/libvtrutil/src/vtr_color_map.h @@ -1,5 +1,5 @@ -#ifndef VTR_CMAP_H -#define VTR_CMAP_H +#pragma once + #include namespace vtr { @@ -55,4 +55,3 @@ class ViridisColorMap : public ColorMap { }; } // namespace vtr -#endif diff --git a/libs/libvtrutil/src/vtr_digest.h b/libs/libvtrutil/src/vtr_digest.h index 4d67f8f6acd..75130bcb99e 100644 --- a/libs/libvtrutil/src/vtr_digest.h +++ b/libs/libvtrutil/src/vtr_digest.h @@ -1,5 +1,5 @@ -#ifndef VTR_DIGEST_H -#define VTR_DIGEST_H +#pragma once + #include #include @@ -12,5 +12,3 @@ std::string secure_digest_file(const std::string& filepath); std::string secure_digest_stream(std::istream& is); } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_dynamic_bitset.h b/libs/libvtrutil/src/vtr_dynamic_bitset.h index 87a038f40bc..e2f892d1a52 100644 --- a/libs/libvtrutil/src/vtr_dynamic_bitset.h +++ b/libs/libvtrutil/src/vtr_dynamic_bitset.h @@ -1,5 +1,4 @@ -#ifndef VTR_DYNAMIC_BITSET -#define VTR_DYNAMIC_BITSET +#pragma once #include #include @@ -106,5 +105,3 @@ class dynamic_bitset { }; } // namespace vtr - -#endif /* VTR_DYNAMIC_BITSET */ diff --git a/libs/libvtrutil/src/vtr_error.h b/libs/libvtrutil/src/vtr_error.h index f13d46bcdb7..9fd4015d3f7 100644 --- a/libs/libvtrutil/src/vtr_error.h +++ b/libs/libvtrutil/src/vtr_error.h @@ -1,5 +1,4 @@ -#ifndef VTR_ERROR_H -#define VTR_ERROR_H +#pragma once #include #include @@ -65,5 +64,3 @@ class VtrError : public std::runtime_error { }; } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_expr_eval.cpp b/libs/libvtrutil/src/vtr_expr_eval.cpp index 791319f4367..e3716865455 100644 --- a/libs/libvtrutil/src/vtr_expr_eval.cpp +++ b/libs/libvtrutil/src/vtr_expr_eval.cpp @@ -5,7 +5,6 @@ #include #include -#include /** global variables **/ diff --git a/libs/libvtrutil/src/vtr_expr_eval.h b/libs/libvtrutil/src/vtr_expr_eval.h index 3c528cccd37..326af017bd5 100644 --- a/libs/libvtrutil/src/vtr_expr_eval.h +++ b/libs/libvtrutil/src/vtr_expr_eval.h @@ -1,11 +1,9 @@ -#ifndef EXPR_EVAL_H -#define EXPR_EVAL_H -#include +#pragma once + #include #include #include #include -#include #include "vtr_util.h" #include "vtr_error.h" @@ -230,5 +228,3 @@ class FormulaParser { }; } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_flat_map.h b/libs/libvtrutil/src/vtr_flat_map.h index bc857159bdb..251171da7bb 100644 --- a/libs/libvtrutil/src/vtr_flat_map.h +++ b/libs/libvtrutil/src/vtr_flat_map.h @@ -1,5 +1,5 @@ -#ifndef VTR_FLAT_MAP -#define VTR_FLAT_MAP +#pragma once + #include #include #include @@ -480,4 +480,3 @@ class flat_map::value_compare { }; } // namespace vtr -#endif diff --git a/libs/libvtrutil/src/vtr_geometry.h b/libs/libvtrutil/src/vtr_geometry.h index 3c45a7a8379..edac3289b6a 100644 --- a/libs/libvtrutil/src/vtr_geometry.h +++ b/libs/libvtrutil/src/vtr_geometry.h @@ -1,13 +1,11 @@ -#ifndef VTR_GEOMETRY_H -#define VTR_GEOMETRY_H +#pragma once + #include "vtr_range.h" -#include "vtr_assert.h" #include // vtr_geometry.tpp uses printf() #include #include -#include #include /** @@ -336,4 +334,3 @@ class RectUnion { } // namespace vtr #include "vtr_geometry.tpp" -#endif diff --git a/libs/libvtrutil/src/vtr_geometry.tpp b/libs/libvtrutil/src/vtr_geometry.tpp index 6d421a856db..ae7ec59a244 100644 --- a/libs/libvtrutil/src/vtr_geometry.tpp +++ b/libs/libvtrutil/src/vtr_geometry.tpp @@ -1,3 +1,5 @@ +#include "vtr_assert.h" + namespace vtr { /* * Point diff --git a/libs/libvtrutil/src/vtr_hash.h b/libs/libvtrutil/src/vtr_hash.h index 7e8e6fa42d7..701edc6e22f 100644 --- a/libs/libvtrutil/src/vtr_hash.h +++ b/libs/libvtrutil/src/vtr_hash.h @@ -1,5 +1,5 @@ -#ifndef VTR_HASH_H -#define VTR_HASH_H +#pragma once + #include namespace vtr { @@ -26,5 +26,3 @@ struct hash_pair { }; } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_linear_map.h b/libs/libvtrutil/src/vtr_linear_map.h index c0ef38cfca2..ab0d533dc47 100644 --- a/libs/libvtrutil/src/vtr_linear_map.h +++ b/libs/libvtrutil/src/vtr_linear_map.h @@ -1,5 +1,5 @@ -#ifndef VTR_LINEAR_MAP_H -#define VTR_LINEAR_MAP_H +#pragma once + #include #include @@ -309,4 +309,3 @@ class linear_map { }; } // namespace vtr -#endif diff --git a/libs/libvtrutil/src/vtr_list.h b/libs/libvtrutil/src/vtr_list.h index 8403742c70e..656cb8e5024 100644 --- a/libs/libvtrutil/src/vtr_list.h +++ b/libs/libvtrutil/src/vtr_list.h @@ -1,5 +1,4 @@ -#ifndef VTR_LIST_H -#define VTR_LIST_H +#pragma once /** * @file @@ -21,4 +20,3 @@ t_linked_vptr* insert_in_vptr_list(t_linked_vptr* head, ///@brief Delete a list t_linked_vptr* delete_in_vptr_list(t_linked_vptr* head); } // namespace vtr -#endif diff --git a/libs/libvtrutil/src/vtr_log.h b/libs/libvtrutil/src/vtr_log.h index d9b340d1214..279f0940279 100644 --- a/libs/libvtrutil/src/vtr_log.h +++ b/libs/libvtrutil/src/vtr_log.h @@ -1,9 +1,4 @@ -#ifndef VTR_LOG_H -#define VTR_LOG_H -#include -#include -#include - +#pragma once /** * @file * @brief This header defines useful logging macros for VTR projects. @@ -57,6 +52,9 @@ * is defined (disabled by default). */ +#include +#include + // Unconditional logging macros #define VTR_LOG(...) VTR_LOGV(true, __VA_ARGS__) #define VTR_LOG_WARN(...) VTR_LOGV_WARN(true, __VA_ARGS__) @@ -165,5 +163,3 @@ void set_noisy_warn_log_file(std::string log_file_name); * noisy_warn_log_file, otherwise it is printed on stdout (or the regular log file) */ void print_or_suppress_warning(const char* pszFileName, unsigned int lineNum, const char* pszFuncName, const char* pszMessage, ...); - -#endif diff --git a/libs/libvtrutil/src/vtr_logic.h b/libs/libvtrutil/src/vtr_logic.h index 896d78fe842..0796f81ea5a 100644 --- a/libs/libvtrutil/src/vtr_logic.h +++ b/libs/libvtrutil/src/vtr_logic.h @@ -1,7 +1,6 @@ +#pragma once // Put this above guard so that TRUE/FALSE are undef'ed // even if this file was already included earlier. -#ifndef VTR_LOGIC_H -#define VTR_LOGIC_H #ifdef FALSE #undef FALSE @@ -29,5 +28,3 @@ enum class LogicValue { }; } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_map_util.h b/libs/libvtrutil/src/vtr_map_util.h index fd1cdd4f88e..eb1460b00c7 100644 --- a/libs/libvtrutil/src/vtr_map_util.h +++ b/libs/libvtrutil/src/vtr_map_util.h @@ -1,5 +1,4 @@ -#ifndef VTR_MAP_UTIL_H -#define VTR_MAP_UTIL_H +#pragma once #include "vtr_pair_util.h" #include "vtr_range.h" @@ -41,5 +40,3 @@ auto make_value_range(const Container& c) { } } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_math.h b/libs/libvtrutil/src/vtr_math.h index 74b4ccebf58..c5124ba2349 100644 --- a/libs/libvtrutil/src/vtr_math.h +++ b/libs/libvtrutil/src/vtr_math.h @@ -1,12 +1,9 @@ -#ifndef VTR_MATH_H -#define VTR_MATH_H +#pragma once #include #include #include -#include "vtr_assert.h" - /** * @file * @@ -164,5 +161,3 @@ bool isclose(T a, T b) { } } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_memory.cpp b/libs/libvtrutil/src/vtr_memory.cpp index 4bea9f1c652..436cc2c84bb 100644 --- a/libs/libvtrutil/src/vtr_memory.cpp +++ b/libs/libvtrutil/src/vtr_memory.cpp @@ -7,7 +7,6 @@ #include "vtr_memory.h" #include "vtr_error.h" #include "vtr_util.h" -#include "vtr_log.h" #ifndef __GLIBC__ #include diff --git a/libs/libvtrutil/src/vtr_memory.h b/libs/libvtrutil/src/vtr_memory.h index 4c9877ec2cc..a4a138617e2 100644 --- a/libs/libvtrutil/src/vtr_memory.h +++ b/libs/libvtrutil/src/vtr_memory.h @@ -1,5 +1,5 @@ -#ifndef VTR_MEMORY_H -#define VTR_MEMORY_H +#pragma once + #include #include #include @@ -147,5 +147,3 @@ bool operator==(const aligned_allocator&, const aligned_allocator&) { } } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_ndmatrix.h b/libs/libvtrutil/src/vtr_ndmatrix.h index a9a41ff41b4..45493c7e32f 100644 --- a/libs/libvtrutil/src/vtr_ndmatrix.h +++ b/libs/libvtrutil/src/vtr_ndmatrix.h @@ -1,5 +1,5 @@ -#ifndef VTR_ND_MATRIX_H -#define VTR_ND_MATRIX_H +#pragma once + #include #include #include @@ -437,4 +437,3 @@ template using Matrix = NdMatrix; } // namespace vtr -#endif diff --git a/libs/libvtrutil/src/vtr_ndoffsetmatrix.h b/libs/libvtrutil/src/vtr_ndoffsetmatrix.h index 0e1001239bc..3272d1abe1d 100644 --- a/libs/libvtrutil/src/vtr_ndoffsetmatrix.h +++ b/libs/libvtrutil/src/vtr_ndoffsetmatrix.h @@ -1,5 +1,5 @@ -#ifndef VTR_ND_OFFSET_MATRIX_H -#define VTR_ND_OFFSET_MATRIX_H +#pragma once + #include #include #include @@ -458,4 +458,3 @@ template using OffsetMatrix = NdOffsetMatrix; } // namespace vtr -#endif diff --git a/libs/libvtrutil/src/vtr_optional.h b/libs/libvtrutil/src/vtr_optional.h index 8aea3c0e2c2..aa832a932d7 100644 --- a/libs/libvtrutil/src/vtr_optional.h +++ b/libs/libvtrutil/src/vtr_optional.h @@ -1,5 +1,4 @@ #pragma once - /** * @file * @brief std::optional-like interface with optional references. diff --git a/libs/libvtrutil/src/vtr_ostream_guard.h b/libs/libvtrutil/src/vtr_ostream_guard.h index 199c5cb4cc5..d2ab07e81b4 100644 --- a/libs/libvtrutil/src/vtr_ostream_guard.h +++ b/libs/libvtrutil/src/vtr_ostream_guard.h @@ -1,5 +1,6 @@ -#ifndef VTR_OSTREAM_GUARD_H -#define VTR_OSTREAM_GUARD_H +#pragma once + +#include namespace vtr { @@ -36,5 +37,3 @@ class OsFormatGuard { }; } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_pair_util.h b/libs/libvtrutil/src/vtr_pair_util.h index cddb4162543..be5dd4b9282 100644 --- a/libs/libvtrutil/src/vtr_pair_util.h +++ b/libs/libvtrutil/src/vtr_pair_util.h @@ -1,7 +1,6 @@ -#ifndef VTR_PAIR_UTIL_H -#define VTR_PAIR_UTIL_H +#pragma once -#include "vtr_range.h" +#include namespace vtr { /** @@ -93,4 +92,3 @@ class pair_second_iter { }; } // namespace vtr -#endif diff --git a/libs/libvtrutil/src/vtr_path.h b/libs/libvtrutil/src/vtr_path.h index a48d2bdb59c..eb1948903c8 100644 --- a/libs/libvtrutil/src/vtr_path.h +++ b/libs/libvtrutil/src/vtr_path.h @@ -1,5 +1,5 @@ -#ifndef VTR_PATH_H -#define VTR_PATH_H +#pragma once + #include #include @@ -30,4 +30,3 @@ std::string dirname(const std::string& path); std::string getcwd(); } // namespace vtr -#endif diff --git a/libs/libvtrutil/src/vtr_prefix_sum.h b/libs/libvtrutil/src/vtr_prefix_sum.h index 31635904f1b..a5817f848fc 100644 --- a/libs/libvtrutil/src/vtr_prefix_sum.h +++ b/libs/libvtrutil/src/vtr_prefix_sum.h @@ -1,3 +1,4 @@ +#pragma once /** * @file * @author Alex Singer @@ -6,8 +7,6 @@ * sums over regions of an unchanging grid of values. */ -#pragma once - #include #include #include "vtr_assert.h" diff --git a/libs/libvtrutil/src/vtr_ragged_matrix.h b/libs/libvtrutil/src/vtr_ragged_matrix.h index 862047e0b1e..de51eee9114 100644 --- a/libs/libvtrutil/src/vtr_ragged_matrix.h +++ b/libs/libvtrutil/src/vtr_ragged_matrix.h @@ -1,5 +1,5 @@ -#ifndef VTR_RAGGED_MATRIX_H -#define VTR_RAGGED_MATRIX_H +#pragma once + #include #include #include @@ -258,5 +258,3 @@ class FlatRaggedMatrix { }; } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_random.h b/libs/libvtrutil/src/vtr_random.h index 15614b7141e..ec82d1cf41f 100644 --- a/libs/libvtrutil/src/vtr_random.h +++ b/libs/libvtrutil/src/vtr_random.h @@ -1,5 +1,4 @@ -#ifndef VTR_RANDOM_H -#define VTR_RANDOM_H +#pragma once #include //For std::swap #include @@ -94,4 +93,3 @@ void shuffle(Iter first, Iter last, RngContainer& rng) { } } // namespace vtr -#endif diff --git a/libs/libvtrutil/src/vtr_range.h b/libs/libvtrutil/src/vtr_range.h index 9674f5e45c0..2692a5715bc 100644 --- a/libs/libvtrutil/src/vtr_range.h +++ b/libs/libvtrutil/src/vtr_range.h @@ -1,5 +1,5 @@ -#ifndef VTR_RANGE_H -#define VTR_RANGE_H +#pragma once + #include namespace vtr { @@ -81,5 +81,3 @@ template inline auto make_range(const Container& c) { return make_range(std::begin(c), std::end(c)); } } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_rusage.h b/libs/libvtrutil/src/vtr_rusage.h index b69dc438a97..5b2c5f60be4 100644 --- a/libs/libvtrutil/src/vtr_rusage.h +++ b/libs/libvtrutil/src/vtr_rusage.h @@ -1,5 +1,5 @@ -#ifndef VTR_RUSAGE_H -#define VTR_RUSAGE_H +#pragma once + #include namespace vtr { @@ -7,5 +7,3 @@ namespace vtr { ///@brief Returns the maximum resident set size in bytes, or zero if unable to determine. size_t get_max_rss(); } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_sentinels.h b/libs/libvtrutil/src/vtr_sentinels.h index 036fd593b17..ff48f897100 100644 --- a/libs/libvtrutil/src/vtr_sentinels.h +++ b/libs/libvtrutil/src/vtr_sentinels.h @@ -1,5 +1,4 @@ -#ifndef VTR_SENTINELS_H -#define VTR_SENTINELS_H +#pragma once /** * @file @@ -46,4 +45,3 @@ template using MinusOneSentinel = CustomSentinel; } // namespace vtr -#endif diff --git a/libs/libvtrutil/src/vtr_small_vector.h b/libs/libvtrutil/src/vtr_small_vector.h index 5fe75520129..5aa1c89f781 100644 --- a/libs/libvtrutil/src/vtr_small_vector.h +++ b/libs/libvtrutil/src/vtr_small_vector.h @@ -1,5 +1,5 @@ -#ifndef VTR_SMALL_VECTOR -#define VTR_SMALL_VECTOR +#pragma once + #include #include #include @@ -850,5 +850,3 @@ class small_vector { }; } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_string_interning.h b/libs/libvtrutil/src/vtr_string_interning.h index 65b611e6015..c845aded20c 100644 --- a/libs/libvtrutil/src/vtr_string_interning.h +++ b/libs/libvtrutil/src/vtr_string_interning.h @@ -1,5 +1,4 @@ -#ifndef VTR_STRING_INTERNING_H_ -#define VTR_STRING_INTERNING_H_ +#pragma once /** * @file @@ -44,7 +43,6 @@ */ #include #include -#include #include #include #include @@ -555,5 +553,3 @@ struct hash { } }; } // namespace std - -#endif /* VTR_STRING_INTERNING_H_ */ diff --git a/libs/libvtrutil/src/vtr_string_view.h b/libs/libvtrutil/src/vtr_string_view.h index 12a7a7a446c..cc76c40d851 100644 --- a/libs/libvtrutil/src/vtr_string_view.h +++ b/libs/libvtrutil/src/vtr_string_view.h @@ -1,9 +1,7 @@ -#ifndef VTR_STRING_VIEW_H_ -#define VTR_STRING_VIEW_H_ +#pragma once #include #include -#include #include #include "vtr_hash.h" @@ -188,5 +186,3 @@ struct hash { } }; } // namespace std - -#endif /* VTR_STRING_VIEW_H_ */ diff --git a/libs/libvtrutil/src/vtr_strong_id.h b/libs/libvtrutil/src/vtr_strong_id.h index 672dbae1e7e..48970bfaa10 100644 --- a/libs/libvtrutil/src/vtr_strong_id.h +++ b/libs/libvtrutil/src/vtr_strong_id.h @@ -1,5 +1,4 @@ -#ifndef VTR_STRONG_ID_H -#define VTR_STRONG_ID_H +#pragma once /** * @file * @brief This header provides the StrongId class. @@ -262,5 +261,3 @@ struct hash> { } }; } //namespace std - -#endif diff --git a/libs/libvtrutil/src/vtr_strong_id_range.h b/libs/libvtrutil/src/vtr_strong_id_range.h index 6728f13a174..c4cb036ddf4 100644 --- a/libs/libvtrutil/src/vtr_strong_id_range.h +++ b/libs/libvtrutil/src/vtr_strong_id_range.h @@ -1,7 +1,6 @@ -#ifndef _VTR_STRONG_ID_RANGE_H -#define _VTR_STRONG_ID_RANGE_H +#pragma once -#include +#include #include "vtr_assert.h" namespace vtr { @@ -187,5 +186,3 @@ class StrongIdRange { }; } //namespace vtr - -#endif /* _VTR_STRONG_ID_RANGE_H */ diff --git a/libs/libvtrutil/src/vtr_time.h b/libs/libvtrutil/src/vtr_time.h index 3f187e59288..9d837d8cdf4 100644 --- a/libs/libvtrutil/src/vtr_time.h +++ b/libs/libvtrutil/src/vtr_time.h @@ -1,5 +1,5 @@ -#ifndef VTR_TIME_H -#define VTR_TIME_H +#pragma once + #include #include @@ -95,5 +95,3 @@ class ScopedStartFinishTimer : public ScopedActionTimer { ~ScopedStartFinishTimer(); }; } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_token.cpp b/libs/libvtrutil/src/vtr_token.cpp index 1715e9f2381..9deb1c97af7 100644 --- a/libs/libvtrutil/src/vtr_token.cpp +++ b/libs/libvtrutil/src/vtr_token.cpp @@ -7,7 +7,6 @@ #include #include "vtr_assert.h" -#include "vtr_log.h" #include "vtr_util.h" #include "vtr_memory.h" #include "vtr_token.h" diff --git a/libs/libvtrutil/src/vtr_token.h b/libs/libvtrutil/src/vtr_token.h index 9556d6614ad..6084dff9621 100644 --- a/libs/libvtrutil/src/vtr_token.h +++ b/libs/libvtrutil/src/vtr_token.h @@ -1,3 +1,4 @@ +#pragma once /** * @file * @author Jason Luu @@ -5,9 +6,6 @@ * @brief Tokenizer */ -#ifndef TOKEN_H -#define TOKEN_H - ///@brief Token types enum e_token_type { TOKEN_NULL, @@ -36,5 +34,3 @@ bool checkTokenType(const t_token token, enum e_token_type token_type); void my_atof_2D(float** matrix, const int max_i, const int max_j, const char* instring); bool check_my_atof_2D(const int max_i, const int max_j, const char* instring, int* num_entries); - -#endif diff --git a/libs/libvtrutil/src/vtr_util.h b/libs/libvtrutil/src/vtr_util.h index 8463a3a6ea4..b9a08393c82 100644 --- a/libs/libvtrutil/src/vtr_util.h +++ b/libs/libvtrutil/src/vtr_util.h @@ -1,5 +1,4 @@ -#ifndef VTR_UTIL_H -#define VTR_UTIL_H +#pragma once #include #include @@ -150,5 +149,3 @@ bool exactly_k_conditions(int k, Conditions... conditions) { int get_pid(); } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_vec_id_set.h b/libs/libvtrutil/src/vtr_vec_id_set.h index 10dc10e0f0a..1b54172a86d 100644 --- a/libs/libvtrutil/src/vtr_vec_id_set.h +++ b/libs/libvtrutil/src/vtr_vec_id_set.h @@ -1,5 +1,4 @@ -#ifndef VTR_SET_H -#define VTR_SET_H +#pragma once #include #include @@ -103,5 +102,3 @@ class vec_id_set { }; } // namespace vtr - -#endif diff --git a/libs/libvtrutil/src/vtr_vector_map.h b/libs/libvtrutil/src/vtr_vector_map.h index 68200ad390e..337773ba12a 100644 --- a/libs/libvtrutil/src/vtr_vector_map.h +++ b/libs/libvtrutil/src/vtr_vector_map.h @@ -1,5 +1,5 @@ -#ifndef VTR_VECTOR_MAP -#define VTR_VECTOR_MAP +#pragma once + #include #include #include @@ -171,4 +171,3 @@ class vector_map { }; } // namespace vtr -#endif diff --git a/libs/libvtrutil/src/vtr_version.h b/libs/libvtrutil/src/vtr_version.h index f9bfaac14ea..c8a24bf33d6 100644 --- a/libs/libvtrutil/src/vtr_version.h +++ b/libs/libvtrutil/src/vtr_version.h @@ -1,5 +1,5 @@ -#ifndef VTR_VERSION_H -#define VTR_VERSION_H +#pragma once + #include namespace vtr { @@ -16,5 +16,3 @@ extern const char* COMPILER; extern const char* BUILD_TIMESTAMP; extern const char* BUILD_INFO; } // namespace vtr - -#endif diff --git a/utils/fasm/src/parameters.cpp b/utils/fasm/src/parameters.cpp index 70fb3f6cab8..7877568c7d4 100644 --- a/utils/fasm/src/parameters.cpp +++ b/utils/fasm/src/parameters.cpp @@ -1,4 +1,5 @@ #include "parameters.h" +#include #include "vtr_assert.h" namespace fasm { diff --git a/vpr/src/pack/pb_type_graph_annotations.cpp b/vpr/src/pack/pb_type_graph_annotations.cpp index e0988af7143..6ce0878e569 100644 --- a/vpr/src/pack/pb_type_graph_annotations.cpp +++ b/vpr/src/pack/pb_type_graph_annotations.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include "arch_util.h" #include "vtr_assert.h" diff --git a/vpr/src/pack/sync_netlists_to_routing_flat.cpp b/vpr/src/pack/sync_netlists_to_routing_flat.cpp index 1e1a6830492..e1da710d40b 100644 --- a/vpr/src/pack/sync_netlists_to_routing_flat.cpp +++ b/vpr/src/pack/sync_netlists_to_routing_flat.cpp @@ -16,6 +16,7 @@ #include "vpr_utils.h" #include "sync_netlists_to_routing_flat.h" +#include /* Static function decls (file-scope) */