whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190973 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Trick 2013-09-18 23:31:10 +00:00
parent c1fe3e3b33
commit 2cccc6220c
6 changed files with 33 additions and 33 deletions

View File

@ -97,7 +97,7 @@ LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID) {
return wrap(new Module(ModuleID, getGlobalContext())); return wrap(new Module(ModuleID, getGlobalContext()));
} }
LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID,
LLVMContextRef C) { LLVMContextRef C) {
return wrap(new Module(ModuleID, *unwrap(C))); return wrap(new Module(ModuleID, *unwrap(C)));
} }
@ -681,7 +681,7 @@ LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str,
return wrap(ConstantDataArray::getString(*unwrap(C), StringRef(Str, Length), return wrap(ConstantDataArray::getString(*unwrap(C), StringRef(Str, Length),
DontNullTerminate == 0)); DontNullTerminate == 0));
} }
LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef LLVMConstStructInContext(LLVMContextRef C,
LLVMValueRef *ConstantVals, LLVMValueRef *ConstantVals,
unsigned Count, LLVMBool Packed) { unsigned Count, LLVMBool Packed) {
Constant **Elements = unwrap<Constant>(ConstantVals, Count); Constant **Elements = unwrap<Constant>(ConstantVals, Count);
@ -1553,7 +1553,7 @@ LLVMAttribute LLVMGetAttribute(LLVMValueRef Arg) {
return (LLVMAttribute)A->getParent()->getAttributes(). return (LLVMAttribute)A->getParent()->getAttributes().
Raw(A->getArgNo()+1); Raw(A->getArgNo()+1);
} }
void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align) { void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align) {
Argument *A = unwrap<Argument>(Arg); Argument *A = unwrap<Argument>(Arg);
@ -1745,7 +1745,7 @@ void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC) {
llvm_unreachable("LLVMSetInstructionCallConv applies only to call and invoke!"); llvm_unreachable("LLVMSetInstructionCallConv applies only to call and invoke!");
} }
void LLVMAddInstrAttribute(LLVMValueRef Instr, unsigned index, void LLVMAddInstrAttribute(LLVMValueRef Instr, unsigned index,
LLVMAttribute PA) { LLVMAttribute PA) {
CallSite Call = CallSite(unwrap<Instruction>(Instr)); CallSite Call = CallSite(unwrap<Instruction>(Instr));
AttrBuilder B(PA); AttrBuilder B(PA);
@ -1755,7 +1755,7 @@ void LLVMAddInstrAttribute(LLVMValueRef Instr, unsigned index,
index, B))); index, B)));
} }
void LLVMRemoveInstrAttribute(LLVMValueRef Instr, unsigned index, void LLVMRemoveInstrAttribute(LLVMValueRef Instr, unsigned index,
LLVMAttribute PA) { LLVMAttribute PA) {
CallSite Call = CallSite(unwrap<Instruction>(Instr)); CallSite Call = CallSite(unwrap<Instruction>(Instr));
AttrBuilder B(PA); AttrBuilder B(PA);
@ -1765,7 +1765,7 @@ void LLVMRemoveInstrAttribute(LLVMValueRef Instr, unsigned index,
index, B))); index, B)));
} }
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,
unsigned align) { unsigned align) {
CallSite Call = CallSite(unwrap<Instruction>(Instr)); CallSite Call = CallSite(unwrap<Instruction>(Instr));
AttrBuilder B; AttrBuilder B;
@ -2119,8 +2119,8 @@ LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef B, LLVMTypeRef Ty,
Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext()); Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext());
Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty)); Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty));
AllocSize = ConstantExpr::getTruncOrBitCast(AllocSize, ITy); AllocSize = ConstantExpr::getTruncOrBitCast(AllocSize, ITy);
Instruction* Malloc = CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(), Instruction* Malloc = CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(),
ITy, unwrap(Ty), AllocSize, ITy, unwrap(Ty), AllocSize,
0, 0, ""); 0, 0, "");
return wrap(unwrap(B)->Insert(Malloc, Twine(Name))); return wrap(unwrap(B)->Insert(Malloc, Twine(Name)));
} }
@ -2130,8 +2130,8 @@ LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef B, LLVMTypeRef Ty,
Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext()); Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext());
Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty)); Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty));
AllocSize = ConstantExpr::getTruncOrBitCast(AllocSize, ITy); AllocSize = ConstantExpr::getTruncOrBitCast(AllocSize, ITy);
Instruction* Malloc = CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(), Instruction* Malloc = CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(),
ITy, unwrap(Ty), AllocSize, ITy, unwrap(Ty), AllocSize,
unwrap(Val), 0, ""); unwrap(Val), 0, "");
return wrap(unwrap(B)->Insert(Malloc, Twine(Name))); return wrap(unwrap(B)->Insert(Malloc, Twine(Name)));
} }
@ -2157,7 +2157,7 @@ LLVMValueRef LLVMBuildLoad(LLVMBuilderRef B, LLVMValueRef PointerVal,
return wrap(unwrap(B)->CreateLoad(unwrap(PointerVal), Name)); return wrap(unwrap(B)->CreateLoad(unwrap(PointerVal), Name));
} }
LLVMValueRef LLVMBuildStore(LLVMBuilderRef B, LLVMValueRef Val, LLVMValueRef LLVMBuildStore(LLVMBuilderRef B, LLVMValueRef Val,
LLVMValueRef PointerVal) { LLVMValueRef PointerVal) {
return wrap(unwrap(B)->CreateStore(unwrap(Val), unwrap(PointerVal))); return wrap(unwrap(B)->CreateStore(unwrap(Val), unwrap(PointerVal)));
} }
@ -2396,9 +2396,9 @@ LLVMValueRef LLVMBuildPtrDiff(LLVMBuilderRef B, LLVMValueRef LHS,
return wrap(unwrap(B)->CreatePtrDiff(unwrap(LHS), unwrap(RHS), Name)); return wrap(unwrap(B)->CreatePtrDiff(unwrap(LHS), unwrap(RHS), Name));
} }
LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op, LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op,
LLVMValueRef PTR, LLVMValueRef Val, LLVMValueRef PTR, LLVMValueRef Val,
LLVMAtomicOrdering ordering, LLVMAtomicOrdering ordering,
LLVMBool singleThread) { LLVMBool singleThread) {
AtomicRMWInst::BinOp intop; AtomicRMWInst::BinOp intop;
switch (op) { switch (op) {
@ -2421,14 +2421,14 @@ LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op,
case LLVMAtomicOrderingMonotonic: intordering = Monotonic; break; case LLVMAtomicOrderingMonotonic: intordering = Monotonic; break;
case LLVMAtomicOrderingAcquire: intordering = Acquire; break; case LLVMAtomicOrderingAcquire: intordering = Acquire; break;
case LLVMAtomicOrderingRelease: intordering = Release; break; case LLVMAtomicOrderingRelease: intordering = Release; break;
case LLVMAtomicOrderingAcquireRelease: case LLVMAtomicOrderingAcquireRelease:
intordering = AcquireRelease; intordering = AcquireRelease;
break; break;
case LLVMAtomicOrderingSequentiallyConsistent: case LLVMAtomicOrderingSequentiallyConsistent:
intordering = SequentiallyConsistent; intordering = SequentiallyConsistent;
break; break;
} }
return wrap(unwrap(B)->CreateAtomicRMW(intop, unwrap(PTR), unwrap(Val), return wrap(unwrap(B)->CreateAtomicRMW(intop, unwrap(PTR), unwrap(Val),
intordering, singleThread ? SingleThread : CrossThread)); intordering, singleThread ? SingleThread : CrossThread));
} }

