summaryrefslogtreecommitdiffstats
path: root/include/bcinfo/MetadataExtractor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/bcinfo/MetadataExtractor.h')
-rw-r--r--include/bcinfo/MetadataExtractor.h38
1 files changed, 11 insertions, 27 deletions
diff --git a/include/bcinfo/MetadataExtractor.h b/include/bcinfo/MetadataExtractor.h
index 71a6de0..95fc27b 100644
--- a/include/bcinfo/MetadataExtractor.h
+++ b/include/bcinfo/MetadataExtractor.h
@@ -49,8 +49,8 @@ enum MetadataSignatureBitval {
class MetadataExtractor {
public:
- struct ReduceNew {
- // These strings are owned by the ReduceNew instance, and deleted upon its destruction.
+ struct Reduce {
+ // These strings are owned by the Reduce instance, and deleted upon its destruction.
// They are assumed to have been allocated by "new []" and hence are deleted by "delete []".
const char *mReduceName;
const char *mInitializerName;
@@ -63,13 +63,13 @@ class MetadataExtractor {
uint32_t mInputCount; // of accumulator function (and of kernel itself)
uint32_t mAccumulatorDataSize; // in bytes
- ReduceNew() :
+ Reduce() :
mReduceName(nullptr),
mInitializerName(nullptr), mAccumulatorName(nullptr), mCombinerName(nullptr),
mOutConverterName(nullptr), mHalterName(nullptr),
mSignature(0), mInputCount(0), mAccumulatorDataSize(0) {
}
- ~ReduceNew() {
+ ~Reduce() {
delete [] mReduceName;
delete [] mInitializerName;
delete [] mAccumulatorName;
@@ -78,8 +78,8 @@ class MetadataExtractor {
delete [] mHalterName;
}
- ReduceNew(const ReduceNew &) = delete;
- void operator=(const ReduceNew &) = delete;
+ Reduce(const Reduce &) = delete;
+ void operator=(const Reduce &) = delete;
};
private:
@@ -91,14 +91,12 @@ class MetadataExtractor {
size_t mExportFuncCount;
size_t mExportForEachSignatureCount;
size_t mExportReduceCount;
- size_t mExportReduceNewCount;
const char **mExportVarNameList;
const char **mExportFuncNameList;
const char **mExportForEachNameList;
const uint32_t *mExportForEachSignatureList;
const uint32_t *mExportForEachInputCountList;
- const char **mExportReduceNameList;
- const ReduceNew *mExportReduceNewList;
+ const Reduce *mExportReduceList;
size_t mPragmaCount;
const char **mPragmaKeyList;
@@ -123,7 +121,7 @@ class MetadataExtractor {
// Helper functions for extraction
bool populateForEachMetadata(const llvm::NamedMDNode *Names,
const llvm::NamedMDNode *Signatures);
- bool populateReduceNewMetadata(const llvm::NamedMDNode *ReduceNewMetadata);
+ bool populateReduceMetadata(const llvm::NamedMDNode *ReduceMetadata);
bool populateObjectSlotMetadata(const llvm::NamedMDNode *ObjectSlotMetadata);
void populatePragmaMetadata(const llvm::NamedMDNode *PragmaMetadata);
void readThreadableFlag(const llvm::NamedMDNode *ThreadableMetadata);
@@ -224,31 +222,17 @@ class MetadataExtractor {
}
/**
- * \return number of exported simple reduce kernels (slots) in this script/module.
+ * \return number of exported general reduce kernels (slots) in this script/module.
*/
size_t getExportReduceCount() const {
return mExportReduceCount;
}
/**
- * \return array of exported simple reduce kernel names.
- */
- const char **getExportReduceNameList() const {
- return mExportReduceNameList;
- }
-
- /**
- * \return number of exported general reduce kernels (slots) in this script/module.
- */
- size_t getExportReduceNewCount() const {
- return mExportReduceNewCount;
- }
-
- /**
* \return array of exported general reduce kernel descriptions.
*/
- const ReduceNew *getExportReduceNewList() const {
- return mExportReduceNewList;
+ const Reduce *getExportReduceList() const {
+ return mExportReduceList;
}
/**