b303ffe53e
The original implementation had the statistics system woken very tightly into things like PPCallbacks, with counters duplicated in two places, and all the output code duplicated. This made it very difficult to alter the structure of the program without breaking the statistics system. Since the planned approach for solving the remaining preprocessor bugs needs the introduction of a custom FrontendAction, and such a restructure was incompatible with the way the statistics system was set up, this rewrite was required. 'tis rather simpler now, mind you :D This commit also fixes an issue where some stats were counted twice, and allows `-print-stats` to operate independently of `-stat-output`, allowing you to print stats to a file without printing them to a terminal (or vice-versa).
29 righe
960 B
C++
29 righe
960 B
C++
#pragma once
|
|
|
|
#include "llvm/ADT/StringRef.h"
|
|
#include <set>
|
|
#include <map>
|
|
|
|
#include "Statistics.h"
|
|
|
|
#define HIP_UNSUPPORTED true
|
|
|
|
/// Maps cuda header names to hip header names.
|
|
extern const std::map<llvm::StringRef, hipCounter> CUDA_INCLUDE_MAP;
|
|
|
|
/// Maps the names of CUDA types to the corresponding hip types.
|
|
extern const std::map<llvm::StringRef, hipCounter> CUDA_TYPE_NAME_MAP;
|
|
|
|
/// Map all other CUDA identifiers (function/macro names, enum values) to hip versions.
|
|
extern const std::map<llvm::StringRef, hipCounter> CUDA_IDENTIFIER_MAP;
|
|
|
|
/**
|
|
* The union of all the above maps.
|
|
*
|
|
* This should be used rarely, but is still needed to convert macro definitions (which can
|
|
* contain any combination of the above things). AST walkers can usually get away with just
|
|
* looking in the lookup table for the type of element they are processing, however, saving
|
|
* a great deal of time.
|
|
*/
|
|
const std::map<llvm::StringRef, hipCounter>& CUDA_RENAMES_MAP();
|