[llvm-commits] [llvm-gcc-4.2] r79100 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-types.cpp
Bob Wilson
bob.wilson at apple.com
Sat Aug 15 08:08:10 PDT 2009
Author: bwilson
Date: Sat Aug 15 10:08:10 2009
New Revision: 79100
URL: http://llvm.org/viewvc/llvm-project?rev=79100&view=rev
Log:
Use CallingConv::ID consistently instead of unsigned to hold the CC.
Patch by Sandeep Patel.
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-types.cpp
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=79100&r1=79099&r2=79100&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Sat Aug 15 10:08:10 2009
@@ -1578,7 +1578,7 @@
// when we have something like __builtin_memset and memset in the same file.
Function *FnEntry = TheModule->getFunction(Name);
if (FnEntry == 0) {
- unsigned CC;
+ CallingConv::ID CC;
AttrListPtr PAL;
const FunctionType *Ty =
TheTypeConverter->ConvertFunctionType(TREE_TYPE(decl), decl, NULL,
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=79100&r1=79099&r2=79100&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Sat Aug 15 10:08:10 2009
@@ -408,7 +408,7 @@
// Determine the FunctionType and calling convention for this function.
tree static_chain = cfun->static_chain_decl;
const FunctionType *FTy;
- unsigned CallingConv;
+ CallingConv::ID CallingConv;
AttrListPtr PAL;
// If the function has no arguments and is varargs (...), turn it into a
@@ -2614,7 +2614,7 @@
TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == BLOCK_POINTER_TYPE)
&& "Not calling a function pointer?");
tree function_type = TREE_TYPE(TREE_TYPE (TREE_OPERAND (exp, 0)));
- unsigned CallingConv;
+ CallingConv::ID CallingConv;
AttrListPtr PAL;
const Type *Ty = TheTypeConverter->ConvertFunctionType(function_type,
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=79100&r1=79099&r2=79100&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Sat Aug 15 10:08:10 2009
@@ -32,6 +32,7 @@
#include <cassert>
#include <map>
#include <string>
+#include "llvm/CallingConv.h"
#include "llvm/Intrinsics.h"
#include "llvm/ADT/IndexedMap.h"
#include "llvm/ADT/SmallVector.h"
@@ -157,7 +158,7 @@
const FunctionType *ConvertFunctionType(tree_node *type,
tree_node *decl,
tree_node *static_chain,
- unsigned &CallingConv,
+ CallingConv::ID &CallingConv,
AttrListPtr &PAL);
/// ConvertArgListToFnType - Given a DECL_ARGUMENTS list on an GCC tree,
@@ -166,7 +167,7 @@
const FunctionType *ConvertArgListToFnType(tree_node *type,
tree_node *arglist,
tree_node *static_chain,
- unsigned &CallingConv,
+ CallingConv::ID &CallingConv,
AttrListPtr &PAL);
private:
Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=79100&r1=79099&r2=79100&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Sat Aug 15 10:08:10 2009
@@ -851,7 +851,7 @@
return Ty;
// No declaration to pass through, passing NULL.
- unsigned CallingConv;
+ CallingConv::ID CallingConv;
AttrListPtr PAL;
return TypeDB.setType(type, ConvertFunctionType(type, NULL, NULL,
CallingConv, PAL));
@@ -926,13 +926,13 @@
class FunctionTypeConversion : public DefaultABIClient {
PATypeHolder &RetTy;
std::vector<PATypeHolder> &ArgTypes;
- unsigned &CallingConv;
+ CallingConv::ID &CallingConv;
bool isShadowRet;
bool KNRPromotion;
unsigned Offset;
public:
FunctionTypeConversion(PATypeHolder &retty, std::vector<PATypeHolder> &AT,
- unsigned &CC, bool KNR)
+ CallingConv::ID &CC, bool KNR)
: RetTy(retty), ArgTypes(AT), CallingConv(CC), KNRPromotion(KNR), Offset(0) {
CallingConv = CallingConv::C;
isShadowRet = false;
@@ -1047,7 +1047,7 @@
/// specified result type for the function.
const FunctionType *TypeConverter::
ConvertArgListToFnType(tree type, tree Args, tree static_chain,
- unsigned &CallingConv, AttrListPtr &PAL) {
+ CallingConv::ID &CallingConv, AttrListPtr &PAL) {
tree ReturnType = TREE_TYPE(type);
std::vector<PATypeHolder> ArgTys;
PATypeHolder RetTy(Type::getVoidTy(Context));
@@ -1111,7 +1111,7 @@
const FunctionType *TypeConverter::
ConvertFunctionType(tree type, tree decl, tree static_chain,
- unsigned &CallingConv, AttrListPtr &PAL) {
+ CallingConv::ID &CallingConv, AttrListPtr &PAL) {
PATypeHolder RetTy = Type::getVoidTy(Context);
std::vector<PATypeHolder> ArgTypes;
bool isVarArg = false;
More information about the llvm-commits
mailing list