Skip to content

Commit

Permalink
Added missing wrappers
Browse files Browse the repository at this point in the history
Change-Id: Id2e89d42cb5231669d790801e77523b4db2f0498
  • Loading branch information
azabazno authored and sys_zuul committed Feb 3, 2020
1 parent b6abc58 commit 41f775b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions IGC/WrapperLLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ set(IGC_WrapperLLVM_HDR
"${CMAKE_CURRENT_SOURCE_DIR}/include/llvmWrapper/Transforms/Scalar/InstSimplifyPass.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/llvmWrapper/BinaryFormat/Dwarf.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/llvmWrapper/MC/MCAsmBackend.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/llvmWrapper/Analysis/CallGraph.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/llvmWrapper/Analysis/InlineCost.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/llvmWrapper/Analysis/MemoryLocation.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/llvmWrapper/Analysis/TargetLibraryInfo.h"
Expand Down
51 changes: 51 additions & 0 deletions IGC/WrapperLLVM/include/llvmWrapper/Analysis/CallGraph.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*===================== begin_copyright_notice ==================================
Copyright (c) 2017 Intel Corporation
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
======================= end_copyright_notice ==================================*/

#ifndef IGCLLVM_CALL_GRAPH_H
#define IGCLLVM_CALL_GRAPH_H

#include <llvm/Analysis/CallGraph.h>
#include <llvm/IR/CallSite.h>

namespace IGCLLVM
{
#if LLVM_VERSION_MAJOR < 9
using CallGraphNode = llvm::CallGraphNode;
#else
class CallGraphNode : public llvm::CallGraphNode
{
public:
inline void replaceCallEdge(llvm::CallSite CS, llvm::CallSite NewCS, llvm::CallGraphNode *NewNode)
{
llvm::CallGraphNode::replaceCallEdge(*llvm::cast<llvm::CallBase>(CS.getInstruction()),
*llvm::cast<llvm::CallBase>(NewCS.getInstruction()),
NewNode);
}
};
#endif
}

#endif

0 comments on commit 41f775b

Please sign in to comment.