mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-27 02:31:09 +00:00
Move unnamed_addr after the function arguments on Sabre's request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124209 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8f31428119
commit
3971df5203
@ -2670,8 +2670,6 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) {
|
||||
unsigned Linkage;
|
||||
|
||||
unsigned Visibility, RetAttrs;
|
||||
bool UnnamedAddr;
|
||||
LocTy UnnamedAddrLoc;
|
||||
CallingConv::ID CC;
|
||||
PATypeHolder RetType(Type::getVoidTy(Context));
|
||||
LocTy RetTypeLoc = Lex.getLoc();
|
||||
@ -2679,8 +2677,6 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) {
|
||||
ParseOptionalVisibility(Visibility) ||
|
||||
ParseOptionalCallingConv(CC) ||
|
||||
ParseOptionalAttrs(RetAttrs, 1) ||
|
||||
ParseOptionalToken(lltok::kw_unnamed_addr, UnnamedAddr,
|
||||
&UnnamedAddrLoc) ||
|
||||
ParseType(RetType, RetTypeLoc, true /*void allowed*/))
|
||||
return true;
|
||||
|
||||
@ -2742,8 +2738,12 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) {
|
||||
std::string Section;
|
||||
unsigned Alignment;
|
||||
std::string GC;
|
||||
bool UnnamedAddr;
|
||||
LocTy UnnamedAddrLoc;
|
||||
|
||||
if (ParseArgumentList(ArgList, isVarArg, false) ||
|
||||
ParseOptionalToken(lltok::kw_unnamed_addr, UnnamedAddr,
|
||||
&UnnamedAddrLoc) ||
|
||||
ParseOptionalAttrs(FuncAttrs, 2) ||
|
||||
(EatIfPresent(lltok::kw_section) &&
|
||||
ParseStringConstant(Section)) ||
|
||||
|
@ -1590,8 +1590,6 @@ void AssemblyWriter::printFunction(const Function *F) {
|
||||
Attributes RetAttrs = Attrs.getRetAttributes();
|
||||
if (RetAttrs != Attribute::None)
|
||||
Out << Attribute::getAsString(Attrs.getRetAttributes()) << ' ';
|
||||
if (F->hasUnnamedAddr())
|
||||
Out << "unnamed_addr ";
|
||||
TypePrinter.print(F->getReturnType(), Out);
|
||||
Out << ' ';
|
||||
WriteAsOperandInternal(Out, F, &TypePrinter, &Machine, F->getParent());
|
||||
@ -1631,6 +1629,8 @@ void AssemblyWriter::printFunction(const Function *F) {
|
||||
Out << "..."; // Output varargs portion of signature!
|
||||
}
|
||||
Out << ')';
|
||||
if (F->hasUnnamedAddr())
|
||||
Out << " unnamed_addr";
|
||||
Attributes FnAttrs = Attrs.getFnAttributes();
|
||||
if (FnAttrs != Attribute::None)
|
||||
Out << ' ' << Attribute::getAsString(Attrs.getFnAttributes());
|
||||
|
@ -5,7 +5,7 @@
|
||||
@bar.d = internal unnamed_addr constant %struct.foobar zeroinitializer, align 4
|
||||
@foo.d = internal constant %struct.foobar zeroinitializer, align 4
|
||||
|
||||
define unnamed_addr i32 @main() nounwind ssp {
|
||||
define i32 @main() unnamed_addr nounwind ssp {
|
||||
entry:
|
||||
%call2 = tail call i32 @zed(%struct.foobar* @foo.d, %struct.foobar* @bar.d) nounwind
|
||||
ret i32 0
|
||||
@ -15,4 +15,4 @@ declare i32 @zed(%struct.foobar*, %struct.foobar*)
|
||||
|
||||
; CHECK: @bar.d = internal unnamed_addr constant %struct.foobar zeroinitializer, align 4
|
||||
; CHECK: @foo.d = internal constant %struct.foobar zeroinitializer, align 4
|
||||
; CHECK: define unnamed_addr i32 @main() nounwind ssp {
|
||||
; CHECK: define i32 @main() unnamed_addr nounwind ssp {
|
||||
|
Loading…
x
Reference in New Issue
Block a user