Clang Project

clang_source_code/unittests/AST/Language.cpp
1//===------ unittest/AST/Language.cpp - AST unit test support -------------===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
9//  This file defines language options for AST unittests.
10//
11//===----------------------------------------------------------------------===//
12
13#include "Language.h"
14
15namespace clang {
16namespace ast_matchers {
17
18ArgVector getBasicRunOptionsForLanguage(Language Lang) {
19  ArgVector BasicArgs;
20  // Test with basic arguments.
21  switch (Lang) {
22  case Lang_C:
23    BasicArgs = {"-x""c""-std=c99"};
24    break;
25  case Lang_C89:
26    BasicArgs = {"-x""c""-std=c89"};
27    break;
28  case Lang_CXX:
29    BasicArgs = {"-std=c++98""-frtti"};
30    break;
31  case Lang_CXX11:
32    BasicArgs = {"-std=c++11""-frtti"};
33    break;
34  case Lang_CXX14:
35    BasicArgs = {"-std=c++14""-frtti"};
36    break;
37  case Lang_OpenCL:
38  case Lang_OBJCXX:
39    llvm_unreachable("Not implemented yet!");
40  }
41  return BasicArgs;
42}
43
44// end namespace ast_matchers
45// end namespace clang
46