Removed trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170367 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael Ilseman 2012-12-17 20:37:55 +00:00
parent 316a5aa0a5
commit 0f47e7e019

View File

@ -62,11 +62,11 @@ void Argument::setParent(Function *parent) {
} }
/// getArgNo - Return the index of this formal argument in its containing /// getArgNo - Return the index of this formal argument in its containing
/// function. For example in "void foo(int a, float b)" a is 0 and b is 1. /// function. For example in "void foo(int a, float b)" a is 0 and b is 1.
unsigned Argument::getArgNo() const { unsigned Argument::getArgNo() const {
const Function *F = getParent(); const Function *F = getParent();
assert(F && "Argument is not in a function"); assert(F && "Argument is not in a function");
Function::const_arg_iterator AI = F->arg_begin(); Function::const_arg_iterator AI = F->arg_begin();
unsigned ArgIdx = 0; unsigned ArgIdx = 0;
for (; &*AI != this; ++AI) for (; &*AI != this; ++AI)
@ -86,7 +86,7 @@ bool Argument::hasByValAttr() const {
unsigned Argument::getParamAlignment() const { unsigned Argument::getParamAlignment() const {
assert(getType()->isPointerTy() && "Only pointers have alignments"); assert(getType()->isPointerTy() && "Only pointers have alignments");
return getParent()->getParamAlignment(getArgNo()+1); return getParent()->getParamAlignment(getArgNo()+1);
} }
/// hasNestAttr - Return true if this argument has the nest attribute on /// hasNestAttr - Return true if this argument has the nest attribute on
@ -168,7 +168,7 @@ void Function::eraseFromParent() {
Function::Function(FunctionType *Ty, LinkageTypes Linkage, Function::Function(FunctionType *Ty, LinkageTypes Linkage,
const Twine &name, Module *ParentModule) const Twine &name, Module *ParentModule)
: GlobalValue(PointerType::getUnqual(Ty), : GlobalValue(PointerType::getUnqual(Ty),
Value::FunctionVal, 0, 0, Linkage, name) { Value::FunctionVal, 0, 0, Linkage, name) {
assert(FunctionType::isValidReturnType(getReturnType()) && assert(FunctionType::isValidReturnType(getReturnType()) &&
"invalid return type"); "invalid return type");
@ -177,7 +177,7 @@ Function::Function(FunctionType *Ty, LinkageTypes Linkage,
// If the function has arguments, mark them as lazily built. // If the function has arguments, mark them as lazily built.
if (Ty->getNumParams()) if (Ty->getNumParams())
setValueSubclassData(1); // Set the "has lazy arguments" bit. setValueSubclassData(1); // Set the "has lazy arguments" bit.
// Make sure that we get added to a function // Make sure that we get added to a function
LeakDetector::addGarbageObject(this); LeakDetector::addGarbageObject(this);
@ -209,7 +209,7 @@ void Function::BuildLazyArguments() const {
"Cannot have void typed arguments!"); "Cannot have void typed arguments!");
ArgumentList.push_back(new Argument(FT->getParamType(i))); ArgumentList.push_back(new Argument(FT->getParamType(i)));
} }
// Clear the lazy arguments bit. // Clear the lazy arguments bit.
unsigned SDC = getSubclassDataFromValue(); unsigned SDC = getSubclassDataFromValue();
const_cast<Function*>(this)->setValueSubclassData(SDC &= ~1); const_cast<Function*>(this)->setValueSubclassData(SDC &= ~1);
@ -241,7 +241,7 @@ void Function::setParent(Module *parent) {
void Function::dropAllReferences() { void Function::dropAllReferences() {
for (iterator I = begin(), E = end(); I != E; ++I) for (iterator I = begin(), E = end(); I != E; ++I)
I->dropAllReferences(); I->dropAllReferences();
// Delete all basic blocks. They are now unused, except possibly by // Delete all basic blocks. They are now unused, except possibly by
// blockaddresses, but BasicBlock's destructor takes care of those. // blockaddresses, but BasicBlock's destructor takes care of those.
while (!BasicBlocks.empty()) while (!BasicBlocks.empty())
@ -330,7 +330,7 @@ unsigned Function::getIntrinsicID() const {
return 0; return 0;
unsigned Len = ValName->getKeyLength(); unsigned Len = ValName->getKeyLength();
const char *Name = ValName->getKeyData(); const char *Name = ValName->getKeyData();
if (Len < 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l' if (Len < 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l'
|| Name[2] != 'v' || Name[3] != 'm') || Name[2] != 'v' || Name[3] != 'm')
return 0; // All intrinsics start with 'llvm.' return 0; // All intrinsics start with 'llvm.'
@ -354,7 +354,7 @@ std::string Intrinsic::getName(ID id, ArrayRef<Type*> Tys) {
std::string Result(Table[id]); std::string Result(Table[id]);
for (unsigned i = 0; i < Tys.size(); ++i) { for (unsigned i = 0; i < Tys.size(); ++i) {
if (PointerType* PTyp = dyn_cast<PointerType>(Tys[i])) { if (PointerType* PTyp = dyn_cast<PointerType>(Tys[i])) {
Result += ".p" + llvm::utostr(PTyp->getAddressSpace()) + Result += ".p" + llvm::utostr(PTyp->getAddressSpace()) +
EVT::getEVT(PTyp->getElementType()).getEVTString(); EVT::getEVT(PTyp->getElementType()).getEVTString();
} }
else if (Tys[i]) else if (Tys[i])
@ -386,7 +386,7 @@ enum IIT_Info {
IIT_MMX = 13, IIT_MMX = 13,
IIT_PTR = 14, IIT_PTR = 14,
IIT_ARG = 15, IIT_ARG = 15,
// Values from 16+ are only encodable with the inefficient encoding. // Values from 16+ are only encodable with the inefficient encoding.
IIT_METADATA = 16, IIT_METADATA = 16,
IIT_EMPTYSTRUCT = 17, IIT_EMPTYSTRUCT = 17,
@ -405,7 +405,7 @@ static void DecodeIITType(unsigned &NextElt, ArrayRef<unsigned char> Infos,
IIT_Info Info = IIT_Info(Infos[NextElt++]); IIT_Info Info = IIT_Info(Infos[NextElt++]);
unsigned StructElts = 2; unsigned StructElts = 2;
using namespace Intrinsic; using namespace Intrinsic;
switch (Info) { switch (Info) {
case IIT_Done: case IIT_Done:
OutputTable.push_back(IITDescriptor::get(IITDescriptor::Void, 0)); OutputTable.push_back(IITDescriptor::get(IITDescriptor::Void, 0));
@ -462,7 +462,7 @@ static void DecodeIITType(unsigned &NextElt, ArrayRef<unsigned char> Infos,
DecodeIITType(NextElt, Infos, OutputTable); DecodeIITType(NextElt, Infos, OutputTable);
return; return;
case IIT_ANYPTR: { // [ANYPTR addrspace, subtype] case IIT_ANYPTR: { // [ANYPTR addrspace, subtype]
OutputTable.push_back(IITDescriptor::get(IITDescriptor::Pointer, OutputTable.push_back(IITDescriptor::get(IITDescriptor::Pointer,
Infos[NextElt++])); Infos[NextElt++]));
DecodeIITType(NextElt, Infos, OutputTable); DecodeIITType(NextElt, Infos, OutputTable);
return; return;
@ -506,11 +506,11 @@ static void DecodeIITType(unsigned &NextElt, ArrayRef<unsigned char> Infos,
#include "llvm/Intrinsics.gen" #include "llvm/Intrinsics.gen"
#undef GET_INTRINSIC_GENERATOR_GLOBAL #undef GET_INTRINSIC_GENERATOR_GLOBAL
void Intrinsic::getIntrinsicInfoTableEntries(ID id, void Intrinsic::getIntrinsicInfoTableEntries(ID id,
SmallVectorImpl<IITDescriptor> &T){ SmallVectorImpl<IITDescriptor> &T){
// Check to see if the intrinsic's type was expressible by the table. // Check to see if the intrinsic's type was expressible by the table.
unsigned TableVal = IIT_Table[id-1]; unsigned TableVal = IIT_Table[id-1];
// Decode the TableVal into an array of IITValues. // Decode the TableVal into an array of IITValues.
SmallVector<unsigned char, 8> IITValues; SmallVector<unsigned char, 8> IITValues;
ArrayRef<unsigned char> IITEntries; ArrayRef<unsigned char> IITEntries;
@ -518,7 +518,7 @@ void Intrinsic::getIntrinsicInfoTableEntries(ID id,
if ((TableVal >> 31) != 0) { if ((TableVal >> 31) != 0) {
// This is an offset into the IIT_LongEncodingTable. // This is an offset into the IIT_LongEncodingTable.
IITEntries = IIT_LongEncodingTable; IITEntries = IIT_LongEncodingTable;
// Strip sentinel bit. // Strip sentinel bit.
NextElt = (TableVal << 1) >> 1; NextElt = (TableVal << 1) >> 1;
} else { } else {
@ -528,7 +528,7 @@ void Intrinsic::getIntrinsicInfoTableEntries(ID id,
IITValues.push_back(TableVal & 0xF); IITValues.push_back(TableVal & 0xF);
TableVal >>= 4; TableVal >>= 4;
} while (TableVal); } while (TableVal);
IITEntries = IITValues; IITEntries = IITValues;
NextElt = 0; NextElt = 0;
} }
@ -545,14 +545,14 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
using namespace Intrinsic; using namespace Intrinsic;
IITDescriptor D = Infos.front(); IITDescriptor D = Infos.front();
Infos = Infos.slice(1); Infos = Infos.slice(1);
switch (D.Kind) { switch (D.Kind) {
case IITDescriptor::Void: return Type::getVoidTy(Context); case IITDescriptor::Void: return Type::getVoidTy(Context);
case IITDescriptor::MMX: return Type::getX86_MMXTy(Context); case IITDescriptor::MMX: return Type::getX86_MMXTy(Context);
case IITDescriptor::Metadata: return Type::getMetadataTy(Context); case IITDescriptor::Metadata: return Type::getMetadataTy(Context);
case IITDescriptor::Float: return Type::getFloatTy(Context); case IITDescriptor::Float: return Type::getFloatTy(Context);
case IITDescriptor::Double: return Type::getDoubleTy(Context); case IITDescriptor::Double: return Type::getDoubleTy(Context);
case IITDescriptor::Integer: case IITDescriptor::Integer:
return IntegerType::get(Context, D.Integer_Width); return IntegerType::get(Context, D.Integer_Width);
case IITDescriptor::Vector: case IITDescriptor::Vector:
@ -573,7 +573,7 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,
case IITDescriptor::ExtendVecArgument: case IITDescriptor::ExtendVecArgument:
return VectorType::getExtendedElementVectorType(cast<VectorType>( return VectorType::getExtendedElementVectorType(cast<VectorType>(
Tys[D.getArgumentNumber()])); Tys[D.getArgumentNumber()]));
case IITDescriptor::TruncVecArgument: case IITDescriptor::TruncVecArgument:
return VectorType::getTruncatedElementVectorType(cast<VectorType>( return VectorType::getTruncatedElementVectorType(cast<VectorType>(
Tys[D.getArgumentNumber()])); Tys[D.getArgumentNumber()]));
@ -587,15 +587,15 @@ FunctionType *Intrinsic::getType(LLVMContext &Context,
ID id, ArrayRef<Type*> Tys) { ID id, ArrayRef<Type*> Tys) {
SmallVector<IITDescriptor, 8> Table; SmallVector<IITDescriptor, 8> Table;
getIntrinsicInfoTableEntries(id, Table); getIntrinsicInfoTableEntries(id, Table);
ArrayRef<IITDescriptor> TableRef = Table; ArrayRef<IITDescriptor> TableRef = Table;
Type *ResultTy = DecodeFixedType(TableRef, Tys, Context); Type *ResultTy = DecodeFixedType(TableRef, Tys, Context);
SmallVector<Type*, 8> ArgTys; SmallVector<Type*, 8> ArgTys;
while (!TableRef.empty()) while (!TableRef.empty())
ArgTys.push_back(DecodeFixedType(TableRef, Tys, Context)); ArgTys.push_back(DecodeFixedType(TableRef, Tys, Context));
return FunctionType::get(ResultTy, ArgTys, false); return FunctionType::get(ResultTy, ArgTys, false);
} }
bool Intrinsic::isOverloaded(ID id) { bool Intrinsic::isOverloaded(ID id) {