diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2016-03-02 19:28:54 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2016-03-02 19:28:54 +0000 |
| commit | cbbaeb13074400ead830be88143c31e7aac3c01c (patch) | |
| tree | d55d8e042104532293a3a2d729f706fb0b318111 /clang/lib/CodeGen | |
| parent | 65f9d9cd324fc12f8bf90fa67477e2ddd90803d6 (diff) | |
| download | bcm5719-llvm-cbbaeb13074400ead830be88143c31e7aac3c01c.tar.gz bcm5719-llvm-cbbaeb13074400ead830be88143c31e7aac3c01c.zip | |
Serialize `#pragma detect_mismatch`.
This is like r262493, but for pragma detect_mismatch instead of pragma comment.
The two pragmas have similar behavior, so use the same approach for both.
llvm-svn: 262506
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 1 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenAction.cpp | 5 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 6 | ||||
| -rw-r--r-- | clang/lib/CodeGen/ModuleBuilder.cpp | 5 |
4 files changed, 7 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index f9a6b06a4a9..c218ca41a1d 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -72,6 +72,7 @@ void CodeGenFunction::EmitDecl(const Decl &D) { case Decl::ObjCProperty: case Decl::ObjCCompatibleAlias: case Decl::PragmaComment: + case Decl::PragmaDetectMismatch: case Decl::AccessSpec: case Decl::LinkageSpec: case Decl::ObjCPropertyImpl: diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index 8d081144902..c9e188a8725 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -205,11 +205,6 @@ namespace clang { Gen->HandleVTable(RD); } - void HandleDetectMismatch(llvm::StringRef Name, - llvm::StringRef Value) override { - Gen->HandleDetectMismatch(Name, Value); - } - static void InlineAsmDiagHandler(const llvm::SMDiagnostic &SM,void *Context, unsigned LocCookie) { SourceLocation Loc = SourceLocation::getFromRawEncoding(LocCookie); diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 286ccb1595f..cf9e29d46b7 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3748,6 +3748,12 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { break; } + case Decl::PragmaDetectMismatch: { + const auto *PDMD = cast<PragmaDetectMismatchDecl>(D); + AddDetectMismatch(PDMD->getName(), PDMD->getValue()); + break; + } + case Decl::LinkageSpec: EmitLinkageSpec(cast<LinkageSpecDecl>(D)); break; diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp index 968cc46f7e7..041a15c5623 100644 --- a/clang/lib/CodeGen/ModuleBuilder.cpp +++ b/clang/lib/CodeGen/ModuleBuilder.cpp @@ -233,11 +233,6 @@ namespace { Builder->EmitVTable(RD); } - - void HandleDetectMismatch(llvm::StringRef Name, - llvm::StringRef Value) override { - Builder->AddDetectMismatch(Name, Value); - } }; } |

