[llvm-commits] [llvm-gcc-4.2] r45044 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm.h
Dale Johannesen
dalej at apple.com
Fri Dec 14 15:16:28 PST 2007
Author: johannes
Date: Fri Dec 14 17:16:27 2007
New Revision: 45044
URL: http://llvm.org/viewvc/llvm-project?rev=45044&view=rev
Log:
Revise previous patch per review feedback.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/llvm-internal.h
llvm-gcc-4.2/trunk/gcc/llvm.h
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=45044&r1=45043&r2=45044&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Fri Dec 14 17:16:27 2007
@@ -913,7 +913,7 @@
/// well-formed. If not, emit error messages and return true. If so, return
/// false.
bool ValidateRegisterVariable(tree decl) {
- int RegNumber = decode_reg_name(llvm_get_register_name(decl));
+ int RegNumber = decode_reg_name(extractRegisterName(decl));
const Type *Ty = ConvertType(TREE_TYPE(decl));
// If this has already been processed, don't emit duplicate error messages.
@@ -1249,7 +1249,7 @@
// have been run through set_user_assembler_name which means they may
// have a leading \1 at this point; compensate.
-const char* llvm_get_register_name(tree decl) {
+const char* extractRegisterName(tree decl) {
const char* Name = IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(decl));
return (*Name==1) ? Name+1 : Name;
}
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=45044&r1=45043&r2=45044&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Dec 14 17:16:27 2007
@@ -3305,7 +3305,7 @@
// Turn this into a 'tmp = call Ty asm "", "={reg}"()'.
FunctionType *FTy = FunctionType::get(Ty, std::vector<const Type*>(),false);
- const char *Name = llvm_get_register_name(decl);
+ const char *Name = extractRegisterName(decl);
InlineAsm *IA = InlineAsm::get(FTy, "", "={"+std::string(Name)+"}", false);
return Builder.CreateCall(IA, "tmp");
}
@@ -3322,7 +3322,7 @@
ArgTys.push_back(ConvertType(TREE_TYPE(decl)));
FunctionType *FTy = FunctionType::get(Type::VoidTy, ArgTys, false);
- const char *Name = llvm_get_register_name(decl);
+ const char *Name = extractRegisterName(decl);
InlineAsm *IA = InlineAsm::get(FTy, "", "{"+std::string(Name)+"}", true);
Builder.CreateCall(IA, RHS);
}
@@ -3571,7 +3571,7 @@
// If this output register is pinned to a machine register, use that machine
// register instead of the specified constraint.
if (TREE_CODE(Operand) == VAR_DECL && DECL_HARD_REGISTER(Operand)) {
- int RegNum = decode_reg_name(llvm_get_register_name(Operand));
+ int RegNum = decode_reg_name(extractRegisterName(Operand));
if (RegNum >= 0) {
unsigned RegNameLen = strlen(reg_names[RegNum]);
char *NewConstraint = (char*)alloca(RegNameLen+4);
@@ -3683,7 +3683,7 @@
// register instead of the specified constraint.
int RegNum;
if (TREE_CODE(Val) == VAR_DECL && DECL_HARD_REGISTER(Val) &&
- (RegNum = decode_reg_name(llvm_get_register_name(Val))) >= 0) {
+ (RegNum = decode_reg_name(extractRegisterName(Val))) >= 0) {
ConstraintStr += '{';
ConstraintStr += reg_names[RegNum];
ConstraintStr += '}';
Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=45044&r1=45043&r2=45044&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Fri Dec 14 17:16:27 2007
@@ -110,6 +110,7 @@
void readLLVMValues();
void writeLLVMValues();
void clearTargetBuiltinCache();
+const char* extractRegisterName(union tree_node*);
struct StructTypeConversionInfo;
Modified: llvm-gcc-4.2/trunk/gcc/llvm.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm.h?rev=45044&r1=45043&r2=45044&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm.h Fri Dec 14 17:16:27 2007
@@ -105,11 +105,6 @@
* to the more concrete type new_type.
*/
void refine_type_to (union tree_node*, union tree_node*);
-
-/* llvm_get_register_name - extract a register name from a decl in format
- * pleasing to llvm.
- */
-const char* llvm_get_register_name(union tree_node*);
#endif /* ENABLE_LLVM */
#endif
More information about the llvm-commits
mailing list