Commit cf08c344 by Nathan Sidwell Committed by Nathan Sidwell

nvptx.c (write_function_decl_and_comment): Print leading blank line.

	* config/nvptx/nvptx.c (write_function_decl_and_comment): Print
	leading blank line.
	(write_func_decl_from_insn): Likewise.
	(init_output_initializer, nvptx_assemble_undefined_decl): Likewise.
	(nvptx_file_end): Likewise.
	(nvptx_function_end): Undent output.
	(nvptx_expand_call): Fix formatting.
	(nvptx_output_call_insn): Indent output.
	* config/nvptx/nvptx.h (ASM_OUTPUT_ALIGNED_DECL_COMMON,
	ASM__OUTPUT_ALIGNED_DECL_LOCAL): Print leading blank line.

From-SVN: r230705
parent d6fe6b8a
2015-11-21 Nathan Sidwell <nathan@acm.org>
* config/nvptx/nvptx.c (write_function_decl_and_comment): Print
leading blank line.
(write_func_decl_from_insn): Likewise.
(init_output_initializer, nvptx_assemble_undefined_decl): Likewise.
(nvptx_file_end): Likewise.
(nvptx_function_end): Undent output.
(nvptx_expand_call): Fix formatting.
(nvptx_output_call_insn): Indent output.
* config/nvptx/nvptx.h (ASM_OUTPUT_ALIGNED_DECL_COMMON,
ASM__OUTPUT_ALIGNED_DECL_LOCAL): Print leading blank line.
2015-11-21 Jakub Jelinek <jakub@redhat.com> 2015-11-21 Jakub Jelinek <jakub@redhat.com>
PR debug/66432 PR debug/66432
...@@ -515,7 +515,7 @@ walk_args_for_param (FILE *file, tree argtypes, tree args, bool write_copy, ...@@ -515,7 +515,7 @@ walk_args_for_param (FILE *file, tree argtypes, tree args, bool write_copy,
static void static void
write_function_decl_and_comment (std::stringstream &s, const char *name, const_tree decl) write_function_decl_and_comment (std::stringstream &s, const char *name, const_tree decl)
{ {
s << "// BEGIN"; s << "\n// BEGIN";
if (TREE_PUBLIC (decl)) if (TREE_PUBLIC (decl))
s << " GLOBAL"; s << " GLOBAL";
s << " FUNCTION DECL: "; s << " FUNCTION DECL: ";
...@@ -765,7 +765,7 @@ write_func_decl_from_insn (std::stringstream &s, rtx result, rtx pat, ...@@ -765,7 +765,7 @@ write_func_decl_from_insn (std::stringstream &s, rtx result, rtx pat,
{ {
name = XSTR (callee, 0); name = XSTR (callee, 0);
name = nvptx_name_replacement (name); name = nvptx_name_replacement (name);
s << "// BEGIN GLOBAL FUNCTION DECL: " << name << "\n"; s << "\n// BEGIN GLOBAL FUNCTION DECL: " << name << "\n";
} }
s << (callprototype ? "\t.callprototype\t" : "\t.extern .func "); s << (callprototype ? "\t.callprototype\t" : "\t.extern .func ");
...@@ -820,7 +820,7 @@ write_func_decl_from_insn (std::stringstream &s, rtx result, rtx pat, ...@@ -820,7 +820,7 @@ write_func_decl_from_insn (std::stringstream &s, rtx result, rtx pat,
void void
nvptx_function_end (FILE *file) nvptx_function_end (FILE *file)
{ {
fprintf (file, "\t}\n"); fprintf (file, "}\n");
} }
/* Decide whether we can make a sibling call to a function. For ptx, we /* Decide whether we can make a sibling call to a function. For ptx, we
...@@ -965,7 +965,7 @@ nvptx_expand_call (rtx retval, rtx address) ...@@ -965,7 +965,7 @@ nvptx_expand_call (rtx retval, rtx address)
} }
if (varargs) if (varargs)
XVECEXP (pat, 0, vec_pos++) = gen_rtx_USE (VOIDmode, varargs); XVECEXP (pat, 0, vec_pos++) = gen_rtx_USE (VOIDmode, varargs);
gcc_assert (vec_pos = XVECLEN (pat, 0)); gcc_assert (vec_pos = XVECLEN (pat, 0));
...@@ -1726,7 +1726,7 @@ static void ...@@ -1726,7 +1726,7 @@ static void
init_output_initializer (FILE *file, const char *name, const_tree type, init_output_initializer (FILE *file, const char *name, const_tree type,
bool is_public) bool is_public)
{ {
fprintf (file, "// BEGIN%s VAR DEF: ", is_public ? " GLOBAL" : ""); fprintf (file, "\n// BEGIN%s VAR DEF: ", is_public ? " GLOBAL" : "");
assemble_name_raw (file, name); assemble_name_raw (file, name);
fputc ('\n', file); fputc ('\n', file);
...@@ -1809,7 +1809,8 @@ nvptx_assemble_undefined_decl (FILE *file, const char *name, const_tree decl) ...@@ -1809,7 +1809,8 @@ nvptx_assemble_undefined_decl (FILE *file, const char *name, const_tree decl)
if (TREE_CODE (decl) != VAR_DECL) if (TREE_CODE (decl) != VAR_DECL)
return; return;
const char *section = nvptx_section_for_decl (decl); const char *section = nvptx_section_for_decl (decl);
fprintf (file, "// BEGIN%s VAR DECL: ", TREE_PUBLIC (decl) ? " GLOBAL" : ""); fprintf (file, "\n// BEGIN%s VAR DECL: ",
TREE_PUBLIC (decl) ? " GLOBAL" : "");
assemble_name_raw (file, name); assemble_name_raw (file, name);
fputs ("\n", file); fputs ("\n", file);
HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (decl)); HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (decl));
...@@ -1934,7 +1935,7 @@ nvptx_output_call_insn (rtx_insn *insn, rtx result, rtx callee) ...@@ -1934,7 +1935,7 @@ nvptx_output_call_insn (rtx_insn *insn, rtx result, rtx callee)
} }
fprintf (asm_out_file, ";\n"); fprintf (asm_out_file, ";\n");
if (result != NULL_RTX) if (result != NULL_RTX)
return "ld.param%t0\t%0, [%%retval_in];\n\t}"; return "\tld.param%t0\t%0, [%%retval_in];\n\t}";
return "}"; return "}";
} }
...@@ -3979,7 +3980,7 @@ nvptx_file_end (void) ...@@ -3979,7 +3980,7 @@ nvptx_file_end (void)
worker_bcast_size = (worker_bcast_size + worker_bcast_align - 1) worker_bcast_size = (worker_bcast_size + worker_bcast_align - 1)
& ~(worker_bcast_align - 1); & ~(worker_bcast_align - 1);
fprintf (asm_out_file, "// BEGIN VAR DEF: %s\n", worker_bcast_name); fprintf (asm_out_file, "\n// BEGIN VAR DEF: %s\n", worker_bcast_name);
fprintf (asm_out_file, ".shared .align %d .u8 %s[%d];\n", fprintf (asm_out_file, ".shared .align %d .u8 %s[%d];\n",
worker_bcast_align, worker_bcast_align,
worker_bcast_name, worker_bcast_size); worker_bcast_name, worker_bcast_size);
...@@ -3992,7 +3993,7 @@ nvptx_file_end (void) ...@@ -3992,7 +3993,7 @@ nvptx_file_end (void)
worker_red_size = ((worker_red_size + worker_red_align - 1) worker_red_size = ((worker_red_size + worker_red_align - 1)
& ~(worker_red_align - 1)); & ~(worker_red_align - 1));
fprintf (asm_out_file, "// BEGIN VAR DEF: %s\n", worker_red_name); fprintf (asm_out_file, "\n// BEGIN VAR DEF: %s\n", worker_red_name);
fprintf (asm_out_file, ".shared .align %d .u8 %s[%d];\n", fprintf (asm_out_file, ".shared .align %d .u8 %s[%d];\n",
worker_red_align, worker_red_align,
worker_red_name, worker_red_size); worker_red_name, worker_red_size);
......
...@@ -304,7 +304,7 @@ struct GTY(()) machine_function ...@@ -304,7 +304,7 @@ struct GTY(()) machine_function
#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \ #define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
do \ do \
{ \ { \
fprintf (FILE, "// BEGIN%s VAR DEF: ", \ fprintf (FILE, "\n// BEGIN%s VAR DEF: ", \
TREE_PUBLIC (DECL) ? " GLOBAL" : ""); \ TREE_PUBLIC (DECL) ? " GLOBAL" : ""); \
assemble_name_raw (FILE, NAME); \ assemble_name_raw (FILE, NAME); \
fputc ('\n', FILE); \ fputc ('\n', FILE); \
...@@ -322,7 +322,7 @@ struct GTY(()) machine_function ...@@ -322,7 +322,7 @@ struct GTY(()) machine_function
#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \ #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
do \ do \
{ \ { \
fprintf (FILE, "// BEGIN VAR DEF: "); \ fprintf (FILE, "\n// BEGIN VAR DEF: "); \
assemble_name_raw (FILE, NAME); \ assemble_name_raw (FILE, NAME); \
fputc ('\n', FILE); \ fputc ('\n', FILE); \
const char *sec = nvptx_section_for_decl (DECL); \ const char *sec = nvptx_section_for_decl (DECL); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment