[llvm-commits] [dragonegg] r97396 - in /dragonegg/trunk: llvm-abi-default.cpp llvm-abi.h llvm-convert.cpp llvm-types.cpp
Duncan Sands
baldrick at free.fr
Sun Feb 28 05:33:34 PST 2010
Author: baldrick
Date: Sun Feb 28 07:33:34 2010
New Revision: 97396
URL: http://llvm.org/viewvc/llvm-project?rev=97396&view=rev
Log:
Port commit 96305 (rafael) from llvm-gcc:
Merge SVR4ABI and DefaultABI.
8 files changed, 134 insertions(+), 497 deletions(-)
Modified:
dragonegg/trunk/llvm-abi-default.cpp
dragonegg/trunk/llvm-abi.h
dragonegg/trunk/llvm-convert.cpp
dragonegg/trunk/llvm-types.cpp
Modified: dragonegg/trunk/llvm-abi-default.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-abi-default.cpp?rev=97396&r1=97395&r2=97396&view=diff
==============================================================================
--- dragonegg/trunk/llvm-abi-default.cpp (original)
+++ dragonegg/trunk/llvm-abi-default.cpp Sun Feb 28 07:33:34 2010
@@ -95,6 +95,9 @@
C.HandleScalarArgument(Ty, type);
ScalarElts.push_back(Ty);
}
+ } else if (LLVM_TRY_PASS_AGGREGATE_CUSTOM(type, ScalarElts,
+ C.getCallingConv(), &C)) {
+ // Nothing to do.
} else if (Ty->isSingleValueType()) {
C.HandleScalarArgument(Ty, type);
ScalarElts.push_back(Ty);
Modified: dragonegg/trunk/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-abi.h?rev=97396&r1=97395&r2=97396&view=diff
==============================================================================
--- dragonegg/trunk/llvm-abi.h (original)
+++ dragonegg/trunk/llvm-abi.h Sun Feb 28 07:33:34 2010
@@ -252,6 +252,11 @@
return NULL;
}
+#ifndef LLVM_TRY_PASS_AGGREGATE_CUSTOM
+#define LLVM_TRY_PASS_AGGREGATE_CUSTOM(T, E, CC, C) \
+ false
+#endif
+
// LLVM_SHOULD_PASS_VECTOR_IN_INTEGER_REGS - Return true if this vector
// type should be passed as integer registers. Generally vectors which are
// not part of the target architecture should do this.
@@ -418,37 +423,4 @@
std::vector<const Type*> &ScalarElts);
};
-// Similar to DefaultABI but for linux ppc 32 bits
-class SVR4ABI{
- // Number of general purpose argument registers which have already been
- // assigned.
-protected:
- DefaultABIClient &C;
-public:
- SVR4ABI(DefaultABIClient &c);
-
- bool isShadowReturn() const;
- void HandleReturnType(tree type, tree fn, bool isBuiltin);
- void HandleArgument(tree type, std::vector<const Type*> &ScalarElts,
- Attributes *Attributes = NULL);
- void HandleUnion(tree type, std::vector<const Type*> &ScalarElts);
- void PassInIntegerRegisters(tree type, std::vector<const Type*> &ScalarElts,
- unsigned origSize, bool DontCheckAlignment);
- void PassInMixedRegisters(const Type *Ty, std::vector<const Type*> &OrigElts,
- std::vector<const Type*> &ScalarElts);
-
-};
-
-// Make sure the SVR4 ABI is used on 32-bit PowerPC Linux.
-#if defined(POWERPC_LINUX) && (TARGET_64BIT == 0)
-#define TheLLVMABI SVR4ABI
-#endif
-
-/// TheLLVMABI - This can be defined by targets if they want total control over
-/// ABI decisions.
-///
-#ifndef TheLLVMABI
-#define TheLLVMABI DefaultABI
-#endif
-
#endif /* LLVM_ABI_H */
Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=97396&r1=97395&r2=97396&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Sun Feb 28 07:33:34 2010
@@ -709,7 +709,7 @@
// Rename and alloca'ify real arguments.
FunctionPrologArgumentConversion Client(FnDecl, AI, Builder, CallingConv);
- TheLLVMABI ABIConverter(Client);
+ DefaultABI ABIConverter(Client);
// Handle the DECL_RESULT.
ABIConverter.HandleReturnType(TREE_TYPE(TREE_TYPE(FnDecl)), FnDecl,
@@ -2666,7 +2666,7 @@
FunctionCallArgumentConversion Client(CallOperands, FTy, DestLoc,
gimple_call_return_slot_opt_p(stmt),
Builder, CallingConvention);
- TheLLVMABI ABIConverter(Client);
+ DefaultABI ABIConverter(Client);
// Handle the result, including struct returns.
ABIConverter.HandleReturnType(gimple_call_return_type(stmt),
Modified: dragonegg/trunk/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-types.cpp?rev=97396&r1=97395&r2=97396&view=diff
==============================================================================
--- dragonegg/trunk/llvm-types.cpp (original)
+++ dragonegg/trunk/llvm-types.cpp Sun Feb 28 07:33:34 2010
@@ -1006,7 +1006,7 @@
PATypeHolder RetTy(Type::getVoidTy(Context));
FunctionTypeConversion Client(RetTy, ArgTys, CallingConv, true /*K&R*/);
- TheLLVMABI ABIConverter(Client);
+ DefaultABI ABIConverter(Client);
#ifdef TARGET_ADJUST_LLVM_CC
TARGET_ADJUST_LLVM_CC(CallingConv, type);
@@ -1069,7 +1069,7 @@
std::vector<PATypeHolder> ArgTypes;
bool isVarArg = false;
FunctionTypeConversion Client(RetTy, ArgTypes, CallingConv, false/*not K&R*/);
- TheLLVMABI ABIConverter(Client);
+ DefaultABI ABIConverter(Client);
// Allow the target to set the CC for things like fastcall etc.
#ifdef TARGET_ADJUST_LLVM_CC
More information about the llvm-commits
mailing list