View File

@ -1557,7 +1557,7 @@ bool FPPassManager::doInitialization(Module &M) {
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index)
Changed |= getContainedPass(Index)->doInitialization(M); Changed |= getContainedPass(Index)->doInitialization(M);
return Changed; return Changed;
} }
@ -1566,7 +1566,7 @@ bool FPPassManager::doFinalization(Module &M) {
for (int Index = getNumContainedPasses() - 1; Index >= 0; --Index) for (int Index = getNumContainedPasses() - 1; Index >= 0; --Index)
Changed |= getContainedPass(Index)->doFinalization(M); Changed |= getContainedPass(Index)->doFinalization(M);
return Changed; return Changed;
} }
@ -1634,7 +1634,7 @@ MPPassManager::runOnModule(Module &M) {
FPP->releaseMemoryOnTheFly(); FPP->releaseMemoryOnTheFly();
Changed |= FPP->doFinalization(M); Changed |= FPP->doFinalization(M);
} }
return Changed; return Changed;
} }

View File

@ -70,7 +70,7 @@ int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv); cl::ParseCommandLineOptions(argc, argv);
LLVMContext Context; LLVMContext Context;
// Load both modules. Die if that fails. // Load both modules. Die if that fails.
Module *LModule = ReadModule(Context, LeftFilename); Module *LModule = ReadModule(Context, LeftFilename);
Module *RModule = ReadModule(Context, RightFilename); Module *RModule = ReadModule(Context, RightFilename);

View File

