[llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c
Chris Lattner
lattner at cs.uiuc.edu
Sat Nov 27 16:07:39 PST 2004
Changes in directory llvm-gcc/gcc:
llvm-expand.c updated: 1.66 -> 1.67
---
Log message:
Renaming was moved elsewhere in GCC, and one of our merges from the GCC tree
didn't notice that this broke. This removes code to more closely match the
make_decl_rtl function, which make_decl_llvm is supposed to match.
This fixes CFrontend/2004-11-27-StaticFunctionRedeclare.c and PR244: http://llvm.cs.uiuc.edu/PR244 (again).
---
Diffs of the changes: (+3 -20)
Index: llvm-gcc/gcc/llvm-expand.c
diff -u llvm-gcc/gcc/llvm-expand.c:1.66 llvm-gcc/gcc/llvm-expand.c:1.67
--- llvm-gcc/gcc/llvm-expand.c:1.66 Sat Nov 27 17:24:55 2004
+++ llvm-gcc/gcc/llvm-expand.c Sat Nov 27 18:07:26 2004
@@ -7012,7 +7012,7 @@
extern int decode_reg_name(const char *);
void llvm_make_decl_llvm(tree decl, const char *asmspec) {
int top_level = (DECL_CONTEXT (decl) == NULL_TREE);
- const char *name = 0, *new_name = 0;
+ const char *name = 0;
int reg_number;
/* Check that we are not being given an automatic variable. */
@@ -7035,7 +7035,7 @@
if (DECL_LLVM_SET_P(decl))
return;
- new_name = name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
reg_number = decode_reg_name (asmspec);
if (reg_number == -2) {
@@ -7044,7 +7044,7 @@
char *starred = alloca (strlen (asmspec) + 2);
starred[0] = '*';
strcpy (starred + 1, asmspec);
- new_name = starred;
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (starred));
}
if (TREE_CODE(decl) != FUNCTION_DECL && DECL_REGISTER(decl)) {
@@ -7064,23 +7064,6 @@
if (TREE_CODE (decl) == VAR_DECL && DECL_WEAK (decl))
DECL_COMMON (decl) = 0;
- /* Can't use just the variable's own name for a variable whose scope is less
- than the whole file, unless it's a member of a local class (which will
- already be unambiguous). Concatenate a distinguishing number. */
- if (!top_level && !TREE_PUBLIC (decl)
- && !(DECL_CONTEXT (decl) && TYPE_P (DECL_CONTEXT (decl)))
- && name == IDENTIFIER_POINTER (DECL_NAME (decl))) {
- static int var_labelno = 0;
- char *label = (char*)alloca(strlen(name) + 32);
- sprintf(label, ".%s_%d", name, ++var_labelno);
- new_name = label;
- }
-
- if (name != new_name) {
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (new_name));
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
- }
-
llvm_assemble_external(decl);
}
More information about the llvm-commits
mailing list