[dragonegg] r176812 - Format with clang-format.
Duncan Sands
baldrick at free.fr
Mon Mar 11 10:14:04 PDT 2013
Author: baldrick
Date: Mon Mar 11 12:14:04 2013
New Revision: 176812
URL: http://llvm.org/viewvc/llvm-project?rev=176812&view=rev
Log:
Format with clang-format.
Modified:
dragonegg/trunk/include/arm/dragonegg/Target.h
dragonegg/trunk/include/dragonegg/ABI.h
dragonegg/trunk/include/dragonegg/ADT/IntervalList.h
dragonegg/trunk/include/dragonegg/Debug.h
dragonegg/trunk/include/dragonegg/Internals.h
dragonegg/trunk/include/x86/dragonegg/Target.h
dragonegg/trunk/src/Backend.cpp
dragonegg/trunk/src/Convert.cpp
dragonegg/trunk/src/Debug.cpp
dragonegg/trunk/src/x86/Target.cpp
Modified: dragonegg/trunk/include/arm/dragonegg/Target.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/arm/dragonegg/Target.h?rev=176812&r1=176811&r2=176812&view=diff
==============================================================================
--- dragonegg/trunk/include/arm/dragonegg/Target.h (original)
+++ dragonegg/trunk/include/arm/dragonegg/Target.h Mon Mar 11 12:14:04 2013
@@ -324,8 +324,8 @@ extern bool llvm_arm_should_pass_or_retu
return true. This macro is invoked from a method in the TreeToLLVM class. */
#if 0
// Because of data dependency, we will implement later on.
-#define LLVM_TARGET_INTRINSIC_LOWER(EXP, BUILTIN_CODE, DESTLOC, RESULT, DESTTY,\
- OPS) \
+#define LLVM_TARGET_INTRINSIC_LOWER(EXP, BUILTIN_CODE, DESTLOC, RESULT, \
+ DESTTY, OPS) \
TargetIntrinsicLower(EXP, BUILTIN_CODE, DESTLOC, RESULT, DESTTY, OPS);
#endif
@@ -336,10 +336,14 @@ extern bool llvm_arm_should_pass_or_retu
so use the incoming register name if it exists. Otherwise, use the default
register names to match the backend. */
#define LLVM_GET_REG_NAME(REG_NAME, REG_NUM) \
- ((REG_NUM) == 10 ? "r10" : (REG_NUM) == \
- 11 ? "r11" : (REG_NUM) == \
- 12 ? "r12" : (REG_NUM) >= FIRST_VFP_REGNUM && \
- REG_NAME != 0 ? REG_NAME : reg_names[REG_NUM])
+ ((REG_NUM) == 10 ? "r10" : (REG_NUM) == 11 \
+ ? "r11" \
+ : (REG_NUM) == 12 \
+ ? "r12" \
+ : (REG_NUM) >= FIRST_VFP_REGNUM && \
+ REG_NAME != 0 \
+ ? REG_NAME \
+ : reg_names[REG_NUM])
/* Define a static enumeration of the NEON builtins to be used when
converting to LLVM intrinsics. These names are derived from the
Modified: dragonegg/trunk/include/dragonegg/ABI.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/dragonegg/ABI.h?rev=176812&r1=176811&r2=176812&view=diff
==============================================================================
--- dragonegg/trunk/include/dragonegg/ABI.h (original)
+++ dragonegg/trunk/include/dragonegg/ABI.h Mon Mar 11 12:14:04 2013
@@ -54,8 +54,7 @@ struct DefaultABIClient {
/// within the struct, and ScalarTy is not necessarily big enough to cover
/// the entire struct.
virtual void HandleAggregateResultAsScalar(Type */*ScalarTy*/,
- unsigned /*Offset*/ = 0) {
- }
+ unsigned /*Offset*/ = 0) {}
/// HandleAggregateResultAsAggregate - This callback is invoked if the function
/// returns an aggregate value using multiple return values.
@@ -66,36 +65,31 @@ struct DefaultABIClient {
/// a pointer to the aggregate, of type PtrArgTy. If RetPtr is set to true,
/// the pointer argument itself is returned from the function.
virtual void HandleAggregateShadowResult(PointerType */*PtrArgTy*/,
- bool /*RetPtr*/) {
- }
+ bool /*RetPtr*/) {}
/// HandleScalarShadowResult - This callback is invoked if the function
/// returns a scalar value by using a "shadow" first parameter, which is a
/// pointer to the scalar, of type PtrArgTy. If RetPtr is set to true,
/// the pointer argument itself is returned from the function.
virtual void HandleScalarShadowResult(PointerType */*PtrArgTy*/,
- bool /*RetPtr*/) {
- }
+ bool /*RetPtr*/) {}
/// HandleScalarArgument - This is the primary callback that specifies an
/// LLVM argument to pass. It is only used for first class types.
/// If RealSize is non Zero then it specifies number of bytes to access
/// from LLVMTy.
virtual void HandleScalarArgument(llvm::Type */*LLVMTy*/, tree_node */*type*/,
- unsigned /*RealSize*/ = 0) {
- }
+ unsigned /*RealSize*/ = 0) {}
/// HandleByInvisibleReferenceArgument - This callback is invoked if a pointer
/// (of type PtrTy) to the argument is passed rather than the argument itself.
virtual void HandleByInvisibleReferenceArgument(llvm::Type */*PtrTy*/,
- tree_node */*type*/) {
- }
+ tree_node */*type*/) {}
/// HandleByValArgument - This callback is invoked if the aggregate function
/// argument is passed by value.
virtual void HandleByValArgument(llvm::Type */*LLVMTy*/,
- tree_node */*type*/) {
- }
+ tree_node */*type*/) {}
/// HandleFCAArgument - This callback is invoked if the aggregate function
/// argument is passed by value as a first class aggregate.
Modified: dragonegg/trunk/include/dragonegg/ADT/IntervalList.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/dragonegg/ADT/IntervalList.h?rev=176812&r1=176811&r2=176812&view=diff
==============================================================================
--- dragonegg/trunk/include/dragonegg/ADT/IntervalList.h (original)
+++ dragonegg/trunk/include/dragonegg/ADT/IntervalList.h Mon Mar 11 12:14:04 2013
@@ -61,8 +61,8 @@ template <class T, typename U, unsigned
for (unsigned i = 0, e = (unsigned) Intervals.size(); i < e; ++i) {
if (Intervals[i].getRange().empty())
return false;
- if (i && Intervals[i].getRange().getFirst() < Intervals[i - 1]
- .getRange().getLast())
+ if (i && Intervals[i].getRange().getFirst() <
+ Intervals[i - 1].getRange().getLast())
return false;
}
return true;
Modified: dragonegg/trunk/include/dragonegg/Debug.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/dragonegg/Debug.h?rev=176812&r1=176811&r2=176812&view=diff
==============================================================================
--- dragonegg/trunk/include/dragonegg/Debug.h (original)
+++ dragonegg/trunk/include/dragonegg/Debug.h Mon Mar 11 12:14:04 2013
@@ -54,7 +54,7 @@ class DIFactory {
Function *DeclareFn; // llvm.dbg.declare
Function *ValueFn; // llvm.dbg.value
- DIFactory(const DIFactory &)LLVM_DELETED_FUNCTION;
+ DIFactory(const DIFactory &) LLVM_DELETED_FUNCTION;
void operator=(const DIFactory &)LLVM_DELETED_FUNCTION;
public:
enum ComplexAddrKind {
Modified: dragonegg/trunk/include/dragonegg/Internals.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/dragonegg/Internals.h?rev=176812&r1=176811&r2=176812&view=diff
==============================================================================
--- dragonegg/trunk/include/dragonegg/Internals.h (original)
+++ dragonegg/trunk/include/dragonegg/Internals.h Mon Mar 11 12:14:04 2013
@@ -197,8 +197,7 @@ public:
explicit LValue() : BitStart(255), BitSize(255) {}
explicit LValue(MemRef &M) : MemRef(M), BitStart(255), BitSize(255) {}
LValue(Value *P, uint32_t A, bool V = false)
- : MemRef(P, A, V), BitStart(255), BitSize(255) {
- }
+ : MemRef(P, A, V), BitStart(255), BitSize(255) {}
LValue(Value *P, uint32_t A, unsigned BSt, unsigned BSi, bool V = false)
: MemRef(P, A, V), BitStart((unsigned char) BSt),
BitSize((unsigned char) BSi) {
Modified: dragonegg/trunk/include/x86/dragonegg/Target.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/x86/dragonegg/Target.h?rev=176812&r1=176811&r2=176812&view=diff
==============================================================================
--- dragonegg/trunk/include/x86/dragonegg/Target.h (original)
+++ dragonegg/trunk/include/x86/dragonegg/Target.h Mon Mar 11 12:14:04 2013
@@ -39,8 +39,8 @@ namespace llvm { class SubtargetFeatures
#define TARGET_ADJUST_LLVM_RETATTR(type, AttrBuilder) \
{ \
tree_node *type_attributes = TYPE_ATTRIBUTES(type); \
- if (!TARGET_64BIT && \
- (TARGET_SSEREGPARM || lookup_attribute("sseregparm", type_attributes)))\
+ if (!TARGET_64BIT && (TARGET_SSEREGPARM || \
+ lookup_attribute("sseregparm", type_attributes))) \
AttrBuilder.addAttribute(Attribute::InReg); \
}
@@ -213,8 +213,9 @@ extern bool llvm_x86_64_aggregate_partia
std::vector<Type *> &, std::vector<Type *> &, bool);
#define LLVM_AGGREGATE_PARTIALLY_PASSED_IN_REGS(E, SE, ISR, CC) \
- (TARGET_64BIT ? llvm_x86_64_aggregate_partially_passed_in_regs( \
- (E), (SE), (ISR)) : false)
+ (TARGET_64BIT \
+ ? llvm_x86_64_aggregate_partially_passed_in_regs((E), (SE), (ISR)) \
+ : false)
#endif /* DRAGONEGG_ABI_H */
@@ -286,7 +287,8 @@ extern const char *llvm_x86_override_tar
* macro should call the target TreeToLLVM::TargetIntrinsicLower method and
* return true.This macro is invoked from a method in the TreeToLLVM class.
*/
-#define LLVM_TARGET_INTRINSIC_LOWER(STMT, FNDECL, DESTLOC, RESULT, DESTTY, OPS)\
+#define LLVM_TARGET_INTRINSIC_LOWER(STMT, FNDECL, DESTLOC, RESULT, DESTTY, \
+ OPS) \
TargetIntrinsicLower(STMT, FNDECL, DESTLOC, RESULT, DESTTY, OPS);
/* LLVM_GET_REG_NAME - When extracting a register name for a constraint, use
Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=176812&r1=176811&r2=176812&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Mon Mar 11 12:14:04 2013
@@ -1820,8 +1820,9 @@ static void llvm_finish_unit(void */*gcc
if (!AttributeUsedGlobals.empty()) {
std::vector<Constant *> AUGs;
Type *SBP = Type::getInt8PtrTy(Context);
- for (SmallSetVector<Constant *, 32>::iterator AI =
- AttributeUsedGlobals.begin(), AE = AttributeUsedGlobals.end();
+ for (SmallSetVector<Constant *, 32>::iterator
+ AI = AttributeUsedGlobals.begin(),
+ AE = AttributeUsedGlobals.end();
AI != AE; ++AI) {
Constant *C = *AI;
AUGs.push_back(TheFolder->CreateBitCast(C, SBP));
@@ -1839,9 +1840,9 @@ static void llvm_finish_unit(void */*gcc
if (!AttributeCompilerUsedGlobals.empty()) {
std::vector<Constant *> ACUGs;
Type *SBP = Type::getInt8PtrTy(Context);
- for (SmallSetVector<Constant *, 32>::iterator AI =
- AttributeCompilerUsedGlobals
- .begin(), AE = AttributeCompilerUsedGlobals.end();
+ for (SmallSetVector<Constant *, 32>::iterator
+ AI = AttributeCompilerUsedGlobals.begin(),
+ AE = AttributeCompilerUsedGlobals.end();
AI != AE; ++AI) {
Constant *C = *AI;
ACUGs.push_back(TheFolder->CreateBitCast(C, SBP));
@@ -1914,21 +1915,20 @@ static void llvm_finish(void */*gcc_data
static bool gate_null(void) { return false; }
/// pass_gimple_null - Gimple pass that does nothing.
-static struct gimple_opt_pass pass_gimple_null = {
- { GIMPLE_PASS, "*gimple_null", /* name */
- gate_null, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
-}
-};
+static struct gimple_opt_pass pass_gimple_null = { {
+ GIMPLE_PASS, "*gimple_null", /* name */
+ gate_null, /* gate */
+ NULL, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0 /* todo_flags_finish */
+} };
/// execute_correct_state - Correct the cgraph state to ensure that newly
/// inserted functions are processed before being converted to LLVM IR.
@@ -1943,21 +1943,20 @@ static bool gate_correct_state(void) { r
/// pass_gimple_correct_state - Gimple pass that corrects the cgraph state so
/// newly inserted functions are processed before being converted to LLVM IR.
-static struct gimple_opt_pass pass_gimple_correct_state = {
- { GIMPLE_PASS, "*gimple_correct_state", /* name */
- gate_correct_state, /* gate */
- execute_correct_state, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
-}
-};
+static struct gimple_opt_pass pass_gimple_correct_state = { {
+ GIMPLE_PASS, "*gimple_correct_state", /* name */
+ gate_correct_state, /* gate */
+ execute_correct_state, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0 /* todo_flags_finish */
+} };
/// pass_ipa_null - IPA pass that does nothing.
static struct ipa_opt_pass_d pass_ipa_null = {
@@ -1973,7 +1972,8 @@ static struct ipa_opt_pass_d pass_ipa_nu
0, /* properties_destroyed */
0, /* todo_flags_start */
0 /* todo_flags_finish */
-}, NULL, /* generate_summary */
+},
+ NULL, /* generate_summary */
NULL, /* write_summary */
NULL, /* read_summary */
#if (GCC_MINOR > 5)
@@ -2004,21 +2004,20 @@ static struct rtl_opt_pass pass_rtl_null
} };
/// pass_simple_ipa_null - Simple IPA pass that does nothing.
-static struct simple_ipa_opt_pass pass_simple_ipa_null = {
- { SIMPLE_IPA_PASS, "*simple_ipa_null", /* name */
- gate_null, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
-}
-};
+static struct simple_ipa_opt_pass pass_simple_ipa_null = { {
+ SIMPLE_IPA_PASS, "*simple_ipa_null", /* name */
+ gate_null, /* gate */
+ NULL, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0 /* todo_flags_finish */
+} };
// Garbage collector roots.
extern const struct ggc_cache_tab gt_ggc_rc__gt_cache_h[];
@@ -2060,7 +2059,7 @@ static bool version_check(struct plugin_
int __attribute__((visibility("default"))) plugin_init(
struct plugin_name_args *plugin_info, struct plugin_gcc_version *
#ifndef DISABLE_VERSION_CHECK
- version
+ version
#endif
) {
const char *plugin_name = plugin_info->base_name;
Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=176812&r1=176811&r2=176812&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Mon Mar 11 12:14:04 2013
@@ -725,8 +725,7 @@ struct FunctionPrologArgumentConversion
FunctionPrologArgumentConversion(tree FnDecl, Function::arg_iterator &ai,
const LLVMBuilder &B, CallingConv::ID &CC)
: FunctionDecl(FnDecl), AI(ai), Builder(B), CallingConv(CC), Offset(0),
- isShadowRet(false) {
- }
+ isShadowRet(false) {}
/// getCallingConv - This provides the desired CallingConv for the function.
CallingConv::ID getCallingConv(void) { return CallingConv; }
@@ -823,15 +822,16 @@ struct FunctionPrologArgumentConversion
// the smaller alignment.
Type *SBP = Type::getInt8PtrTy(Context);
Type *IntPtr = getDataLayout().getIntPtrType(Context, 0);
- Value *Ops[5] = { Builder.CreateCast(Instruction::BitCast, Loc, SBP),
- Builder.CreateCast(Instruction::BitCast, AI, SBP),
- ConstantInt::get(
- IntPtr, TREE_INT_CST_LOW(TYPE_SIZE_UNIT(type))),
- Builder.getInt32(LLVM_BYVAL_ALIGNMENT(type)),
- Builder.getFalse() };
+ Value *Ops[5] = {
+ Builder.CreateCast(Instruction::BitCast, Loc, SBP),
+ Builder.CreateCast(Instruction::BitCast, AI, SBP),
+ ConstantInt::get(IntPtr, TREE_INT_CST_LOW(TYPE_SIZE_UNIT(type))),
+ Builder.getInt32(LLVM_BYVAL_ALIGNMENT(type)), Builder.getFalse()
+ };
Type *ArgTypes[3] = { SBP, SBP, IntPtr };
- Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::memcpy,
- ArgTypes), Ops);
+ Builder.CreateCall(
+ Intrinsic::getDeclaration(TheModule, Intrinsic::memcpy, ArgTypes),
+ Ops);
AI->setName(NameStack.back());
}
@@ -1133,7 +1133,8 @@ void TreeToLLVM::StartFunctionBody() {
SSAInsertionPoint = Builder.Insert(
CastInst::Create(Instruction::BitCast,
Constant::getNullValue(Type::getInt32Ty(Context)),
- Type::getInt32Ty(Context)), "ssa point");
+ Type::getInt32Ty(Context)),
+ "ssa point");
// If this function has nested functions, we should handle a potential
// nonlocal_goto_save_area.
@@ -1333,11 +1334,10 @@ Function *TreeToLLVM::FinishFunctionBody
if (ReturnOffset) {
ResultLV.Ptr = Builder
.CreateBitCast(ResultLV.Ptr, Type::getInt8PtrTy(Context));
- ResultLV.Ptr =
- Builder.CreateGEP(ResultLV.Ptr,
- ConstantInt::get(DL.getIntPtrType(Context, 0),
- ReturnOffset),
- flag_verbose_asm ? "rtvl" : "");
+ ResultLV.Ptr = Builder.CreateGEP(
+ ResultLV.Ptr,
+ ConstantInt::get(DL.getIntPtrType(Context, 0), ReturnOffset),
+ flag_verbose_asm ? "rtvl" : "");
ResultLV.setAlignment(
MinAlign(ResultLV.getAlignment(), ReturnOffset));
ResultSize -= ReturnOffset;
@@ -1432,8 +1432,9 @@ Function *TreeToLLVM::FinishFunctionBody
#else
// When checks are enabled, complain if an SSA name was used but not defined.
#endif
- for (DenseMap<tree, TrackingVH<Value> >::const_iterator I =
- SSANames.begin(), E = SSANames.end();
+ for (DenseMap<tree, TrackingVH<Value> >::const_iterator
+ I = SSANames.begin(),
+ E = SSANames.end();
I != E; ++I) {
Value *NameDef = I->second;
// If this is not a placeholder then the SSA name was defined.
@@ -1656,8 +1657,9 @@ void TreeToLLVM::EmitAggregate(tree exp,
}
LValue LV = EmitLV(exp);
assert(!LV.isBitfield() && "Bitfields containing aggregates not supported!");
- EmitAggregateCopy(DestLoc, MemRef(LV.Ptr, LV.getAlignment(),
- TREE_THIS_VOLATILE(exp)), TREE_TYPE(exp));
+ EmitAggregateCopy(DestLoc,
+ MemRef(LV.Ptr, LV.getAlignment(), TREE_THIS_VOLATILE(exp)),
+ TREE_TYPE(exp));
}
/// get_constant_alignment - Return the alignment of constant EXP in bits.
@@ -2826,8 +2828,9 @@ Value *TreeToLLVM::EmitLoadOfLValue(tree
// Shift the sign bit of the bitfield to the sign bit position in the loaded
// type. This zaps any extra bits occurring after the end of the bitfield.
- unsigned FirstBitInVal = BYTES_BIG_ENDIAN ? LoadSizeInBits - LV.BitStart -
- LV.BitSize : LV.BitStart;
+ unsigned FirstBitInVal =
+ BYTES_BIG_ENDIAN ? LoadSizeInBits - LV.BitStart - LV.BitSize
+ : LV.BitStart;
if (FirstBitInVal + LV.BitSize != LoadSizeInBits) {
Value *ShAmt = ConstantInt::get(LoadType, LoadSizeInBits -
(FirstBitInVal + LV.BitSize));
@@ -2861,7 +2864,8 @@ Value *TreeToLLVM::EmitADDR_EXPR(tree ex
Value *TreeToLLVM::EmitCondExpr(tree exp) {
return TriviallyTypeConvert(
EmitReg_CondExpr(TREE_OPERAND(exp, 0), TREE_OPERAND(exp, 1),
- TREE_OPERAND(exp, 2)), getRegType(TREE_TYPE(exp)));
+ TREE_OPERAND(exp, 2)),
+ getRegType(TREE_TYPE(exp)));
}
#endif
@@ -2995,8 +2999,7 @@ struct FunctionCallArgumentConversion :
bool ReturnSlotOpt, LLVMBuilder &b, CallingConv::ID &CC)
: CallOperands(ops), FTy(FnTy), DestLoc(destloc), Builder(b),
CallingConv(CC), Offset(0), isShadowRet(false), isAggrRet(false),
- useReturnSlot(ReturnSlotOpt) {
- }
+ useReturnSlot(ReturnSlotOpt) {}
/// getCallingConv - This provides the desired CallingConv for the function.
CallingConv::ID getCallingConv(void) { return CallingConv; }
@@ -3337,8 +3340,8 @@ Value *TreeToLLVM::EmitCallOf(Value *Cal
// If the caller and callee disagree about a parameter type but the difference
// is trivial, correct the type used by the caller.
- for (unsigned i =
- 0, e = std::min((unsigned) CallOperands.size(), FTy->getNumParams());
+ for (unsigned i = 0, e = std::min((unsigned) CallOperands.size(),
+ FTy->getNumParams());
i != e; ++i) {
Type *ExpectedTy = FTy->getParamType(i);
Type *ActualTy = CallOperands[i]->getType();
@@ -5755,8 +5758,9 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
Size = Builder.getInt8(size);
Idx = Builder.getInt32(rnum);
Builder.CreateStore(
- Size, Builder.CreateGEP(Addr, Idx,
- flag_verbose_asm ? "rnum" : ""), false);
+ Size,
+ Builder.CreateGEP(Addr, Idx, flag_verbose_asm ? "rnum" : ""),
+ false);
}
}
@@ -6078,8 +6082,9 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
unsigned Alignment =
MinAlign(ArrayAlign, DL.getABITypeAlignment(EltTy));
return LValue(
- Builder.CreateBitCast(Ptr, PointerType::getUnqual(ConvertType(
- TREE_TYPE(exp)))), Alignment);
+ Builder.CreateBitCast(
+ Ptr, PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))),
+ Alignment);
}
// Otherwise, just do raw, low-level pointer arithmetic. FIXME: this could be
@@ -6119,8 +6124,9 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
? Builder.CreateInBoundsGEP(ArrayAddr, IndexVal, GEPName)
: Builder.CreateGEP(ArrayAddr, IndexVal, GEPName);
return LValue(
- Builder.CreateBitCast(Ptr, PointerType::getUnqual(ConvertType(
- TREE_TYPE(exp)))), Alignment);
+ Builder.CreateBitCast(
+ Ptr, PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))),
+ Alignment);
}
LValue TreeToLLVM::EmitLV_BIT_FIELD_REF(tree exp) {
@@ -6579,10 +6585,10 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
/// constant of the corresponding register type.
Constant *TreeToLLVM::EmitComplexRegisterConstant(tree reg) {
tree elt_type = TREE_TYPE(TREE_TYPE(reg));
- Constant *Elts[2] = { EmitRegisterConstantWithCast(TREE_REALPART(reg),
- elt_type),
- EmitRegisterConstantWithCast(TREE_IMAGPART(reg),
- elt_type) };
+ Constant *Elts[2] = {
+ EmitRegisterConstantWithCast(TREE_REALPART(reg), elt_type),
+ EmitRegisterConstantWithCast(TREE_IMAGPART(reg), elt_type)
+ };
return ConstantStruct::getAnon(Elts);
}
@@ -7056,8 +7062,10 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
Value *Val = EmitRegister(op);
Type *Ty = Val->getType();
- CmpInst::Predicate Pred = CmpInst::Predicate(isa<FLOAT_TYPE>(TREE_TYPE(
- op)) ? FPPred : TYPE_UNSIGNED(TREE_TYPE(op)) ? UIPred : SIPred);
+ CmpInst::Predicate Pred = CmpInst::Predicate(
+ isa<FLOAT_TYPE>(TREE_TYPE(op)) ? FPPred : TYPE_UNSIGNED(TREE_TYPE(op))
+ ? UIPred
+ : SIPred);
unsigned Length = (unsigned) TYPE_VECTOR_SUBPARTS(TREE_TYPE(op));
assert(Length > 1 && !(Length & (Length - 1)) &&
@@ -7244,8 +7252,8 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
Amt->getName() + ".cast");
// Perform the shift.
- LHS = Builder.CreateBinOp(isLeftShift ? Instruction::Shl
- : Instruction::LShr, LHS, Amt);
+ LHS = Builder.CreateBinOp(
+ isLeftShift ? Instruction::Shl : Instruction::LShr, LHS, Amt);
// Turn the result back into a vector.
return Builder.CreateBitCast(LHS, VecTy);
@@ -8037,14 +8045,14 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
for (unsigned i = 0; i != NumInputs; ++i) {
tree Input = gimple_asm_input_op(stmt, i);
unsigned NumInputChoices = 1;
- for (const char *p =
- TREE_STRING_POINTER(TREE_VALUE(TREE_PURPOSE(Input)));
+ for (const char *
+ p = TREE_STRING_POINTER(TREE_VALUE(TREE_PURPOSE(Input)));
* p; ++p)
if (*p == ',')
++NumInputChoices;
if (NumChoices && (NumInputChoices != NumChoices)) {
- error(
- "operand constraints for %<asm%> differ in number of alternatives");
+ error("operand constraints for %<asm%> differ in number of "
+ "alternatives");
return;
}
if (NumChoices == 0)
@@ -8053,14 +8061,14 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
for (unsigned i = 0; i != NumOutputs; ++i) {
tree Output = gimple_asm_output_op(stmt, i);
unsigned NumOutputChoices = 1;
- for (const char *p =
- TREE_STRING_POINTER(TREE_VALUE(TREE_PURPOSE(Output)));
+ for (const char *
+ p = TREE_STRING_POINTER(TREE_VALUE(TREE_PURPOSE(Output)));
* p; ++p)
if (*p == ',')
++NumOutputChoices;
if (NumChoices && (NumOutputChoices != NumChoices)) {
- error(
- "operand constraints for %<asm%> differ in number of alternatives");
+ error("operand constraints for %<asm%> differ in number of "
+ "alternatives");
return;
}
if (NumChoices == 0)
@@ -8299,9 +8307,9 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
Op = CastToAnyType(Op, IsSigned, OTy,
CallResultTypes[OutputIndex].second);
} else {
- error(
- "unsupported inline asm: input constraint with a matching "
- "output constraint of incompatible type!");
+ error("unsupported inline asm: input constraint with a "
+ "matching "
+ "output constraint of incompatible type!");
return;
}
} else if (OTyBits > OpTyBits) {
@@ -8309,9 +8317,9 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
// mentioned in the asm string then we cannot safely promote it, so
// bail out.
if (isOperandMentioned(stmt, NumOutputs + i)) {
- error(
- "unsupported inline asm: input constraint with a matching "
- "output constraint of incompatible type!");
+ error("unsupported inline asm: input constraint with a "
+ "matching "
+ "output constraint of incompatible type!");
return;
}
Op = CastToAnyType(Op, IsSigned, OTy,
@@ -8468,8 +8476,9 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
// If the call produces a value, store it into the destination.
for (unsigned i = 0, NumResults = (unsigned) CallResultTypes.size();
i != NumResults; ++i) {
- Value *Val = NumResults ==
- 1 ? CV : Builder.CreateExtractValue(CV, i, "asmresult");
+ Value *Val =
+ NumResults == 1 ? CV
+ : Builder.CreateExtractValue(CV, i, "asmresult");
bool ValIsSigned = CallResultTypes[i].second;
Value *Dest = CallResultDests[i].first;
@@ -9126,8 +9135,9 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
// with arguments none the less, then calculate the LLVM type from the list
// of arguments.
if (flag_functions_from_args) {
- tree *FirstArgAddr = gimple_call_num_args(stmt) >
- 0 ? gimple_call_arg_ptr(stmt, 0) : NULL;
+ tree *FirstArgAddr =
+ gimple_call_num_args(stmt) > 0 ? gimple_call_arg_ptr(stmt, 0)
+ : NULL;
Ty = ConvertArgListToFnType(
function_type,
ArrayRef<tree>(FirstArgAddr, gimple_call_num_args(stmt)),
@@ -9210,8 +9220,9 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
RHS = CastToAnyType(RHS, isSigned, LoadType, isSigned);
// Shift the right-hand side so that its bits are in the right position.
- unsigned FirstBitInVal = BYTES_BIG_ENDIAN ? LoadSizeInBits - LV.BitStart -
- LV.BitSize : LV.BitStart;
+ unsigned FirstBitInVal =
+ BYTES_BIG_ENDIAN ? LoadSizeInBits - LV.BitStart - LV.BitSize
+ : LV.BitStart;
if (FirstBitInVal) {
Value *ShAmt = ConstantInt::get(LoadType, FirstBitInVal);
RHS = Builder.CreateShl(RHS, ShAmt);
Modified: dragonegg/trunk/src/Debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Debug.cpp?rev=176812&r1=176811&r2=176812&view=diff
==============================================================================
--- dragonegg/trunk/src/Debug.cpp (original)
+++ dragonegg/trunk/src/Debug.cpp Mon Mar 11 12:14:04 2013
@@ -207,8 +207,7 @@ static StringRef getLinkageName(tree Nod
DebugInfo::DebugInfo(Module *m)
: DebugFactory(*m), CurFullPath(""), PrevFullPath(""), CurLineNo(0),
- PrevLineNo(0), PrevBB(NULL) {
-}
+ PrevLineNo(0), PrevBB(NULL) {}
/// getFunctionName - Get function name for the given FnDecl. If the
/// name is constructred on demand (e.g. C++ destructor) then the name
@@ -1069,8 +1068,7 @@ DIFile DebugInfo::getOrCreateFile(const
//===----------------------------------------------------------------------===//
DIFactory::DIFactory(Module &m)
- : M(m), VMContext(M.getContext()), Builder(M), DeclareFn(0), ValueFn(0) {
-}
+ : M(m), VMContext(M.getContext()), Builder(M), DeclareFn(0), ValueFn(0) {}
Constant *DIFactory::GetTagConstant(unsigned TAG) {
assert((TAG & LLVMDebugVersionMask) == 0 &&
Modified: dragonegg/trunk/src/x86/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/x86/Target.cpp?rev=176812&r1=176811&r2=176812&view=diff
==============================================================================
--- dragonegg/trunk/src/x86/Target.cpp (original)
+++ dragonegg/trunk/src/x86/Target.cpp Mon Mar 11 12:14:04 2013
@@ -290,9 +290,9 @@ bool TreeToLLVM::TargetIntrinsicLower(
case shufps:
if (ConstantInt *Elt = dyn_cast<ConstantInt>(Ops[2])) {
int EV = Elt->getZExtValue();
- Result = BuildVectorShuffle(
- Ops[0], Ops[1], ((EV & 0x03) >> 0), ((EV & 0x0c) >> 2),
- ((EV & 0x30) >> 4) + 4, ((EV & 0xc0) >> 6) + 4);
+ Result = BuildVectorShuffle(Ops[0], Ops[1], ((EV & 0x03) >> 0),
+ ((EV & 0x0c) >> 2), ((EV & 0x30) >> 4) + 4,
+ ((EV & 0xc0) >> 6) + 4);
} else {
error_at(gimple_location(stmt), "mask must be an immediate");
Result = Ops[0];
@@ -323,10 +323,10 @@ bool TreeToLLVM::TargetIntrinsicLower(
case pshufhw:
if (ConstantInt *Elt = dyn_cast<ConstantInt>(Ops[1])) {
int EV = Elt->getZExtValue();
- Result = BuildVectorShuffle(
- Ops[0], Ops[0], 0, 1, 2, 3, ((EV & 0x03) >> 0) + 4,
- ((EV & 0x0c) >> 2) + 4, ((EV & 0x30) >> 4) + 4,
- ((EV & 0xc0) >> 6) + 4);
+ Result =
+ BuildVectorShuffle(Ops[0], Ops[0], 0, 1, 2, 3, ((EV & 0x03) >> 0) + 4,
+ ((EV & 0x0c) >> 2) + 4, ((EV & 0x30) >> 4) + 4,
+ ((EV & 0xc0) >> 6) + 4);
return true;
}
return false;
More information about the llvm-commits
mailing list