зеркало из https://github.com/microsoft/clang-1.git
Driver: Add types::{isAcceptedByClang,isCXX} predicates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66986 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
789e220d48
Коммит
4db938ceb7
|
@ -56,6 +56,12 @@ namespace types {
|
|||
/// types).
|
||||
bool canLipoType(ID Id);
|
||||
|
||||
/// isAcceptedByClang - Can clang handle this input type.
|
||||
bool isAcceptedByClang(ID Id);
|
||||
|
||||
/// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
|
||||
bool isCXX(ID Id);
|
||||
|
||||
/// lookupTypeForExtension - Lookup the type to use for the file
|
||||
/// extension \arg Ext.
|
||||
ID lookupTypeForExtension(const char *Ext);
|
||||
|
|
|
@ -69,6 +69,37 @@ bool types::canLipoType(ID Id) {
|
|||
Id == TY_Object);
|
||||
}
|
||||
|
||||
bool types::isAcceptedByClang(ID Id) {
|
||||
switch (Id) {
|
||||
default:
|
||||
return false;
|
||||
|
||||
case TY_Asm:
|
||||
case TY_C: case TY_PP_C:
|
||||
case TY_ObjC: case TY_PP_ObjC:
|
||||
case TY_CXX: case TY_PP_CXX:
|
||||
case TY_ObjCXX: case TY_PP_ObjCXX:
|
||||
case TY_CHeader: case TY_PP_CHeader:
|
||||
case TY_ObjCHeader: case TY_PP_ObjCHeader:
|
||||
case TY_CXXHeader: case TY_PP_CXXHeader:
|
||||
case TY_ObjCXXHeader: case TY_PP_ObjCXXHeader:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool types::isCXX(ID Id) {
|
||||
switch (Id) {
|
||||
default:
|
||||
return false;
|
||||
|
||||
case TY_CXX: case TY_PP_CXX:
|
||||
case TY_ObjCXX: case TY_PP_ObjCXX:
|
||||
case TY_CXXHeader: case TY_PP_CXXHeader:
|
||||
case TY_ObjCXXHeader: case TY_PP_ObjCXXHeader:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
types::ID types::lookupTypeForExtension(const char *Ext) {
|
||||
unsigned N = strlen(Ext);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче