10#include "llvm/MC/TargetRegistry.h"
11#include "llvm/Support/ErrorHandling.h"
15 std::vector<TestLanguage>
Result{};
17#define TESTLANGUAGE_C(lang, version, std_flag, version_index) \
18 if (version >= MinimumStd) \
19 Result.push_back(Lang_##lang##version);
20#include "clang/Testing/TestLanguage.def"
25 std::vector<TestLanguage>
Result{};
27#define TESTLANGUAGE_CXX(lang, version, std_flag, version_index) \
28 if (version >= MinimumStd) \
29 Result.push_back(Lang_##lang##version);
30#include "clang/Testing/TestLanguage.def"
38#define TESTLANGUAGE_C(lang, version, std_flag, version_index) \
39 case Lang_##lang##version: \
40 return { "-x", "c", "-std=" #std_flag };
41#define TESTLANGUAGE_CXX(lang, version, std_flag, version_index) \
42 case Lang_##lang##version: \
43 return { "-std=" #std_flag, "-frtti" };
44#include "clang/Testing/TestLanguage.def"
47 return {
"-x",
"objective-c",
"-frtti",
"-fobjc-nonfragile-abi"};
49 return {
"-x",
"objective-c++",
"-frtti"};
51 llvm_unreachable(
"Unhandled TestLanguage enum");
53 llvm_unreachable(
"Unhandled TestLanguage enum");
58#define TESTLANGUAGE_C(lang, version, std_flag, version_index) \
59 case Lang_##lang##version: \
60 return { "-xc", "-std=" #std_flag };
61#define TESTLANGUAGE_CXX(lang, version, std_flag, version_index) \
62 case Lang_##lang##version: \
63 return { "-std=" #std_flag };
64#include "clang/Testing/TestLanguage.def"
67 return {
"-xobjective-c"};
70 return {
"-xobjective-c++"};
73 llvm_unreachable(
"Unhandled TestLanguage enum");
75 llvm_unreachable(
"Unhandled TestLanguage enum");
80#define TESTLANGUAGE_C(lang, version, std_flag, version_index) \
81 case Lang_##lang##version: \
83#define TESTLANGUAGE_CXX(lang, version, std_flag, version_index) \
84 case Lang_##lang##version: \
86#include "clang/Testing/TestLanguage.def"
97 llvm_unreachable(
"Unhandled TestLanguage enum");
101 for (
const auto &
Target : llvm::TargetRegistry::targets()) {
103 StringRef TargetName(
Target.getName());
104 if (TargetName ==
"x86-64")
105 TargetName =
"x86_64";
106 if (llvm::TargetRegistry::lookupTarget(std::string(TargetName), Error) ==
108 return std::string(TargetName);
llvm::MachO::Target Target
The JSON file list parser is used to communicate input to InstallAPI.
std::string getAnyTargetForTesting()
Find a target name such that looking for it in TargetRegistry by that name returns the same target.
std::vector< std::string > getCC1ArgsForTesting(TestLanguage Lang)
std::vector< TestLanguage > getCOrLater(int MinimumStd)
std::vector< TestLanguage > getCXXOrLater(int MinimumStd)
@ Result
The result type of a method or function.
StringRef getFilenameForTesting(TestLanguage Lang)
std::vector< std::string > getCommandLineArgsForTesting(TestLanguage Lang)