Skip to content

Commit 16625ee

Browse files
committed
Minor changes of "attribute" --> "attributes"
1 parent a4e401c commit 16625ee

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tools/flang2/flang2exe/ll_structure.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ typedef struct LL_BasicBlock_ {
861861
typedef struct LL_Function_ {
862862
const char *name;
863863
LL_Type *return_type;
864-
const char *attribute;
864+
const char *attributes;
865865
LL_BasicBlock *first;
866866
LL_BasicBlock *last;
867867
LL_Value **arguments;

tools/flang2/flang2exe/ll_write.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ add_prototype(LL_Instruction *instruction)
208208
LL_Function *scan_function = called;
209209
LL_Function *new_function;
210210
LL_Value *function = instruction->operands[1];
211+
LL_Value *attributes = function->storage;
211212
int i;
212213

213214
if (function->data == NULL) {
@@ -227,6 +228,7 @@ add_prototype(LL_Instruction *instruction)
227228
new_function->next = called;
228229
new_function->name = function->data;
229230
new_function->num_args = instruction->num_operands - 2;
231+
new_function->attributes = (attributes ? attributes->data : NULL);
230232

231233
new_function->return_type = function->type_struct;
232234
called = new_function;
@@ -267,6 +269,9 @@ write_prototypes(FILE *out, LLVMModuleRef module)
267269
}
268270
}
269271
fprintf(out, ") nounwind");
272+
if (cur_function->attributes) {
273+
fprintf(out, " %s", cur_function->attributes);
274+
}
270275
}
271276
cur_function = cur_function->next;
272277
}
@@ -812,11 +817,11 @@ ll_write_local_objects(FILE *out, LL_Function *function)
812817
#endif
813818
}
814819
}
820+
815821
void
816822
ll_write_function(FILE *out, LL_Function *function, LL_Module *module, bool no_return, const char *prefix)
817823
{
818824
int i;
819-
char attribute[256];
820825
LL_BasicBlock *block = function->first;
821826

822827
fprintf(out, "define %s %s %s ", ll_get_linkage_string(function->linkage),

0 commit comments

Comments
 (0)