1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01: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.

llvm-svn: 12356
This commit is contained in:
Chris Lattner 2004-03-13 00:24:00 +00:00
parent e10c6cd509
commit f7bc6fd913
9 changed files with 30 additions and 35 deletions

View File

@ -27,9 +27,9 @@ namespace Intrinsic {
not_intrinsic = 0, // Must be zero not_intrinsic = 0, // Must be zero
// Varargs handling intrinsics... // Varargs handling intrinsics...
va_start, // Used to implement the va_start macro in C vastart, // Used to implement the va_start macro in C
va_end, // Used to implement the va_end macro in C vaend, // Used to implement the va_end macro in C
va_copy, // Used to implement the va_copy macro in C vacopy, // Used to implement the va_copy macro in C
// Code generator intrinsics... // Code generator intrinsics...
returnaddress, // Yields the return address of a dynamic call frame returnaddress, // Yields the return address of a dynamic call frame

View File

@ -494,16 +494,14 @@ void GraphBuilder::visitCallSite(CallSite CS) {
if (Function *F = dyn_cast<Function>(Callee)) if (Function *F = dyn_cast<Function>(Callee))
if (F->isExternal()) if (F->isExternal())
switch (F->getIntrinsicID()) { switch (F->getIntrinsicID()) {
case Intrinsic::va_start: case Intrinsic::vastart:
getValueDest(*CS.getInstruction()).getNode()->setAllocaNodeMarker(); getValueDest(*CS.getInstruction()).getNode()->setAllocaNodeMarker();
return; return;
case Intrinsic::va_copy: case Intrinsic::vacopy:
getValueDest(*CS.getInstruction()). getValueDest(*CS.getInstruction()).
mergeWith(getValueDest(**(CS.arg_begin()))); mergeWith(getValueDest(**(CS.arg_begin())));
return; return;
// FIXME: the #undef is a quick fix for compilation on Sparc case Intrinsic::vaend:
#undef va_end
case Intrinsic::va_end:
return; // noop return; // noop
case Intrinsic::memmove: case Intrinsic::memmove:
case Intrinsic::memcpy: { case Intrinsic::memcpy: {

View File

@ -774,16 +774,16 @@ void Interpreter::visitCallSite(CallSite CS) {
switch (F->getIntrinsicID()) { switch (F->getIntrinsicID()) {
case Intrinsic::not_intrinsic: case Intrinsic::not_intrinsic:
break; break;
case Intrinsic::va_start: { // va_start case Intrinsic::vastart: { // va_start
GenericValue ArgIndex; GenericValue ArgIndex;
ArgIndex.UIntPairVal.first = ECStack.size() - 1; ArgIndex.UIntPairVal.first = ECStack.size() - 1;
ArgIndex.UIntPairVal.second = 0; ArgIndex.UIntPairVal.second = 0;
SetValue(CS.getInstruction(), ArgIndex, SF); SetValue(CS.getInstruction(), ArgIndex, SF);
return; 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; 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); SetValue(CS.getInstruction(), getOperandValue(*CS.arg_begin(), SF), SF);
return; return;
default: default:

View File

@ -1205,9 +1205,9 @@ void CWriter::lowerIntrinsics(Module &M) {
if (Function *F = CI->getCalledFunction()) if (Function *F = CI->getCalledFunction())
switch (F->getIntrinsicID()) { switch (F->getIntrinsicID()) {
case Intrinsic::not_intrinsic: case Intrinsic::not_intrinsic:
case Intrinsic::va_start: case Intrinsic::vastart:
case Intrinsic::va_copy: case Intrinsic::vacopy:
case Intrinsic::va_end: case Intrinsic::vaend:
case Intrinsic::returnaddress: case Intrinsic::returnaddress:
case Intrinsic::frameaddress: case Intrinsic::frameaddress:
case Intrinsic::setjmp: case Intrinsic::setjmp:
@ -1234,7 +1234,7 @@ void CWriter::visitCallInst(CallInst &I) {
if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID()) { if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID()) {
switch (ID) { switch (ID) {
default: assert(0 && "Unknown LLVM intrinsic!"); default: assert(0 && "Unknown LLVM intrinsic!");
case Intrinsic::va_start: case Intrinsic::vastart:
Out << "0; "; Out << "0; ";
Out << "va_start(*(va_list*)&" << Mang->getValueName(&I) << ", "; Out << "va_start(*(va_list*)&" << Mang->getValueName(&I) << ", ";
@ -1248,12 +1248,12 @@ void CWriter::visitCallInst(CallInst &I) {
writeOperand(&I.getParent()->getParent()->aback()); writeOperand(&I.getParent()->getParent()->aback());
Out << ")"; Out << ")";
return; return;
case Intrinsic::va_end: case Intrinsic::vaend:
Out << "va_end(*(va_list*)&"; Out << "va_end(*(va_list*)&";
writeOperand(I.getOperand(1)); writeOperand(I.getOperand(1));
Out << ")"; Out << ")";
return; return;
case Intrinsic::va_copy: case Intrinsic::vacopy:
Out << "0;"; Out << "0;";
Out << "va_copy(*(va_list*)&" << Mang->getValueName(&I) << ", "; Out << "va_copy(*(va_list*)&" << Mang->getValueName(&I) << ", ";
Out << "*(va_list*)&"; Out << "*(va_list*)&";

View File

@ -126,13 +126,10 @@ bool InstructionSelection::runOnFunction(Function &F) {
if (CallInst *CI = dyn_cast<CallInst>(I++)) if (CallInst *CI = dyn_cast<CallInst>(I++))
if (Function *F = CI->getCalledFunction()) if (Function *F = CI->getCalledFunction())
switch (F->getIntrinsicID()) { switch (F->getIntrinsicID()) {
#undef va_start
#undef va_copy
#undef va_end
case Intrinsic::not_intrinsic: case Intrinsic::not_intrinsic:
case Intrinsic::va_start: case Intrinsic::vastart:
case Intrinsic::va_copy: case Intrinsic::vacopy:
case Intrinsic::va_end: case Intrinsic::vaend:
// We directly implement these intrinsics. Note that this knowledge // We directly implement these intrinsics. Note that this knowledge
// is incestuously entangled with the code in // is incestuously entangled with the code in
// SparcInstrSelection.cpp and must be updated when it is updated. // SparcInstrSelection.cpp and must be updated when it is updated.

View File

@ -1398,7 +1398,7 @@ static bool CodeGenIntrinsic(Intrinsic::ID iid, CallInst &callInstr,
switch (iid) { switch (iid) {
default: default:
assert(0 && "Unknown intrinsic function call should have been lowered!"); 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 // Get the address of the first incoming vararg argument on the stack
bool ignore; bool ignore;
Function* func = cast<Function>(callInstr.getParent()->getParent()); Function* func = cast<Function>(callInstr.getParent()->getParent());
@ -1412,10 +1412,10 @@ static bool CodeGenIntrinsic(Intrinsic::ID iid, CallInst &callInstr,
return true; return true;
} }
case Intrinsic::va_end: case Intrinsic::vaend:
return true; // no-op on SparcV9 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) // Simple copy of current va_list (arg1) to new va_list (result)
mvec.push_back(BuildMI(V9::ORr, 3). mvec.push_back(BuildMI(V9::ORr, 3).
addMReg(target.getRegInfo().getZeroRegNum()). addMReg(target.getRegInfo().getZeroRegNum()).

View File

@ -1242,9 +1242,9 @@ void ISel::LowerUnknownIntrinsicFunctionCalls(Function &F) {
if (Function *F = CI->getCalledFunction()) if (Function *F = CI->getCalledFunction())
switch (F->getIntrinsicID()) { switch (F->getIntrinsicID()) {
case Intrinsic::not_intrinsic: case Intrinsic::not_intrinsic:
case Intrinsic::va_start: case Intrinsic::vastart:
case Intrinsic::va_copy: case Intrinsic::vacopy:
case Intrinsic::va_end: case Intrinsic::vaend:
case Intrinsic::returnaddress: case Intrinsic::returnaddress:
case Intrinsic::frameaddress: case Intrinsic::frameaddress:
case Intrinsic::memcpy: case Intrinsic::memcpy:

View File

@ -234,9 +234,9 @@ unsigned Function::getIntrinsicID() const {
if (getName() == "llvm.siglongjmp") return Intrinsic::siglongjmp; if (getName() == "llvm.siglongjmp") return Intrinsic::siglongjmp;
break; break;
case 'v': case 'v':
if (getName() == "llvm.va_copy") return Intrinsic::va_copy; if (getName() == "llvm.va_copy") return Intrinsic::vacopy;
if (getName() == "llvm.va_end") return Intrinsic::va_end; if (getName() == "llvm.va_end") return Intrinsic::vaend;
if (getName() == "llvm.va_start") return Intrinsic::va_start; if (getName() == "llvm.va_start") return Intrinsic::vastart;
break; break;
} }
// The "llvm." namespace is reserved! // The "llvm." namespace is reserved!

View File

@ -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 // FIXME: this should check the return type of each intrinsic as well, also
// arguments! // arguments!
switch (ID) { switch (ID) {
case Intrinsic::va_start: case Intrinsic::vastart:
Assert1(CI.getParent()->getParent()->getFunctionType()->isVarArg(), Assert1(CI.getParent()->getParent()->getFunctionType()->isVarArg(),
"llvm.va_start intrinsic may only occur in function with variable" "llvm.va_start intrinsic may only occur in function with variable"
" args!", &CI); " args!", &CI);
NumArgs = 0; NumArgs = 0;
break; break;
case Intrinsic::va_end: NumArgs = 1; break; case Intrinsic::vaend: NumArgs = 1; break;
case Intrinsic::va_copy: NumArgs = 1; break; case Intrinsic::vacopy: NumArgs = 1; break;
case Intrinsic::returnaddress: case Intrinsic::returnaddress:
case Intrinsic::frameaddress: case Intrinsic::frameaddress: