diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-03-02 17:28:48 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-03-02 17:28:48 +0000 |
commit | 5a333e954bbf581c26df310194df2001d2aa6b3f (patch) | |
tree | f19931e00926b6f3cfe83f1c802b66b55d54ab9e /lib/CodeGen/ModuleBuilder.cpp | |
parent | 98b045b5e6e7ec686e36ac700d5922268d683c8a (diff) | |
download | clang-5a333e954bbf581c26df310194df2001d2aa6b3f.tar.gz |
Serialize `#pragma comment`.
`#pragma comment` was handled by Sema calling a function on ASTConsumer, and
CodeGen then implementing this function and writing things to its output.
Instead, introduce a PragmaCommentDecl AST node and hang one off the
TranslationUnitDecl for every `#pragma comment` line, and then use the regular
serialization machinery. (Since PragmaCommentDecl has codegen relevance, it's
eagerly deserialized.)
http://reviews.llvm.org/D17799
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262493 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ModuleBuilder.cpp')
-rw-r--r-- | lib/CodeGen/ModuleBuilder.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/CodeGen/ModuleBuilder.cpp b/lib/CodeGen/ModuleBuilder.cpp index 234a773606..968cc46f7e 100644 --- a/lib/CodeGen/ModuleBuilder.cpp +++ b/lib/CodeGen/ModuleBuilder.cpp @@ -104,9 +104,9 @@ namespace { *M, Diags, CoverageInfo)); for (auto &&Lib : CodeGenOpts.DependentLibraries) - HandleDependentLibrary(Lib); + Builder->AddDependentLib(Lib); for (auto &&Opt : CodeGenOpts.LinkerOptions) - HandleLinkerOption(Opt); + Builder->AppendLinkerOptions(Opt); } void HandleCXXStaticMemberVarInstantiation(VarDecl *VD) override { @@ -234,18 +234,10 @@ namespace { Builder->EmitVTable(RD); } - void HandleLinkerOption(llvm::StringRef Opts) override { - Builder->AppendLinkerOptions(Opts); - } - void HandleDetectMismatch(llvm::StringRef Name, llvm::StringRef Value) override { Builder->AddDetectMismatch(Name, Value); } - - void HandleDependentLibrary(llvm::StringRef Lib) override { - Builder->AddDependentLib(Lib); - } }; } |