clang: lib/Sema/SemaSystemZ.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

17#include "llvm/ADT/APSInt.h"

18#include

19

21

23

26 if (BuiltinID == SystemZ::BI__builtin_tabort) {

28 if (std::optionalllvm::APSInt AbortCode =

30 if (AbortCode->getSExtValue() >= 0 && AbortCode->getSExtValue() < 256)

31 return Diag(Arg->getBeginLoc(), diag::err_systemz_invalid_tabort_code)

33 }

34

35

36

37 unsigned i = 0, l = 0, u = 0;

38 switch (BuiltinID) {

39 default: return false;

40 case SystemZ::BI__builtin_s390_lcbb: i = 1; l = 0; u = 15; break;

41 case SystemZ::BI__builtin_s390_verimb:

42 case SystemZ::BI__builtin_s390_verimh:

43 case SystemZ::BI__builtin_s390_verimf:

44 case SystemZ::BI__builtin_s390_verimg: i = 3; l = 0; u = 255; break;

45 case SystemZ::BI__builtin_s390_vfaeb:

46 case SystemZ::BI__builtin_s390_vfaeh:

47 case SystemZ::BI__builtin_s390_vfaef:

48 case SystemZ::BI__builtin_s390_vfaebs:

49 case SystemZ::BI__builtin_s390_vfaehs:

50 case SystemZ::BI__builtin_s390_vfaefs:

51 case SystemZ::BI__builtin_s390_vfaezb:

52 case SystemZ::BI__builtin_s390_vfaezh:

53 case SystemZ::BI__builtin_s390_vfaezf:

54 case SystemZ::BI__builtin_s390_vfaezbs:

55 case SystemZ::BI__builtin_s390_vfaezhs:

56 case SystemZ::BI__builtin_s390_vfaezfs: i = 2; l = 0; u = 15; break;

57 case SystemZ::BI__builtin_s390_vfisb:

58 case SystemZ::BI__builtin_s390_vfidb:

61 case SystemZ::BI__builtin_s390_vftcisb:

62 case SystemZ::BI__builtin_s390_vftcidb: i = 1; l = 0; u = 4095; break;

63 case SystemZ::BI__builtin_s390_vlbb: i = 1; l = 0; u = 15; break;

64 case SystemZ::BI__builtin_s390_vpdi: i = 2; l = 0; u = 15; break;

65 case SystemZ::BI__builtin_s390_vsldb: i = 2; l = 0; u = 15; break;

66 case SystemZ::BI__builtin_s390_vstrcb:

67 case SystemZ::BI__builtin_s390_vstrch:

68 case SystemZ::BI__builtin_s390_vstrcf:

69 case SystemZ::BI__builtin_s390_vstrczb:

70 case SystemZ::BI__builtin_s390_vstrczh:

71 case SystemZ::BI__builtin_s390_vstrczf:

72 case SystemZ::BI__builtin_s390_vstrcbs:

73 case SystemZ::BI__builtin_s390_vstrchs:

74 case SystemZ::BI__builtin_s390_vstrcfs:

75 case SystemZ::BI__builtin_s390_vstrczbs:

76 case SystemZ::BI__builtin_s390_vstrczhs:

77 case SystemZ::BI__builtin_s390_vstrczfs: i = 3; l = 0; u = 15; break;

78 case SystemZ::BI__builtin_s390_vmslg: i = 3; l = 0; u = 15; break;

79 case SystemZ::BI__builtin_s390_vfminsb:

80 case SystemZ::BI__builtin_s390_vfmaxsb:

81 case SystemZ::BI__builtin_s390_vfmindb:

82 case SystemZ::BI__builtin_s390_vfmaxdb: i = 2; l = 0; u = 15; break;

83 case SystemZ::BI__builtin_s390_vsld: i = 2; l = 0; u = 7; break;

84 case SystemZ::BI__builtin_s390_vsrd: i = 2; l = 0; u = 7; break;

85 case SystemZ::BI__builtin_s390_vclfnhs:

86 case SystemZ::BI__builtin_s390_vclfnls:

87 case SystemZ::BI__builtin_s390_vcfn:

88 case SystemZ::BI__builtin_s390_vcnf: i = 1; l = 0; u = 15; break;

89 case SystemZ::BI__builtin_s390_vcrnfs: i = 2; l = 0; u = 15; break;

90 }

92}

93

94}

This file declares semantic analysis functions specific to SystemZ.

Enumerates target-specific builtins in their own namespaces within namespace clang.

CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).

Expr * getArg(unsigned Arg)

getArg - Return the specified argument.

This represents one expression.

std::optional< llvm::APSInt > getIntegerConstantExpr(const ASTContext &Ctx, SourceLocation *Loc=nullptr) const

isIntegerConstantExpr - Return the value if this expression is a valid integer constant expression.

SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)

Emit a diagnostic.

ASTContext & getASTContext() const

bool CheckSystemZBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)

Sema - This implements semantic analysis and AST building for C.

bool BuiltinConstantArgRange(CallExpr *TheCall, int ArgNum, int Low, int High, bool RangeIsError=true)

BuiltinConstantArgRange - Handle a check if argument ArgNum of CallExpr TheCall is a constant express...

SourceRange getSourceRange() const LLVM_READONLY

SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...

SourceLocation getBeginLoc() const LLVM_READONLY

The JSON file list parser is used to communicate input to InstallAPI.