| 1 |
//===------------------------- NameMangleAPI.h ---------------------------===// |
| 2 |
// |
| 3 |
// SPIR Tools |
| 4 |
// |
| 5 |
// This file is distributed under the University of Illinois Open Source |
| 6 |
// License. See LICENSE.TXT for details. |
| 7 |
// |
| 8 |
//===---------------------------------------------------------------------===// |
| 9 |
/* |
| 10 |
* Contributed by: Intel Corporation. |
| 11 |
*/ |
| 12 |
#ifndef SPIRV_MANGLER_NAMEMANGLEAPI_H |
| 13 |
#define SPIRV_MANGLER_NAMEMANGLEAPI_H |
| 14 |
|
| 15 |
#include "FunctionDescriptor.h" |
| 16 |
#include <string> |
| 17 |
|
| 18 |
namespace SPIR { |
| 19 |
struct NameMangler { |
| 20 |
|
| 21 |
/// @brief Constructor. |
| 22 |
/// @param SPIRversion spir version to mangle according to. |
| 23 |
NameMangler(SPIRversion); |
| 24 |
|
| 25 |
/// @brief Converts the given function descriptor to string that represents |
| 26 |
/// the function's prototype. |
| 27 |
/// The mangling algorithm is based on Itanium mangling algorithm |
| 28 |
/// (http://sourcery.mentor.com/public/cxx-abi/abi.html#mangling), with |
| 29 |
/// SPIR extensions. |
| 30 |
/// @param FunctionDescriptor function to be mangled. |
| 31 |
/// @param std::string the mangled name if the mangling succeeds, |
| 32 |
/// the error otherwise. |
| 33 |
/// @return MangleError enum representing the status - success or the error. |
| 34 |
MangleError mangle(const FunctionDescriptor &, std::string &); |
| 35 |
|
| 36 |
private: |
| 37 |
SPIRversion SpirVersion; |
| 38 |
}; |
| 39 |
} // namespace SPIR |
| 40 |
|
| 41 |
#endif // SPIRV_MANGLER_NAMEMANGLEAPI_H |