@ -53,7 +53,7 @@ static cl::list<std::string>
ExtractFuncs("func", cl::desc("Specify function to extract"), ExtractFuncs("func", cl::desc("Specify function to extract"),
cl::ZeroOrMore, cl::value_desc("function")); cl::ZeroOrMore, cl::value_desc("function"));
// ExtractRegExpFuncs - The functions, matched via regular expression, to // ExtractRegExpFuncs - The functions, matched via regular expression, to
// extract from the module. // extract from the module.
static cl::list<std::string> static cl::list<std::string>
ExtractRegExpFuncs("rfunc", cl::desc("Specify function(s) to extract using a " ExtractRegExpFuncs("rfunc", cl::desc("Specify function(s) to extract using a "

View File

@ -70,7 +70,7 @@ int main(int argc, char **argv) {
// Print a stack trace if we signal out. // Print a stack trace if we signal out.
sys::PrintStackTraceOnErrorSignal(); sys::PrintStackTraceOnErrorSignal();
PrettyStackTraceProgram X(argc, argv); PrettyStackTraceProgram X(argc, argv);
LLVMContext &Context = getGlobalContext(); LLVMContext &Context = getGlobalContext();
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
cl::ParseCommandLineOptions(argc, argv, "llvm linker\n"); cl::ParseCommandLineOptions(argc, argv, "llvm linker\n");

View File

@ -131,7 +131,7 @@ namespace {
ProfileInfoLoader &PIL; ProfileInfoLoader &PIL;
public: public:
static char ID; // Class identification, replacement for typeinfo. static char ID; // Class identification, replacement for typeinfo.
explicit ProfileInfoPrinterPass(ProfileInfoLoader &_PIL) explicit ProfileInfoPrinterPass(ProfileInfoLoader &_PIL)
: ModulePass(ID), PIL(_PIL) {} : ModulePass(ID), PIL(_PIL) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@ -161,7 +161,7 @@ bool ProfileInfoPrinterPass::runOnModule(Module &M) {
if (FI->isDeclaration()) continue; if (FI->isDeclaration()) continue;
double w = ignoreMissing(PI.getExecutionCount(FI)); double w = ignoreMissing(PI.getExecutionCount(FI));
FunctionCounts.push_back(std::make_pair(FI, w)); FunctionCounts.push_back(std::make_pair(FI, w));
for (Function::iterator BB = FI->begin(), BBE = FI->end(); for (Function::iterator BB = FI->begin(), BBE = FI->end();
BB != BBE; ++BB) { BB != BBE; ++BB) {
double w = ignoreMissing(PI.getExecutionCount(BB)); double w = ignoreMissing(PI.getExecutionCount(BB));
Counts.push_back(std::make_pair(BB, w)); Counts.push_back(std::make_pair(BB, w));
@ -194,7 +194,7 @@ bool ProfileInfoPrinterPass::runOnModule(Module &M) {
outs() << " ## Frequency\n"; outs() << " ## Frequency\n";
for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i) { for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i) {
if (FunctionCounts[i].second == 0) { if (FunctionCounts[i].second == 0) {
outs() << "\n NOTE: " << e-i << " function" outs() << "\n NOTE: " << e-i << " function"
<< (e-i-1 ? "s were" : " was") << " never executed!\n"; << (e-i-1 ? "s were" : " was") << " never executed!\n";
break; break;
} }
@ -210,14 +210,14 @@ bool ProfileInfoPrinterPass::runOnModule(Module &M) {
TotalExecutions = 0; TotalExecutions = 0;
for (unsigned i = 0, e = Counts.size(); i != e; ++i) for (unsigned i = 0, e = Counts.size(); i != e; ++i)
TotalExecutions += Counts[i].second; TotalExecutions += Counts[i].second;
// Sort by the frequency, backwards. // Sort by the frequency, backwards.
sort(Counts.begin(), Counts.end(), sort(Counts.begin(), Counts.end(),
PairSecondSortReverse<BasicBlock*>()); PairSecondSortReverse<BasicBlock*>());
outs() << "\n===" << std::string(73, '-') << "===\n"; outs() << "\n===" << std::string(73, '-') << "===\n";
outs() << "Top 20 most frequently executed basic blocks:\n\n"; outs() << "Top 20 most frequently executed basic blocks:\n\n";
// Print out the function frequencies... // Print out the function frequencies...
outs() <<" ## %% \tFrequency\n"; outs() <<" ## %% \tFrequency\n";
unsigned BlocksToPrint = Counts.size(); unsigned BlocksToPrint = Counts.size();
@ -237,7 +237,7 @@ bool ProfileInfoPrinterPass::runOnModule(Module &M) {
if (PrintAnnotatedLLVM || PrintAllCode) { if (PrintAnnotatedLLVM || PrintAllCode) {
outs() << "\n===" << std::string(73, '-') << "===\n"; outs() << "\n===" << std::string(73, '-') << "===\n";
outs() << "Annotated LLVM code for the module:\n\n"; outs() << "Annotated LLVM code for the module:\n\n";
ProfileAnnotator PA(PI); ProfileAnnotator PA(PI);
if (FunctionsToPrint.empty() || PrintAllCode) if (FunctionsToPrint.empty() || PrintAllCode)
@ -259,7 +259,7 @@ int main(int argc, char **argv) {
LLVMContext &Context = getGlobalContext(); LLVMContext &Context = getGlobalContext();
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
cl::ParseCommandLineOptions(argc, argv, "llvm profile dump decoder\n"); cl::ParseCommandLineOptions(argc, argv, "llvm profile dump decoder\n");
// Read in the bitcode file... // Read in the bitcode file...