[llvm-commits] [llvm-gcc-4.0] r48647 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-debug.cpp llvm-internal.h llvm-types.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Fri Mar 21 09:03:29 PDT 2008
Author: alenhar2
Date: Fri Mar 21 11:03:27 2008
New Revision: 48647
URL: http://llvm.org/viewvc/llvm-project?rev=48647&view=rev
Log:
Back up to working condition
Modified:
llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.0/trunk/gcc/llvm-debug.cpp
llvm-gcc-4.0/trunk/gcc/llvm-internal.h
llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp?rev=48647&r1=48646&r2=48647&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp Fri Mar 21 11:03:27 2008
@@ -1008,7 +1008,7 @@
Function *FnEntry = TheModule->getFunction(Name);
if (FnEntry == 0) {
unsigned CC;
- const ParamAttrsList *PAL;
+ PAListPtr PAL;
const FunctionType *Ty =
TheTypeConverter->ConvertFunctionType(TREE_TYPE(decl), decl, NULL,
CC, PAL);
Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp?rev=48647&r1=48646&r2=48647&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Fri Mar 21 11:03:27 2008
@@ -34,7 +34,7 @@
#include "llvm/InlineAsm.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
-#include "llvm/ParamAttrsList.h"
+#include "llvm/ParameterAttributes.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Target/TargetAsmInfo.h"
@@ -516,7 +516,7 @@
tree static_chain = cfun->static_chain_decl;
const FunctionType *FTy;
unsigned CallingConv;
- const ParamAttrsList *PAL;
+ PAListPtr PAL;
// If the function has no arguments and is varargs (...), turn it into a
// non-varargs function by scanning the param list for the function. This
@@ -2748,7 +2748,7 @@
&& "Not calling a function pointer?");
tree function_type = TREE_TYPE(TREE_TYPE (TREE_OPERAND (exp, 0)));
unsigned CallingConv;
- const ParamAttrsList *PAL;
+ PAListPtr PAL;
const Type *Ty = TheTypeConverter->ConvertFunctionType(function_type,
fndecl,
@@ -2899,7 +2899,11 @@
/// in the CALL_EXP 'exp'. If the result of the call is a scalar, return the
/// result, otherwise store it in DestLoc.
Value *TreeToLLVM::EmitCallOf(Value *Callee, tree exp, const MemRef *DestLoc,
- const ParamAttrsList *PAL) {
+ const PAListPtr &InPAL) {
+ PAListPtr PAL = InPAL;
+ if (PAL.isEmpty() && isa<Function>(Callee))
+ PAL = cast<Function>(Callee)->getParamAttrs();
+
// Determine if we need to generate an invoke instruction (instead of a simple
// call) and if so, what the exception destination will be.
BasicBlock *UnwindBlock = 0;
@@ -2961,7 +2965,7 @@
ParameterAttributes Attributes = ParamAttr::None;
ABIConverter.HandleArgument(TREE_TYPE(TREE_VALUE(arg)), &Attributes);
if (Attributes != ParamAttr::None)
- PAL= ParamAttrsList::includeAttrs(PAL, CallOperands.size(), Attributes);
+ PAL = PAL.addAttr(CallOperands.size(), Attributes);
}
}
@@ -3866,13 +3870,13 @@
/// Return a ParamAttrsList for the given function return attributes.
-const ParamAttrsList *getReturnAttrs(uint16_t attrs) {
+PAListPtr getReturnAttrs(uint16_t attrs) {
if (attrs == ParamAttr::None)
- return NULL;
+ return PAListPtr();
- ParamAttrsVector Attrs;
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
Attrs.push_back(ParamAttrsWithIndex::get(0, attrs));
- return ParamAttrsList::get(Attrs);
+ return PAListPtr::get(Attrs.begin(), Attrs.end());
}
/// Reads from register variables are handled by emitting an inline asm node
@@ -4507,7 +4511,7 @@
Intrinsic::getDeclaration(TheModule, IntrinsicID);
}
- Result = EmitCallOf(TargetBuiltinCache[FnCode], exp, DestLoc, 0);
+ Result = EmitCallOf(TargetBuiltinCache[FnCode], exp, DestLoc, PAListPtr());
return true;
}
Modified: llvm-gcc-4.0/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-debug.cpp?rev=48647&r1=48646&r2=48647&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-debug.cpp Fri Mar 21 11:03:27 2008
@@ -322,6 +322,10 @@
/// region - "llvm.dbg.declare."
void DebugInfo::EmitDeclare(tree decl, unsigned Tag, const char *Name,
tree type, Value *AI, BasicBlock *CurBB) {
+ // Ignore compiler generated temporaries.
+ if (DECL_IGNORED_P(decl))
+ return;
+
// Lazily construct llvm.dbg.declare function.
const PointerType *EmpPtr = SR.getEmptyStructPtrType();
if (!DeclareFn)
Modified: llvm-gcc-4.0/trunk/gcc/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-internal.h?rev=48647&r1=48646&r2=48647&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-internal.h Fri Mar 21 11:03:27 2008
@@ -33,6 +33,7 @@
#include <map>
#include <string>
#include "llvm/Intrinsics.h"
+#include "llvm/ParameterAttributes.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Support/DataTypes.h"
@@ -143,7 +144,7 @@
tree_node *decl,
tree_node *static_chain,
unsigned &CallingConv,
- const ParamAttrsList *&PAL);
+ PAListPtr &PAL);
/// ConvertArgListToFnType - Given a DECL_ARGUMENTS list on an GCC tree,
/// return the LLVM type corresponding to the function. This is useful for
@@ -152,7 +153,7 @@
tree_node *arglist,
tree_node *static_chain,
unsigned &CallingConv,
- const ParamAttrsList *&PAL);
+ PAListPtr &PAL);
private:
const Type *ConvertRECORD(tree_node *type, tree_node *orig_type);
@@ -541,7 +542,7 @@
Value *EmitOBJ_TYPE_REF(tree_node *exp);
Value *EmitCALL_EXPR(tree_node *exp, const MemRef *DestLoc);
Value *EmitCallOf(Value *Callee, tree_node *exp, const MemRef *DestLoc,
- const ParamAttrsList *PAL);
+ const PAListPtr& PAL);
Value *EmitMODIFY_EXPR(tree_node *exp, const MemRef *DestLoc);
Value *EmitNOP_EXPR(tree_node *exp, const MemRef *DestLoc);
Value *EmitCONVERT_EXPR(tree_node *exp, const MemRef *DestLoc);
Modified: llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-types.cpp?rev=48647&r1=48646&r2=48647&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Fri Mar 21 11:03:27 2008
@@ -29,7 +29,6 @@
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/TypeSymbolTable.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
@@ -812,8 +811,7 @@
// No declaration to pass through, passing NULL.
unsigned CallingConv;
- const ParamAttrsList *PAL;
-
+ PAListPtr PAL;
return TypeDB.setType(type, ConvertFunctionType(type, NULL, NULL,
CallingConv, PAL));
}
@@ -960,7 +958,7 @@
/// specified result type for the function.
const FunctionType *TypeConverter::
ConvertArgListToFnType(tree ReturnType, tree Args, tree static_chain,
- unsigned &CallingConv, const ParamAttrsList *&PAL) {
+ unsigned &CallingConv, PAListPtr &PAL) {
std::vector<PATypeHolder> ArgTys;
PATypeHolder RetTy(Type::VoidTy);
@@ -969,7 +967,7 @@
ABIConverter.HandleReturnType(ReturnType);
- ParamAttrsVector Attrs;
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
// Compute whether the result needs to be zext or sext'd.
ParameterAttributes RAttributes = HandleArgumentExtension(ReturnType);
@@ -1004,16 +1002,13 @@
Attrs.push_back(ParamAttrsWithIndex::get(ArgTys.size(), Attributes));
}
- PAL = 0;
- if (!Attrs.empty())
- PAL = ParamAttrsList::get(Attrs);
-
+ PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
return GetFunctionType(RetTy, ArgTys, false);
}
const FunctionType *TypeConverter::
ConvertFunctionType(tree type, tree decl, tree static_chain,
- unsigned &CallingConv, const ParamAttrsList *&PAL) {
+ unsigned &CallingConv, PAListPtr& PAL) {
PATypeHolder RetTy = Type::VoidTy;
std::vector<PATypeHolder> ArgTypes;
bool isVarArg = false;
@@ -1028,7 +1023,7 @@
#endif
// Compute attributes for return type (and function attributes).
- ParamAttrsVector Attrs;
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
ParameterAttributes RAttributes = ParamAttr::None;
int flags = flags_from_decl_or_type(decl ? decl : type);
@@ -1144,8 +1139,8 @@
// write to struct arguments passed by value, but in LLVM this becomes a
// write through the byval pointer argument, which LLVM does not allow for
// readonly/readnone functions.
- if (HasByVal && Attrs[0].index == 0) {
- ParameterAttributes &RAttrs = Attrs[0].attrs;
+ if (HasByVal && Attrs[0].Index == 0) {
+ ParameterAttributes &RAttrs = Attrs[0].Attrs;
RAttrs &= ~(ParamAttr::ReadNone | ParamAttr::ReadOnly);
if (RAttrs == ParamAttr::None)
Attrs.erase(Attrs.begin());
@@ -1155,12 +1150,8 @@
isVarArg = (Args == 0);
assert(RetTy && "Return type not specified!");
- // Only instantiate the parameter attributes if we got some.
- PAL = 0;
- if (!Attrs.empty())
- PAL = ParamAttrsList::get(Attrs);
-
- // Finally, make the function type
+ // Finally, make the function type and result attributes.
+ PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
return GetFunctionType(RetTy, ArgTypes, isVarArg);
}
More information about the llvm-commits
mailing list