mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-26 23:32:58 +00:00
Rename the intrinsic enum values for llvm.va_* from Intrinsic::va_* to
Intrinsic::va*. This avoid conflicting with macros in the stdlib.h file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12356 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bfe492b5c2
commit
317201d773
@ -27,9 +27,9 @@ namespace Intrinsic {
|
||||
not_intrinsic = 0, // Must be zero
|
||||
|
||||
// Varargs handling intrinsics...
|
||||
va_start, // Used to implement the va_start macro in C
|
||||
va_end, // Used to implement the va_end macro in C
|
||||
va_copy, // Used to implement the va_copy macro in C
|
||||
vastart, // Used to implement the va_start macro in C
|
||||
vaend, // Used to implement the va_end macro in C
|
||||
vacopy, // Used to implement the va_copy macro in C
|
||||
|
||||
// Code generator intrinsics...
|
||||
returnaddress, // Yields the return address of a dynamic call frame
|
||||
|
@ -494,16 +494,14 @@ void GraphBuilder::visitCallSite(CallSite CS) {
|
||||
if (Function *F = dyn_cast<Function>(Callee))
|
||||
if (F->isExternal())
|
||||
switch (F->getIntrinsicID()) {
|
||||
case Intrinsic::va_start:
|
||||
case Intrinsic::vastart:
|
||||
getValueDest(*CS.getInstruction()).getNode()->setAllocaNodeMarker();
|
||||
return;
|
||||
case Intrinsic::va_copy:
|
||||
case Intrinsic::vacopy:
|
||||
getValueDest(*CS.getInstruction()).
|
||||
mergeWith(getValueDest(**(CS.arg_begin())));
|
||||
return;
|
||||
// FIXME: the #undef is a quick fix for compilation on Sparc
|
||||
#undef va_end
|
||||
case Intrinsic::va_end:
|
||||
case Intrinsic::vaend:
|
||||
return; // noop
|
||||
case Intrinsic::memmove:
|
||||
case Intrinsic::memcpy: {
|
||||
|
@ -774,16 +774,16 @@ void Interpreter::visitCallSite(CallSite CS) {
|
||||
switch (F->getIntrinsicID()) {
|
||||
case Intrinsic::not_intrinsic:
|
||||
break;
|
||||
case Intrinsic::va_start: { // va_start
|
||||
case Intrinsic::vastart: { // va_start
|
||||
GenericValue ArgIndex;
|
||||
ArgIndex.UIntPairVal.first = ECStack.size() - 1;
|
||||
ArgIndex.UIntPairVal.second = 0;
|
||||
SetValue(CS.getInstruction(), ArgIndex, SF);
|
||||
return;
|
||||
}
|
||||
case Intrinsic::va_end: // va_end is a noop for the interpreter
|
||||
case Intrinsic::vaend: // va_end is a noop for the interpreter
|
||||
return;
|
||||
case Intrinsic::va_copy: // va_copy: dest = src
|
||||
case Intrinsic::vacopy: // va_copy: dest = src
|
||||
SetValue(CS.getInstruction(), getOperandValue(*CS.arg_begin(), SF), SF);
|
||||
return;
|
||||
default:
|
||||
|
@ -1205,9 +1205,9 @@ void CWriter::lowerIntrinsics(Module &M) {
|
||||
if (Function *F = CI->getCalledFunction())
|
||||
switch (F->getIntrinsicID()) {
|
||||
case Intrinsic::not_intrinsic:
|
||||
case Intrinsic::va_start:
|
||||
case Intrinsic::va_copy:
|
||||
case Intrinsic::va_end:
|
||||
case Intrinsic::vastart:
|
||||
case Intrinsic::vacopy:
|
||||
case Intrinsic::vaend:
|
||||
case Intrinsic::returnaddress:
|
||||
case Intrinsic::frameaddress:
|
||||
case Intrinsic::setjmp:
|
||||
@ -1234,7 +1234,7 @@ void CWriter::visitCallInst(CallInst &I) {
|
||||
if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID()) {
|
||||
switch (ID) {
|
||||
default: assert(0 && "Unknown LLVM intrinsic!");
|
||||
case Intrinsic::va_start:
|
||||
case Intrinsic::vastart:
|
||||
Out << "0; ";
|
||||
|
||||
Out << "va_start(*(va_list*)&" << Mang->getValueName(&I) << ", ";
|
||||
@ -1248,12 +1248,12 @@ void CWriter::visitCallInst(CallInst &I) {
|
||||
writeOperand(&I.getParent()->getParent()->aback());
|
||||
Out << ")";
|
||||
return;
|
||||
case Intrinsic::va_end:
|
||||
case Intrinsic::vaend:
|
||||
Out << "va_end(*(va_list*)&";
|
||||
writeOperand(I.getOperand(1));
|
||||
Out << ")";
|
||||
return;
|
||||
case Intrinsic::va_copy:
|
||||
case Intrinsic::vacopy:
|
||||
Out << "0;";
|
||||
Out << "va_copy(*(va_list*)&" << Mang->getValueName(&I) << ", ";
|
||||
Out << "*(va_list*)&";
|
||||
|
@ -1205,9 +1205,9 @@ void CWriter::lowerIntrinsics(Module &M) {
|
||||
if (Function *F = CI->getCalledFunction())
|
||||
switch (F->getIntrinsicID()) {
|
||||
case Intrinsic::not_intrinsic:
|
||||
case Intrinsic::va_start:
|
||||
case Intrinsic::va_copy:
|
||||
case Intrinsic::va_end:
|
||||
case Intrinsic::vastart:
|
||||
case Intrinsic::vacopy:
|
||||
case Intrinsic::vaend:
|
||||
case Intrinsic::returnaddress:
|
||||
case Intrinsic::frameaddress:
|
||||
case Intrinsic::setjmp:
|
||||
@ -1234,7 +1234,7 @@ void CWriter::visitCallInst(CallInst &I) {
|
||||
if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID()) {
|
||||
switch (ID) {
|
||||
default: assert(0 && "Unknown LLVM intrinsic!");
|
||||
case Intrinsic::va_start:
|
||||
case Intrinsic::vastart:
|
||||
Out << "0; ";
|
||||
|
||||
Out << "va_start(*(va_list*)&" << Mang->getValueName(&I) << ", ";
|
||||
@ -1248,12 +1248,12 @@ void CWriter::visitCallInst(CallInst &I) {
|
||||
writeOperand(&I.getParent()->getParent()->aback());
|
||||
Out << ")";
|
||||
return;
|
||||
case Intrinsic::va_end:
|
||||
case Intrinsic::vaend:
|
||||
Out << "va_end(*(va_list*)&";
|
||||
writeOperand(I.getOperand(1));
|
||||
Out << ")";
|
||||
return;
|
||||
case Intrinsic::va_copy:
|
||||
case Intrinsic::vacopy:
|
||||
Out << "0;";
|
||||
Out << "va_copy(*(va_list*)&" << Mang->getValueName(&I) << ", ";
|
||||
Out << "*(va_list*)&";
|
||||
|
@ -126,13 +126,10 @@ bool InstructionSelection::runOnFunction(Function &F) {
|
||||
if (CallInst *CI = dyn_cast<CallInst>(I++))
|
||||
if (Function *F = CI->getCalledFunction())
|
||||
switch (F->getIntrinsicID()) {
|
||||
#undef va_start
|
||||
#undef va_copy
|
||||
#undef va_end
|
||||
case Intrinsic::not_intrinsic:
|
||||
case Intrinsic::va_start:
|
||||
case Intrinsic::va_copy:
|
||||
case Intrinsic::va_end:
|
||||
case Intrinsic::vastart:
|
||||
case Intrinsic::vacopy:
|
||||
case Intrinsic::vaend:
|
||||
// We directly implement these intrinsics. Note that this knowledge
|
||||
// is incestuously entangled with the code in
|
||||
// SparcInstrSelection.cpp and must be updated when it is updated.
|
||||
|
@ -1398,7 +1398,7 @@ static bool CodeGenIntrinsic(Intrinsic::ID iid, CallInst &callInstr,
|
||||
switch (iid) {
|
||||
default:
|
||||
assert(0 && "Unknown intrinsic function call should have been lowered!");
|
||||
case Intrinsic::va_start: {
|
||||
case Intrinsic::vastart: {
|
||||
// Get the address of the first incoming vararg argument on the stack
|
||||
bool ignore;
|
||||
Function* func = cast<Function>(callInstr.getParent()->getParent());
|
||||
@ -1412,10 +1412,10 @@ static bool CodeGenIntrinsic(Intrinsic::ID iid, CallInst &callInstr,
|
||||
return true;
|
||||
}
|
||||
|
||||
case Intrinsic::va_end:
|
||||
case Intrinsic::vaend:
|
||||
return true; // no-op on SparcV9
|
||||
|
||||
case Intrinsic::va_copy:
|
||||
case Intrinsic::vacopy:
|
||||
// Simple copy of current va_list (arg1) to new va_list (result)
|
||||
mvec.push_back(BuildMI(V9::ORr, 3).
|
||||
addMReg(target.getRegInfo().getZeroRegNum()).
|
||||
|
@ -1242,9 +1242,9 @@ void ISel::LowerUnknownIntrinsicFunctionCalls(Function &F) {
|
||||
if (Function *F = CI->getCalledFunction())
|
||||
switch (F->getIntrinsicID()) {
|
||||
case Intrinsic::not_intrinsic:
|
||||
case Intrinsic::va_start:
|
||||
case Intrinsic::va_copy:
|
||||
case Intrinsic::va_end:
|
||||
case Intrinsic::vastart:
|
||||
case Intrinsic::vacopy:
|
||||
case Intrinsic::vaend:
|
||||
case Intrinsic::returnaddress:
|
||||
case Intrinsic::frameaddress:
|
||||
case Intrinsic::memcpy:
|
||||
|
@ -1242,9 +1242,9 @@ void ISel::LowerUnknownIntrinsicFunctionCalls(Function &F) {
|
||||
if (Function *F = CI->getCalledFunction())
|
||||
switch (F->getIntrinsicID()) {
|
||||
case Intrinsic::not_intrinsic:
|
||||
case Intrinsic::va_start:
|
||||
case Intrinsic::va_copy:
|
||||
case Intrinsic::va_end:
|
||||
case Intrinsic::vastart:
|
||||
case Intrinsic::vacopy:
|
||||
case Intrinsic::vaend:
|
||||
case Intrinsic::returnaddress:
|
||||
case Intrinsic::frameaddress:
|
||||
case Intrinsic::memcpy:
|
||||
|
@ -234,9 +234,9 @@ unsigned Function::getIntrinsicID() const {
|
||||
if (getName() == "llvm.siglongjmp") return Intrinsic::siglongjmp;
|
||||
break;
|
||||
case 'v':
|
||||
if (getName() == "llvm.va_copy") return Intrinsic::va_copy;
|
||||
if (getName() == "llvm.va_end") return Intrinsic::va_end;
|
||||
if (getName() == "llvm.va_start") return Intrinsic::va_start;
|
||||
if (getName() == "llvm.va_copy") return Intrinsic::vacopy;
|
||||
if (getName() == "llvm.va_end") return Intrinsic::vaend;
|
||||
if (getName() == "llvm.va_start") return Intrinsic::vastart;
|
||||
break;
|
||||
}
|
||||
// The "llvm." namespace is reserved!
|
||||
|
@ -548,14 +548,14 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
|
||||
// FIXME: this should check the return type of each intrinsic as well, also
|
||||
// arguments!
|
||||
switch (ID) {
|
||||
case Intrinsic::va_start:
|
||||
case Intrinsic::vastart:
|
||||
Assert1(CI.getParent()->getParent()->getFunctionType()->isVarArg(),
|
||||
"llvm.va_start intrinsic may only occur in function with variable"
|
||||
" args!", &CI);
|
||||
NumArgs = 0;
|
||||
break;
|
||||
case Intrinsic::va_end: NumArgs = 1; break;
|
||||
case Intrinsic::va_copy: NumArgs = 1; break;
|
||||
case Intrinsic::vaend: NumArgs = 1; break;
|
||||
case Intrinsic::vacopy: NumArgs = 1; break;
|
||||
|
||||
case Intrinsic::returnaddress:
|
||||
case Intrinsic::frameaddress:
|
||||
|
Loading…
x
Reference in New Issue
Block a user