diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-12-22 18:11:50 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-12-22 18:11:50 +0000 |
| commit | dc72875d25e608327d5056e922caac75ea86b634 (patch) | |
| tree | 627fd7849f6e6de9957b37b949193ab6a000a9db /clang/lib/Frontend | |
| parent | 71d7eaa87eee8176bf6318e33007152d7e9eefa6 (diff) | |
| download | bcm5719-llvm-dc72875d25e608327d5056e922caac75ea86b634.tar.gz bcm5719-llvm-dc72875d25e608327d5056e922caac75ea86b634.zip | |
Serialize the NoReturn bit on FunctionTypes for precompiled headers
llvm-svn: 91911
Diffstat (limited to 'clang/lib/Frontend')
| -rw-r--r-- | clang/lib/Frontend/PCHReader.cpp | 9 | ||||
| -rw-r--r-- | clang/lib/Frontend/PCHWriter.cpp | 1 |
2 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 48ef2ac31ab..2eabdc93f43 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -1854,17 +1854,18 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) { } case pch::TYPE_FUNCTION_NO_PROTO: { - if (Record.size() != 1) { + if (Record.size() != 2) { Error("incorrect encoding of no-proto function type"); return QualType(); } QualType ResultType = GetType(Record[0]); - return Context->getFunctionNoProtoType(ResultType); + return Context->getFunctionNoProtoType(ResultType, Record[1]); } case pch::TYPE_FUNCTION_PROTO: { QualType ResultType = GetType(Record[0]); - unsigned Idx = 1; + bool NoReturn = Record[1]; + unsigned Idx = 2; unsigned NumParams = Record[Idx++]; llvm::SmallVector<QualType, 16> ParamTypes; for (unsigned I = 0; I != NumParams; ++I) @@ -1880,7 +1881,7 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) { return Context->getFunctionType(ResultType, ParamTypes.data(), NumParams, isVariadic, Quals, hasExceptionSpec, hasAnyExceptionSpec, NumExceptions, - Exceptions.data()); + Exceptions.data(), NoReturn); } case pch::TYPE_UNRESOLVED_USING: diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp index 0e4516877de..124df63aade 100644 --- a/clang/lib/Frontend/PCHWriter.cpp +++ b/clang/lib/Frontend/PCHWriter.cpp @@ -144,6 +144,7 @@ void PCHTypeWriter::VisitExtVectorType(const ExtVectorType *T) { void PCHTypeWriter::VisitFunctionType(const FunctionType *T) { Writer.AddTypeRef(T->getResultType(), Record); + Record.push_back(T->getNoReturnAttr()); } void PCHTypeWriter::VisitFunctionNoProtoType(const FunctionNoProtoType *T) { |

