aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-10 17:25:41 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-10 17:25:41 +0000
commit8038d5182b72dcdef292f6fb8539ad77f338855a (patch)
tree4a8a1b58b68c1d84ad9c10afa0f262b917b67eb4 /lib/Sema/SemaDecl.cpp
parentf04ad69fed38d26fc0d6f7d6fd0a4631ddfbc7fe (diff)
Various minor fixes to PCH reading and writing, with general
cleanup. Aside from a minor tweak to the PCH file format, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68793 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index b024d36acc..4f87b48eff 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -526,6 +526,16 @@ bool Sema::MergeTypeDefDecl(TypedefDecl *New, Decl *OldD) {
// __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;