1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONDEPARCH_H
10 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONDEPARCH_H
12 #include "llvm/ADT/StringSwitch.h"
35 inline std::optional
<Hexagon::ArchEnum
> getCpu(StringRef CPU
) {
36 return StringSwitch
<std::optional
<Hexagon::ArchEnum
>>(CPU
)
37 .Case("generic", Hexagon::ArchEnum::V5
)
38 .Case("hexagonv5", Hexagon::ArchEnum::V5
)
39 .Case("hexagonv55", Hexagon::ArchEnum::V55
)
40 .Case("hexagonv60", Hexagon::ArchEnum::V60
)
41 .Case("hexagonv62", Hexagon::ArchEnum::V62
)
42 .Case("hexagonv65", Hexagon::ArchEnum::V65
)
43 .Case("hexagonv66", Hexagon::ArchEnum::V66
)
44 .Case("hexagonv67", Hexagon::ArchEnum::V67
)
45 .Case("hexagonv67t", Hexagon::ArchEnum::V67
)
46 .Case("hexagonv68", Hexagon::ArchEnum::V68
)
47 .Case("hexagonv69", Hexagon::ArchEnum::V69
)
48 .Case("hexagonv71", Hexagon::ArchEnum::V71
)
49 .Case("hexagonv71t", Hexagon::ArchEnum::V71
)
50 .Case("hexagonv73", Hexagon::ArchEnum::V73
)
51 .Case("hexagonv75", Hexagon::ArchEnum::V75
)
52 .Case("hexagonv79", Hexagon::ArchEnum::V79
)
53 .Default(std::nullopt
);
55 } // namespace Hexagon
58 #endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONDEPARCH_H