mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Add #line support for CBE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26621 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
42d0b455ec
commit
7075d6f2f2
@ -1598,6 +1598,7 @@ void CWriter::lowerIntrinsics(Function &F) {
|
||||
case Intrinsic::setjmp:
|
||||
case Intrinsic::longjmp:
|
||||
case Intrinsic::prefetch:
|
||||
case Intrinsic::dbg_stoppoint:
|
||||
// We directly implement these intrinsics
|
||||
break;
|
||||
default:
|
||||
@ -1687,6 +1688,22 @@ void CWriter::visitCallInst(CallInst &I) {
|
||||
writeOperand(I.getOperand(3));
|
||||
Out << ")";
|
||||
return;
|
||||
case Intrinsic::dbg_stoppoint: {
|
||||
// If we use writeOperand directly we get a "u" suffix which is rejected
|
||||
// by gcc.
|
||||
ConstantUInt *SI = cast<ConstantUInt>(I.getOperand(2));
|
||||
GlobalVariable *GV = cast<GlobalVariable>(I.getOperand(4));
|
||||
ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
|
||||
std::string FileName = CS->getOperand(4)->getStringValue();
|
||||
std::string Directory = CS->getOperand(5)->getStringValue();
|
||||
|
||||
Out << "\n#line "
|
||||
<< SI->getValue()
|
||||
<< " \"" << Directory << FileName << "\"\n";
|
||||
// Need to set result.
|
||||
Out << "0";
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1598,6 +1598,7 @@ void CWriter::lowerIntrinsics(Function &F) {
|
||||
case Intrinsic::setjmp:
|
||||
case Intrinsic::longjmp:
|
||||
case Intrinsic::prefetch:
|
||||
case Intrinsic::dbg_stoppoint:
|
||||
// We directly implement these intrinsics
|
||||
break;
|
||||
default:
|
||||
@ -1687,6 +1688,22 @@ void CWriter::visitCallInst(CallInst &I) {
|
||||
writeOperand(I.getOperand(3));
|
||||
Out << ")";
|
||||
return;
|
||||
case Intrinsic::dbg_stoppoint: {
|
||||
// If we use writeOperand directly we get a "u" suffix which is rejected
|
||||
// by gcc.
|
||||
ConstantUInt *SI = cast<ConstantUInt>(I.getOperand(2));
|
||||
GlobalVariable *GV = cast<GlobalVariable>(I.getOperand(4));
|
||||
ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
|
||||
std::string FileName = CS->getOperand(4)->getStringValue();
|
||||
std::string Directory = CS->getOperand(5)->getStringValue();
|
||||
|
||||
Out << "\n#line "
|
||||
<< SI->getValue()
|
||||
<< " \"" << Directory << FileName << "\"\n";
|
||||
// Need to set result.
|
||||
Out << "0";
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user