[llvm] r241375 - Use a continue to reduce indentation.
Rafael Espindola
rafael.espindola at gmail.com
Fri Jul 3 15:02:28 PDT 2015
Author: rafael
Date: Fri Jul 3 17:02:28 2015
New Revision: 241375
URL: http://llvm.org/viewvc/llvm-project?rev=241375&view=rev
Log:
Use a continue to reduce indentation.
Modified:
llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
Modified: llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp?rev=241375&r1=241374&r2=241375&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp Fri Jul 3 17:02:28 2015
@@ -88,26 +88,27 @@ void OProfileJITEventListener::NotifyObj
// Use symbol info to iterate functions in the object.
for (const std::pair<SymbolRef, uint64_t> &P : computeSymbolSizes(DebugObj)) {
SymbolRef Sym = P.first;
- if (Sym.getType() == SymbolRef::ST_Function) {
- ErrorOr<StringRef> NameOrErr = Sym.getName();
- if (NameOrErr.getError())
- continue;
- StringRef Name = *NameOrErr;
- ErrorOr<uint64_t> AddrOrErr = Sym.getAddress();
- if (AddrOrErr.getError())
- continue;
- uint64_t Addr = *AddrOrErr;
- uint64_t Size = P.second;
+ if (Sym.getType() != SymbolRef::ST_Function)
+ continue;
- if (Wrapper->op_write_native_code(Name.data(), Addr, (void*)Addr, Size)
- == -1) {
- DEBUG(dbgs() << "Failed to tell OProfile about native function "
- << Name << " at ["
- << (void*)Addr << "-" << ((char*)Addr + Size) << "]\n");
- continue;
- }
- // TODO: support line number info (similar to IntelJITEventListener.cpp)
+ ErrorOr<StringRef> NameOrErr = Sym.getName();
+ if (NameOrErr.getError())
+ continue;
+ StringRef Name = *NameOrErr;
+ ErrorOr<uint64_t> AddrOrErr = Sym.getAddress();
+ if (AddrOrErr.getError())
+ continue;
+ uint64_t Addr = *AddrOrErr;
+ uint64_t Size = P.second;
+
+ if (Wrapper->op_write_native_code(Name.data(), Addr, (void *)Addr, Size) ==
+ -1) {
+ DEBUG(dbgs() << "Failed to tell OProfile about native function " << Name
+ << " at [" << (void *)Addr << "-" << ((char *)Addr + Size)
+ << "]\n");
+ continue;
}
+ // TODO: support line number info (similar to IntelJITEventListener.cpp)
}
DebugObjects[Obj.getData().data()] = std::move(DebugObjOwner);
More information about the llvm-commits
mailing list