diff options
| author | Ted Kremenek <kremenek@apple.com> | 2011-09-06 19:40:45 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2011-09-06 19:40:45 +0000 |
| commit | fed48af3def19576dee6d499126f5de80d3676e8 (patch) | |
| tree | 552b41084b1190df0a8d88e9562b5b9ba64144a6 | |
| parent | 9d96c942783c15b7bae2a26f1e253a60f1bd39cc (diff) | |
| download | bcm5719-llvm-fed48af3def19576dee6d499126f5de80d3676e8.tar.gz bcm5719-llvm-fed48af3def19576dee6d499126f5de80d3676e8.zip | |
Don't emit -Wpadded warnings without a valid SourceLocation. This can happen when RecordLayoutBuilder is used by Codegen, not Sema.
llvm-svn: 139162
| -rw-r--r-- | clang/lib/AST/RecordLayoutBuilder.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp index eff1daea46c..b33c8d730e3 100644 --- a/clang/lib/AST/RecordLayoutBuilder.cpp +++ b/clang/lib/AST/RecordLayoutBuilder.cpp @@ -1751,6 +1751,11 @@ void RecordLayoutBuilder::CheckFieldPadding(uint64_t Offset, if (isa<ObjCIvarDecl>(D)) return; + // Don't warn about structs created without a SourceLocation. This can + // be done by clients of the AST, such as codegen. + if (D->getLocation().isInvalid()) + return; + unsigned CharBitNum = Context.getTargetInfo().getCharWidth(); // Warn if padding was introduced to the struct/class. |

