In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
1. Download and compile LLVM
LLVM download address http://releases.llvm.org/download.html
The latest version is 6.0.0. After the download is complete, execute tar to extract the llvm package:
Tar-xzvf llvm-6.0.0.src.tar.xz
Download the Clang and decompress:
Tar-xzvf cfe-6.0.0.src.tar.xz
Copy the cfe-6.0.0.src directory to llvm-6.0.0.src/tools and rename it clang. Install cmake through brew:
Brew install cmake
Then change to the llvm-6.0.0.src directory under the command line, create a new build directory, and change to the build directory to execute the cmake generation configuration file. The command is as follows:
Mkdir buildcd buildcmake-G Xcode CMAKE_BUILD_TYPE= "Debug"..
After the execution is completed, you can see the project file LLVM.xcodeproj of Xcode. When you open the project file, you will be prompted whether to create Schemes automatically, as shown in the figure:
Click Manually Manage Schemes to create manually and add ALL_BUILD, as shown in the figure:
Then compile on Xcode, the compilation process, such as slow, may take about 20 minutes to half an hour, all the compiled files will be about 11G.
two。 Write Pass code
The function of writing the first Pass is very simple, just output each method name in the program, the steps are as follows:
(1) create a new folder under the lib/Transforms directory with the folder name of TestPass, and create the file TestPass.cpp under the TestPass directory as follows:
/ / Import the header file # include "llvm/ADT/Statistic.h" # include "llvm/IR/Function.h" # include "llvm/Pass.h" # include "llvm/Support/raw_ostream.h" using namespace llvm; / / specify the LLVM namespace namespace {/ / define the First class inherited from FunctionPass struct First: public FunctionPass {static char ID / / Pass ID First (): FunctionPass (ID) {} / / define runOnFunction to overload the abstract virtual function bool runOnFunction (Function & F) override {/ / print the name of each function that inherits the parent class
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.