mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Support var arg intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33962 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -88,6 +88,8 @@ def llvm_v4i32_ty : LLVMPackedType<v4i32, 4, llvm_i32_ty>; // 4 x i32
|
|||||||
def llvm_v4f32_ty : LLVMPackedType<v4f32, 4, llvm_float_ty>; // 4 x float
|
def llvm_v4f32_ty : LLVMPackedType<v4f32, 4, llvm_float_ty>; // 4 x float
|
||||||
def llvm_v2f64_ty : LLVMPackedType<v2f64, 2, llvm_double_ty>;// 2 x double
|
def llvm_v2f64_ty : LLVMPackedType<v2f64, 2, llvm_double_ty>;// 2 x double
|
||||||
|
|
||||||
|
def ... : LLVMType<isVoid, "...">; // vararg
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Intrinsic Definitions.
|
// Intrinsic Definitions.
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
@@ -217,6 +219,11 @@ def int_dbg_func_start : Intrinsic<[llvm_void_ty, llvm_descriptor_ty]>;
|
|||||||
def int_dbg_declare : Intrinsic<[llvm_void_ty, llvm_ptr_ty,
|
def int_dbg_declare : Intrinsic<[llvm_void_ty, llvm_ptr_ty,
|
||||||
llvm_descriptor_ty]>;
|
llvm_descriptor_ty]>;
|
||||||
|
|
||||||
|
//===------------------ Exception Handling Intrinsics----------------------===//
|
||||||
|
//
|
||||||
|
def int_eh_exception : Intrinsic<[llvm_ptr_ty]>;
|
||||||
|
def int_eh_handlers : Intrinsic<[llvm_ptr_ty, llvm_ptr_ty, ...]>;
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Target-specific intrinsics
|
// Target-specific intrinsics
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@@ -987,6 +987,10 @@ void Verifier::VerifyIntrinsicPrototype(Function *F, ...) {
|
|||||||
for (unsigned ArgNo = 0; 1; ++ArgNo) {
|
for (unsigned ArgNo = 0; 1; ++ArgNo) {
|
||||||
int TypeID = va_arg(VA, int);
|
int TypeID = va_arg(VA, int);
|
||||||
|
|
||||||
|
if (TypeID == -2) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (TypeID == -1) {
|
if (TypeID == -1) {
|
||||||
if (ArgNo != FTy->getNumParams()+1)
|
if (ArgNo != FTy->getNumParams()+1)
|
||||||
CheckFailed("Intrinsic prototype has too many arguments!", F);
|
CheckFailed("Intrinsic prototype has too many arguments!", F);
|
||||||
|
@@ -176,7 +176,7 @@ using namespace llvm;
|
|||||||
|
|
||||||
Comment \/\/.*
|
Comment \/\/.*
|
||||||
|
|
||||||
Identifier [a-zA-Z_][0-9a-zA-Z_]*
|
Identifier [a-zA-Z_][0-9a-zA-Z_]*|\.\.\.
|
||||||
Integer [-+]?[0-9]+|0x[0-9a-fA-F]+|0b[01]+
|
Integer [-+]?[0-9]+|0x[0-9a-fA-F]+|0b[01]+
|
||||||
CodeFragment \[\{([^}]+|\}[^\]])*\}\]
|
CodeFragment \[\{([^}]+|\}[^\]])*\}\]
|
||||||
StringVal \"[^"]*\"
|
StringVal \"[^"]*\"
|
||||||
|
@@ -109,6 +109,11 @@ EmitIntrinsicToNameTable(const std::vector<CodeGenIntrinsic> &Ints,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void EmitTypeVerify(std::ostream &OS, Record *ArgType) {
|
static void EmitTypeVerify(std::ostream &OS, Record *ArgType) {
|
||||||
|
if (ArgType->getValueAsString("TypeVal") == "...") {
|
||||||
|
OS << "-2, ";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
OS << "(int)" << ArgType->getValueAsString("TypeVal") << ", ";
|
OS << "(int)" << ArgType->getValueAsString("TypeVal") << ", ";
|
||||||
// If this is an integer type, check the width is correct.
|
// If this is an integer type, check the width is correct.
|
||||||
if (ArgType->isSubClassOf("LLVMIntegerType"))
|
if (ArgType->isSubClassOf("LLVMIntegerType"))
|
||||||
|
Reference in New Issue
Block a user