MLLIF
a MLIR-based Language to Language Interoperability Flyover
Loading...
Searching...
No Matches
annotation.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 Yeong-won Seo
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <string>
20#include <vector>
21
22namespace clang {
23 class FunctionDecl;
24} // namespace clang
25
26namespace mllif::shared {
27 constexpr std::string Namespace = "$mllif";
28
29 namespace prefix {
30 constexpr std::string Path = "path";
31 constexpr std::string Type = "type";
32 } // namespace prefix
33
34 namespace type {
35 constexpr std::string Function = "function";
36 constexpr std::string Method = "method";
37 constexpr std::string Object = "object";
38 } // namespace type
39
40 struct Annotation {
41 std::string Key;
42 std::vector<std::string> Values;
43
44 Annotation(const std::string &annotation);
45 };
46
51 void CreateAnnotation(clang::FunctionDecl *decl);
52
53
54} // namespace mllif::shared
constexpr std::string Path
Definition annotation.h:30
constexpr std::string Type
Definition annotation.h:31
constexpr std::string Method
Definition annotation.h:36
constexpr std::string Function
Definition annotation.h:35
constexpr std::string Object
Definition annotation.h:37
void CreateAnnotation(clang::FunctionDecl *decl)
Annotate a declaration with its information that may be lost.
constexpr std::string Namespace
Definition annotation.h:27
std::vector< std::string > Values
Definition annotation.h:42
Annotation(const std::string &annotation)