summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-10 23:10:45 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-10 23:10:45 +0000
commit92863e475e177d919ad1d1d6edf697a5173d4e09 (patch)
tree4718686a281d433f8d7eafd7cd2c7c660c391376 /clang/lib/Sema/SemaDecl.cpp
parentd352fd36997724a87d498dbc2b30edde5ac8fdbe (diff)
downloadbcm5719-llvm-92863e475e177d919ad1d1d6edf697a5173d4e09.tar.gz
bcm5719-llvm-92863e475e177d919ad1d1d6edf697a5173d4e09.zip
Compare the predefines buffer in the PCH file with the predefines
buffer generated for the current translation unit. If they are different, complain and then ignore the PCH file. This effectively checks for all compilation options that somehow would affect preprocessor state (-D, -U, -include, the dreaded -imacros, etc.). When we do accept the PCH file, throw away the contents of the predefines buffer rather than parsing them, since all of the results of that parsing are already stored in the PCH file. This eliminates the ugliness with the redefinition of __builtin_va_list, among other things. llvm-svn: 68838
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 4f87b48eff0..474c1e490e4 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -524,22 +524,6 @@ bool Sema::MergeTypeDefDecl(TypedefDecl *New, Decl *OldD) {
return false;
}
- // __builtin_va_list gets redeclared in the built-in definitions
- // buffer when using PCH. Don't complain about such redefinitions.
- //
- // FIXME: The problem here is that the __builtin_va_list declaration
- // comes in as target-specific text in the predefines buffer, both
- // in the generation of the PCH file and in the source file. Thus,
- // we end up with two typedefs for the same type, which is an error
- // in C. Our hackish solution is to allow redundant typedefs *to the
- // same type* if the types are defined in the predefined buffer. We
- // would like to eliminate this ugliness, perhaps by making
- // __builtin_va_list a real, Sema-supplied declaration rather than
- // putting its text into the predefines buffer.
- if (Context.getExternalSource() &&
- strcmp(SourceMgr.getBufferName(New->getLocation()), "<built-in>") == 0)
- return false;
-
Diag(New->getLocation(), diag::err_redefinition) << New->getDeclName();
Diag(Old->getLocation(), diag::note_previous_definition);
return true;
OpenPOWER on IntegriCloud