summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/OProfileJIT
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-06-29 15:18:48 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-06-29 15:18:48 +0000
commitaa694a65a41a1363751a56b17142f0919d82868e (patch)
tree57cbb1c4e23a116f83780d7664a27e91415f77d4 /llvm/lib/ExecutionEngine/OProfileJIT
parent1b13ddea50d4ef62382c35d979b3b002c1ad4be9 (diff)
downloadbcm5719-llvm-aa694a65a41a1363751a56b17142f0919d82868e.tar.gz
bcm5719-llvm-aa694a65a41a1363751a56b17142f0919d82868e.zip
Upgrade JIT listeners for changes in the libObject API.
llvm-svn: 240956
Diffstat (limited to 'llvm/lib/ExecutionEngine/OProfileJIT')
-rw-r--r--llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp b/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
index 23e766206e2..b7203380526 100644
--- a/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
+++ b/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
@@ -20,6 +20,7 @@
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/Object/ObjectFile.h"
+#include "llvm/Object/SymbolSize.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errno.h"
#include "llvm/Support/raw_ostream.h"
@@ -85,17 +86,16 @@ void OProfileJITEventListener::NotifyObjectEmitted(
const ObjectFile &DebugObj = *DebugObjOwner.getBinary();
// Use symbol info to iterate functions in the object.
- for (symbol_iterator I = DebugObj.symbol_begin(), E = DebugObj.symbol_end();
- I != E; ++I) {
- SymbolRef::Type SymType;
- if (I->getType(SymType)) continue;
- if (SymType == SymbolRef::ST_Function) {
+ for (const std::pair<SymbolRef, uint64_t> &P : computeSymbolSizes(DebugObj)) {
+ SymbolRef Sym = P.first;
+ if (Sym.getType() == SymbolRef::ST_Function) {
StringRef Name;
uint64_t Addr;
- uint64_t Size;
- if (I->getName(Name)) continue;
- if (I->getAddress(Addr)) continue;
- if (I->getSize(Size)) continue;
+ if (Sym.getName(Name))
+ continue;
+ if (Sym.getAddress(Addr))
+ continue;
+ uint64_t Size = P.second;
if (Wrapper->op_write_native_code(Name.data(), Addr, (void*)Addr, Size)
== -1) {
@@ -125,9 +125,7 @@ void OProfileJITEventListener::NotifyFreeingObject(const ObjectFile &Obj) {
for (symbol_iterator I = DebugObj.symbol_begin(),
E = DebugObj.symbol_end();
I != E; ++I) {
- SymbolRef::Type SymType;
- if (I->getType(SymType)) continue;
- if (SymType == SymbolRef::ST_Function) {
+ if (I->getType() == SymbolRef::ST_Function) {
uint64_t Addr;
if (I->getAddress(Addr)) continue;
OpenPOWER on IntegriCloud