llvm-project/clang/lib/AST
Sean Callanan 24c5fe6b34 When the ASTImporter imports a source location, it avoids importing macro
expansions by calling getSpellingLoc(). That's great in most cases, but for
macros defined in the '<built-in>' source file, the source file is invalid
and does not import correctly, causing an assertion failure (the assertion
is Invalid SLocOffset or bad function choice).

A more reliable way to avoid this is to use getFileLoc(), which does not
return built-in locations. This avoids the crash but still preserves valid
source locations.

I've added a testcase that covers the previously crashing scenario.

https://reviews.llvm.org/D26054

llvm-svn: 286144
2016-11-07 20:42:25 +00:00
..
APValue.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
ASTConsumer.cpp Move LocInfoType from Sema to AST. 2016-02-01 17:42:01 +00:00
ASTContext.cpp Fix use-after-scope in ASTContext. 2016-10-26 12:51:45 +00:00
ASTDiagnostic.cpp PR30831: Teach template type diffing to cope with TemplateSpecializationTypes 2016-10-28 19:54:43 +00:00
ASTDumper.cpp Teach clang-query to dump types. I couldn't find any existing tests for clang-query's dumping functionality. =( 2016-11-02 23:57:18 +00:00
ASTImporter.cpp When the ASTImporter imports a source location, it avoids importing macro 2016-11-07 20:42:25 +00:00
ASTTypeTraits.cpp Teach clang-query to dump types. I couldn't find any existing tests for clang-query's dumping functionality. =( 2016-11-02 23:57:18 +00:00
AttrImpl.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
CMakeLists.txt Move functions declared in Stmt{ObjC,CXX}.h and OpenMPClause.h into 2015-10-02 13:41:04 +00:00
CXXABI.h [AST] Convert MangleNumberingContext to a unique_ptr. 2016-10-10 16:26:19 +00:00
CXXInheritance.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
Comment.cpp [Sema][Comments] Add support for TypeAliasTemplate 2016-08-25 17:09:33 +00:00
CommentBriefParser.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
CommentCommandTraits.cpp Fix for PR21254 - Assertion in comment parser 2014-10-15 16:18:20 +00:00
CommentLexer.cpp Fix 'unknown documentation command' warning ranges 2016-10-25 10:06:11 +00:00
CommentParser.cpp [cleanup] Remove excessive padding from TextTokenRetokenizer::Position 2016-09-20 18:32:48 +00:00
CommentSema.cpp AST: improve layout of SimpleTypoCorrector 2016-08-28 21:33:30 +00:00
Decl.cpp Fix parenthesized assert (nfc). 2016-11-01 10:30:50 +00:00
DeclBase.cpp Add a note that points to the linkage specifier for the C++ linkage errors 2016-11-02 15:46:34 +00:00
DeclCXX.cpp Fix implementation of the likely resolution of core issue 253 to support class 2016-10-28 19:11:18 +00:00
DeclFriend.cpp [TrailingObjects] Convert Decl* classes. 2015-12-29 22:13:13 +00:00
DeclGroup.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
DeclObjC.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
DeclOpenMP.cpp [OPENMP 4.0] Initial support for 'omp declare reduction' construct. 2016-03-03 05:21:39 +00:00
DeclPrinter.cpp Do not print enum underlying type if language is not C++11 2016-11-04 06:03:34 +00:00
DeclTemplate.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
DeclarationName.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
Expr.cpp Add some more asserts to clearly indicate that there are special cases 2016-11-04 06:32:57 +00:00
ExprCXX.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
ExprClassification.cpp P0217R3: Perform semantic checks and initialization for the bindings in a 2016-08-11 22:25:46 +00:00
ExprConstant.cpp Remove move constructors that are identical to the generated default move ctor. 2016-10-21 18:55:07 +00:00
ExprObjC.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
ExternalASTSource.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
InheritViz.cpp InheritViz: Hide implementation details 2015-03-09 15:03:20 +00:00
ItaniumCXXABI.cpp Fix mangling numbers for varargs lambdas; varargs and non-varargs lambdas get 2016-10-23 04:53:03 +00:00
ItaniumMangle.cpp Update manglings for C++17 noexcept function types to match Jason Merrill's 2016-11-03 00:27:54 +00:00
Mangle.cpp regcall: Implement regcall Calling Conv in clang 2016-11-02 18:29:35 +00:00
MicrosoftCXXABI.cpp [AST] Convert MangleNumberingContext to a unique_ptr. 2016-10-10 16:26:19 +00:00
MicrosoftMangle.cpp regcall: Implement regcall Calling Conv in clang 2016-11-02 18:29:35 +00:00
NSAPI.cpp Enable support for __float128 in Clang and enable it on pertinent platforms 2016-05-09 08:52:33 +00:00
NestedNameSpecifier.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
OpenMPClause.cpp [OpenMP] Code generation for the is_device_ptr clause 2016-07-28 14:25:09 +00:00
ParentMap.cpp [arcmt/objcmt] Fix ParentMap crash with invalid code. 2016-07-14 20:21:16 +00:00
RawCommentList.cpp AST: Improve a couple of comments and cast unused values to void 2016-10-16 20:12:42 +00:00
RecordLayout.cpp [RecordLayout] Use an ASTVector instead of using a separate pointer and counter 2016-05-24 18:10:50 +00:00
RecordLayoutBuilder.cpp [RecordLayout] Use an ASTVector instead of using a separate pointer and counter 2016-05-24 18:10:50 +00:00
SelectorLocationsKind.cpp
Stmt.cpp [x86][inline-asm] Add support for curly brackets escape using "%" in extended inline asm. 2016-10-31 15:27:54 +00:00
StmtCXX.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
StmtIterator.cpp [ptr-traits] Stop using two bogus types as stand-ins for flags 2015-12-30 02:51:00 +00:00
StmtObjC.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
StmtOpenMP.cpp Re-apply patch r279045. 2016-10-25 12:50:55 +00:00
StmtPrinter.cpp Re-apply patch r279045. 2016-10-25 12:50:55 +00:00
StmtProfile.cpp Re-apply patch r279045. 2016-10-25 12:50:55 +00:00
StmtViz.cpp
TemplateBase.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
TemplateName.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
Type.cpp regcall: Implement regcall Calling Conv in clang 2016-11-02 18:29:35 +00:00
TypeLoc.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
TypePrinter.cpp regcall: Implement regcall Calling Conv in clang 2016-11-02 18:29:35 +00:00
VTTBuilder.cpp Update for LLVM API change to make Small(Ptr)Set::insert return pair<iterator, bool> as per the C++ standard's associative container concept. 2014-11-19 07:49:47 +00:00
VTableBuilder.cpp [AST] Don't use make_pointee_iterator in VTableBuilder. 2016-10-10 19:26:22 +00:00