mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 18:11:19 +00:00
[lldb-instr] Group RECORD macros
Group LLDB_RECORD macros per input file. llvm-svn: 354423
This commit is contained in:
parent
20332cc4ea
commit
b7c22314c3
@ -4,6 +4,7 @@
|
||||
|
||||
# RUN: lldb-instr %t.dir/foo.cpp | FileCheck %s
|
||||
|
||||
# CHECK: {
|
||||
# CHECK: LLDB_REGISTER_METHOD(void, Foo, A, ());
|
||||
# CHECK: LLDB_REGISTER_METHOD(void, Foo, B, (int));
|
||||
# CHECK: LLDB_REGISTER_METHOD(int, Foo, C, (int));
|
||||
@ -12,3 +13,4 @@
|
||||
# CHECK: LLDB_REGISTER_STATIC_METHOD(int, Foo, F, (int));
|
||||
# CHECK-NOT: LLDB_REGISTER_STATIC_METHOD(void, Foo, G
|
||||
# CHECK-NOT: LLDB_REGISTER_METHOD_CONST(void, Foo, I, ());
|
||||
# CHECK: }
|
||||
|
@ -104,8 +104,7 @@ static std::string GetRegisterConstructorMacro(StringRef Class,
|
||||
StringRef Signature) {
|
||||
std::string Macro;
|
||||
llvm::raw_string_ostream OS(Macro);
|
||||
OS << "LLDB_REGISTER_CONSTRUCTOR(" << Class << ", (" << Signature
|
||||
<< "));\n\n";
|
||||
OS << "LLDB_REGISTER_CONSTRUCTOR(" << Class << ", (" << Signature << "));\n";
|
||||
return OS.str();
|
||||
}
|
||||
|
||||
@ -305,10 +304,18 @@ class SBAction : public ASTFrontendAction {
|
||||
public:
|
||||
SBAction() = default;
|
||||
|
||||
void EndSourceFileAction() override { MyRewriter.overwriteChangedFiles(); }
|
||||
bool BeginSourceFileAction(CompilerInstance &CI) override {
|
||||
llvm::outs() << "{\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
void EndSourceFileAction() override {
|
||||
llvm::outs() << "}\n";
|
||||
MyRewriter.overwriteChangedFiles();
|
||||
}
|
||||
|
||||
std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
|
||||
StringRef file) override {
|
||||
StringRef File) override {
|
||||
MyRewriter.setSourceMgr(CI.getSourceManager(), CI.getLangOpts());
|
||||
return llvm::make_unique<SBConsumer>(MyRewriter, CI.getASTContext());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user