diff options
author | Xinliang David Li <davidxl@google.com> | 2016-01-20 01:26:34 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-01-20 01:26:34 +0000 |
commit | 59411db5202ed5a4e680457109cdbeed217219b6 (patch) | |
tree | 9e2452b5de4c268ec505867ac5850e26025623a6 /llvm/lib/ProfileData/InstrProf.cpp | |
parent | 19352b1cbe2763857b13f45c632d01f3d089f0d6 (diff) | |
download | bcm5719-llvm-59411db5202ed5a4e680457109cdbeed217219b6.tar.gz bcm5719-llvm-59411db5202ed5a4e680457109cdbeed217219b6.zip |
[PGO] Add a new interface to be used by Indirect Call Promotion
llvm-svn: 258271
Diffstat (limited to 'llvm/lib/ProfileData/InstrProf.cpp')
-rw-r--r-- | llvm/lib/ProfileData/InstrProf.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index f856c25789e..8482b18f1e0 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -165,6 +165,13 @@ GlobalVariable *createPGOFuncNameVar(Function &F, StringRef FuncName) { return createPGOFuncNameVar(*F.getParent(), F.getLinkage(), FuncName); } +void InstrProfSymtab::create(const Module &M) { + for (const Function &F : M) + addFuncName(getPGOFuncName(F)); + + finalizeSymtab(); +} + int collectPGOFuncNameStrings(const std::vector<std::string> &NameStrs, bool doCompression, std::string &Result) { uint8_t Header[16], *P = Header; |