summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove spurious assertion in -WdocumentationReid Kleckner2018-10-021-1/+0
| | | | | | | | | | | Some code in OpenCV uses interesting doxygen directives that make it so we don't see any tokens inside a @note, despite there definitely being non-whitespace characters there. The consistency check isn't needed. ParagraphComment supports receiving an empty list of comments. Fixes PR39007 llvm-svn: 343641
* [HIP] Support early finalization of device code for -fno-gpu-rdcYaxun Liu2018-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This patch renames -f{no-}cuda-rdc to -f{no-}gpu-rdc and keeps the original options as aliases. When -fgpu-rdc is off, clang will assume the device code in each translation unit does not call external functions except those in the device library, therefore it is possible to compile the device code in each translation unit to self-contained kernels and embed them in the host object, so that the host object behaves like usual host object which can be linked by lld. The benefits of this feature is: 1. allow users to create static libraries which can be linked by host linker; 2. amortized device code linking time. This patch modifies HIP action builder to insert actions for linking device code and generating HIP fatbin, and pass HIP fatbin to host backend action. It extracts code for constructing command for generating HIP fatbin as a function so that it can be reused by early finalization. It also modifies codegen of HIP host constructor functions to embed the device fatbin when it is available. Differential Revision: https://reviews.llvm.org/D52377 llvm-svn: 343611
* [AST] Pack the bit-fields of FunctionProtoType into Type.Bruno Ricci2018-10-022-50/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the bit-fields of FunctionProtoType into FunctionTypeBitfields. This cuts the size of FunctionProtoType by a pointer. Additionally use llvm::TrailingObjects instead of manually doing the casts + arithmetic. This patch is bigger then what could be expected for the following reasons: 1. As discussed before in D50631 it would be nice if there was some space left in FunctionTypeBitfields for future additions. This patch introduces an extra structure FunctionTypeExtraBitfields which is supposed to hold uncommon bits and is stored in a trailing object. The number of exception types NumExceptions is moved to this struct. As of this patch this trailing struct will only be allocated if we have > 0 types in a dynamic exception specification. 2. TrailingObjects cannot handle repeated types. Therefore the QualType representing an exception type is wrapped in a struct ExceptionType. The ExceptionType * is then reinterpret_cast'd to QualType *. 3. TrailingObjects needs the definition of the various trailing classes. Therefore ExtParameterInfo, ExceptionType and FunctionTypeExtraBitfields are put in FunctionType. Differential Revision: https://reviews.llvm.org/D52738 Reviewed By: rjmccall llvm-svn: 343579
* Distinguish `__block` variables that are captured by escaping blocksAkira Hatanaka2018-10-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | from those that aren't. This patch changes the way __block variables that aren't captured by escaping blocks are handled: - Since non-escaping blocks on the stack never get copied to the heap (see https://reviews.llvm.org/D49303), Sema shouldn't error out when the type of a non-escaping __block variable doesn't have an accessible copy constructor. - IRGen doesn't have to use the specialized byref structure (see https://clang.llvm.org/docs/Block-ABI-Apple.html#id8) for a non-escaping __block variable anymore. Instead IRGen can emit the variable as a normal variable and copy the reference to the block literal. Byref copy/dispose helpers aren't needed either. This reapplies r343518 after fixing a use-after-free bug in function Sema::ActOnBlockStmtExpr where the BlockScopeInfo was dereferenced after it was popped and deleted. rdar://problem/39352313 Differential Revision: https://reviews.llvm.org/D51564 llvm-svn: 343542
* Revert r343518.Akira Hatanaka2018-10-011-8/+0
| | | | | | | | | Bots are still failing. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/24420 http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/12958 llvm-svn: 343531
* Distinguish `__block` variables that are captured by escaping blocksAkira Hatanaka2018-10-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from those that aren't. This patch changes the way __block variables that aren't captured by escaping blocks are handled: - Since non-escaping blocks on the stack never get copied to the heap (see https://reviews.llvm.org/D49303), Sema shouldn't error out when the type of a non-escaping __block variable doesn't have an accessible copy constructor. - IRGen doesn't have to use the specialized byref structure (see https://clang.llvm.org/docs/Block-ABI-Apple.html#id8) for a non-escaping __block variable anymore. Instead IRGen can emit the variable as a normal variable and copy the reference to the block literal. Byref copy/dispose helpers aren't needed either. This reapplies r341754, which was reverted in r341757 because it broke a couple of bots. r341754 was calling markEscapingByrefs after the call to PopFunctionScopeInfo, which caused the popped function scope to be cleared out when the following code was compiled, for example: $ cat test.m struct A { id data[10]; }; void foo() { __block A v; ^{ (void)v; }; } This commit calls markEscapingByrefs before calling PopFunctionScopeInfo to prevent that from happening. rdar://problem/39352313 Differential Revision: https://reviews.llvm.org/D51564 llvm-svn: 343518
* Add support for unified_shared_memory clause on requires directivePatrick Lyster2018-10-013-0/+10
| | | | llvm-svn: 343472
* Use the container form llvm::sort(C, ...)Fangrui Song2018-09-302-13/+11
| | | | | | | | | There are a few leftovers of rC343147 that are not (\w+)\.begin but in the form of ([-[:alnum:]>.]+)\.begin or spanning two lines. Change them to use the container form in this commit. The 12 occurrences have been inspected manually for safety. llvm-svn: 343425
* [cxx2a] P0614R1: Support init-statements in range-based for loops.Richard Smith2018-09-284-48/+55
| | | | | | | We don't yet support this for the case where a range-based for loop is implicitly rewritten to an ObjC for..in statement. llvm-svn: 343350
* AST: add missing ObjC extensions to MS style name decorationSaleem Abdulrasool2018-09-281-3/+30
| | | | | | | | | | | | | | | | | | | | | | | Add support for encoding type arguments for lightweight generics in Objective-C++ mode. Additionally, add support for the `__kindof` modifier. This should complete the coverage of the ObjC extensions that clang currently supports under the MS style name decoration scheme. This is implemented similar to the Objective-C lifetime qualifiers decoration: a template specialization in the `__ObjC` namespace so that we can interoperate with Microsoft's tools as well as ensure that we do not accidentally collide with new features in the Microsoft implementation. Since the `__kindof` appertains to the type and not the pointer, we apply the template specialization to the underlying type instead of the pointer type. Unfortunately, until D52581 is resolved, the generated name is not really compatible with the MS tools as well as breaks interoperability with Objective-C++ and C++. This resolves PR37754! llvm-svn: 343338
* [cxx2a] P0624R2: Lambdas with no capture-default areRichard Smith2018-09-271-0/+18
| | | | | | default-constructible and assignable. llvm-svn: 343279
* llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)Fangrui Song2018-09-262-6/+4
| | | | | | | | | | | | | | Summary: The convenience wrapper in STLExtras is available since rL342102. Reviewers: rsmith, #clang, dblaikie Reviewed By: rsmith, #clang Subscribers: mgrang, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52576 llvm-svn: 343147
* P1008R1 Classes with user-declared constructors are never aggregates inRichard Smith2018-09-261-3/+8
| | | | | | C++20. llvm-svn: 343131
* [OPENMP] Add support for OMP5 requires directive + unified_address clauseKelvin Li2018-09-267-1/+77
| | | | | | | | | Add support for OMP5.0 requires directive and unified_address clause. Patches to follow will include support for additional clauses. Differential Revision: https://reviews.llvm.org/D52359 llvm-svn: 343063
* [AST] Squeeze some bits in LinkageComputer::QueryTypeBruno Ricci2018-09-251-3/+8
| | | | | | | | | | | | Replace the pair std::pair<const NamedDecl *, unsigned> where the unsigned represents an LVComputationKind by a PointerIntPair. This saves a pointer per entry in the map LinkageComputer::CachedLinkageInfo. Differential Revision: https://reviews.llvm.org/D52268 Reviewed by: rjmccall, george.burgess.iv, erichkeane llvm-svn: 342973
* Add inherited attributes before parsed attributes.Michael Kruse2018-09-241-0/+23
| | | | | | | | | | | | | | | | | Currently, attributes from previous declarations ('inherited attributes') are added to the end of a declaration's list of attributes. Before r338800, the attribute list was in reverse. r338800 changed the order of non-inherited (parsed from the current declaration) attributes, but inherited attributes are still appended to the end of the list. This patch appends inherited attributes after other inherited attributes, but before any non-inherited attribute. This is to make the order of attributes in the AST correspond to the order in the source code. Differential Revision: https://reviews.llvm.org/D50214 llvm-svn: 342861
* [CUDA] Ignore uncallable functions when we check for usual deallocators.Artem Belevich2018-09-211-8/+12
| | | | | | | | | Previously clang considered function variants from both sides of compilation and that resulted in picking up wrong deallocation function. Differential Revision: https://reviews.llvm.org/D51808 llvm-svn: 342749
* [AST] Various optimizations + refactoring in DeclarationName(Table)Bruno Ricci2018-09-211-198/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the following optimizations in DeclarationName(Table): 1. Store common kinds inline in DeclarationName instead of DeclarationNameExtra. Currently the kind of C++ constructor, destructor, conversion function and overloaded operator names is stored in DeclarationNameExtra. Instead store it inline in DeclarationName. To do this align IdentifierInfo, CXXSpecialName, DeclarationNameExtra and CXXOperatorIdName to 8 bytes so that we can use the lower 3 bits of DeclarationName::Ptr. This is already the case on 64 bits archs anyway. This also allow us to remove DeclarationNameExtra from CXXSpecialName and CXXOperatorIdName, which shave off a pointer from CXXSpecialName. 2. Synchronize the enumerations DeclarationName::NameKind, DeclarationName::StoredNameKind and Selector::IdentifierInfoFlag. This makes DeclarationName::getNameKind much more efficient since we can replace the switch table by a single comparison and an addition. 3. Put the overloaded operator names inline in DeclarationNameTable to remove an indirection. This increase the size of DeclarationNameTable a little bit but this is not important since it is only used in ASTContext, and never copied nor moved from. This also get rid of the last dynamic allocation in DeclarationNameTable. Altogether these optimizations cut the run time of parsing all of Boost by about 0.8%. While we are at it, do the following NFC modifications: 1. Put the internal classes CXXSpecialName, CXXDeductionGuideNameExtra, CXXOperatorIdName, CXXLiteralOperatorIdName and DeclarationNameExtra in a namespace detail since these classes are only meant to be used by DeclarationName and DeclarationNameTable. Make this more explicit by making the members of these classes private and friending DeclarationName(Table). 2. Make DeclarationName::getFETokenInfo a non-template since every users are using it to get a void *. It was supposed to be used with a type to avoid a subsequent static_cast. 3. Change the internal functions DeclarationName::getAs* to castAs* since when we use them we already know the correct kind. This has no external impact since all of these are private. Reviewed By: erichkeane, rjmccall Differential Revision: https://reviews.llvm.org/D52267 llvm-svn: 342729
* [OPENMP] Fix spelling of getLoopCounter (NFC)Mike Rice2018-09-201-2/+2
| | | | llvm-svn: 342666
* [ASTImporter] Fix import of VarDecl initGabor Marton2018-09-171-53/+68
| | | | | | | | | | | | | | | | | | Summary: The init expression of a VarDecl is overwritten in the "To" context if we import a VarDecl without an init expression (and with a definition). Please refer to the added tests, especially InitAndDefinitionAreInDifferentTUs. This patch fixes the malfunction by importing the whole Decl chain similarly as we did that in case of FunctionDecls. We handle the init expression similarly to a definition, alas only one init expression will be in the merged ast. Reviewers: a_sidorin, xazax.hun, r.stahl, a.sidorin Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D51597 llvm-svn: 342384
* [analyzer] Further printing improvements: use declarations,George Karpenkov2018-09-151-1/+0
| | | | | | | | skip pointers whenever redundant, use unique prefixes. Differential Revision: https://reviews.llvm.org/D52114 llvm-svn: 342316
* Generate unique identifiers for Decl objectsGeorge Karpenkov2018-09-151-0/+7
| | | | | | | | | The generated identifier is stable across multiple runs, and can be a great visualization or debugging aide. Differential Revision: https://reviews.llvm.org/D52113 llvm-svn: 342315
* StmtPrinter: allow customizing the end-of-line characterGeorge Karpenkov2018-09-152-54/+57
| | | | | | Differential Revision: https://reviews.llvm.org/D51824 llvm-svn: 342311
* Support generating unique identifiers for Stmt objectsGeorge Karpenkov2018-09-151-0/+8
| | | | | | | | | The generated identifiers are stable across multiple runs, and can be a great debug or visualization aid. Differential Revision: https://reviews.llvm.org/D51822 llvm-svn: 342309
* [clang-cl] Fix PR38934: failing to dllexport class template member w/ ↵Hans Wennborg2018-09-141-0/+8
| | | | | | | | | | | | explicit instantiation and PCH The code in ASTContext::DeclMustBeEmitted was supposed to handle this, but didn't take into account that synthesized members such as operator= might not get marked as template specializations, because they're synthesized on the instantiation directly when handling the class-level dllexport attribute. llvm-svn: 342240
* [ODRHash] Fix early exit that skipped code.Richard Trieu2018-09-141-3/+9
| | | | | | | | | | There is a bit of code at the end of AddDeclaration that should be run on every exit of the function. However, there was an early exit beforehand that could be triggered, which causes a small amount of data to skip the hashing, leading to false positive mismatch. Use a separate function so that this code is always run. llvm-svn: 342199
* Fix crash on call to __builtin_memcpy with a null pointer to anRichard Smith2018-09-132-8/+30
| | | | | | | | incomplete type. Also improve the diagnostics for similar situations. llvm-svn: 342192
* Track definition merging on the canonical declaration even when localRichard Smith2018-09-121-4/+1
| | | | | | | | | | | | | | submodule visibility is disabled. Attempting to pick a specific declaration to make visible when the module containing the merged declaration becomes visible is error-prone, as we don't yet know which declaration we'll choose to be the definition when we are informed of the merging. This reinstates r342019, reverted in r342020. The regression previously observed after this commit was fixed in r342096. llvm-svn: 342097
* Revert r342019, "Track definition merging on the canonical declarationRichard Smith2018-09-121-1/+4
| | | | | | | | | even when [...]" Further testing has revealed that this causes build breaks during explicit module compilations. llvm-svn: 342020
* Track definition merging on the canonical declaration even when localRichard Smith2018-09-121-4/+1
| | | | | | | | | | | submodule visibility is disabled. Attempting to pick a specific declaration to make visible when the module containing the merged declaration becomes visible is error-prone, as we don't yet know which declaration we'll choose to be the definition when we are informed of the merging. llvm-svn: 342019
* Consistently create a new declaration when merging a pre-existing butRichard Smith2018-09-121-0/+9
| | | | | | | | | | | | | | | | hidden definition with a would-be-parsed redefinition. This permits a bunch of cleanups. In particular, we no longer need to take merged definitions into account when checking declaration visibility, only when checking definition visibility, which makes certain visibility checks take linear instead of quadratic time. We could also now remove the UPD_DECL_EXPORTED update record and track on each declaration whether it was demoted from a definition (as we already do for variables), but I'm not doing that in this patch to keep the changes here simpler. llvm-svn: 342018
* Fix tracking of merged definitions when the merge target is also mergedRichard Smith2018-09-121-2/+2
| | | | | | into something else. llvm-svn: 342017
* [Sema][ObjC] Infer availability of +new from availability of -init.Erik Pilkington2018-09-102-0/+16
| | | | | | | | | | | When defined in NSObject, +new will call -init. If -init has been marked unavailable, diagnose uses of +new. rdar://18335828 Differential revision: https://reviews.llvm.org/D51189 llvm-svn: 341874
* [AST] Fix a crash on invalid.Erik Pilkington2018-09-101-0/+1
| | | | | | | | | Problem was that we were appending to the source location info buffer in the copy assignment operator (instead of overwriting). rdar://42746401 llvm-svn: 341869
* Revert r341754.Akira Hatanaka2018-09-091-8/+0
| | | | | | | | | The commit broke a couple of bots: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/12347 http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/7310 llvm-svn: 341757
* ms: Insert $$Z in mangling between directly consecutive parameter packs.Nico Weber2018-09-081-3/+10
| | | | | | | Fixes PR38783. Differential Revision: https://reviews.llvm.org/D51784 llvm-svn: 341755
* Distinguish `__block` variables that are captured by escaping blocksAkira Hatanaka2018-09-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | from those that aren't. This patch changes the way __block variables that aren't captured by escaping blocks are handled: - Since non-escaping blocks on the stack never get copied to the heap (see https://reviews.llvm.org/D49303), Sema shouldn't error out when the type of a non-escaping __block variable doesn't have an accessible copy constructor. - IRGen doesn't have to use the specialized byref structure (see https://clang.llvm.org/docs/Block-ABI-Apple.html#id8) for a non-escaping __block variable anymore. Instead IRGen can emit the variable as a normal variable and copy the reference to the block literal. Byref copy/dispose helpers aren't needed either. rdar://problem/39352313 Differential Revision: https://reviews.llvm.org/D51564 llvm-svn: 341754
* [ODRHash] Extend hash to support all Type's.Richard Trieu2018-09-042-26/+232
| | | | llvm-svn: 341421
* [ASTImporter] Merge ExprBitsGabor Marton2018-09-031-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Some `Expr` classes set up default values for the `ExprBits` of `Stmt`. These default values are then overwritten by the parser sometimes. One example is `InitListExpr` which sets the value kind to be an rvalue in the ctor. However, this bit may change after the `InitListExpr` is created. There may be other expressions similar to `InitListExpr` in this sense, thus the safest solution is to copy the expression bits. The lack of copying `ExprBits` causes an assertion in the analyzer engine in a specific case: Since the value kind is not imported, the analyzer engine believes that the given InitListExpr is an rvalue, thus it creates a nonloc::CompoundVal instead of creating memory region (as in case of an lvalue reference). Reviewers: a_sidorin, r.stahl, xazax.hun, a.sidorin Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D51533 llvm-svn: 341316
* [MS ABI] Fix mangling issue with dynamic initializer stubs.Zachary Turner2018-08-301-2/+5
| | | | | | | | | | | | | | | | | | | | There are two types of dynamic initializer stubs. There's `dynamic initializer for 'x''(void) and `dynamic initializer for `static Foo::Bar StaticDataMember''(void) The second case is disambiguated from the first by the presence of a ? after the operator code. So the first will appear something like ?__E<name> while the second will appear something like ?__E?<name>. clang-cl was mangling these both the same though. This patch matches behavior with cl. Differential Revision: https://reviews.llvm.org/D51500 llvm-svn: 341117
* Ensure canonical type is actually canonical.Richard Trieu2018-08-301-2/+2
| | | | | | | | | ASTContext::applyObjCProtocolQualifiers will return a canonical type when given a canonical type and an array of canonical protocols. If the protocols are not canonical then the returned type is also not canonical. Since a canonical type is needed, canonicalize the returned type before using it. This later prevents a type from having a non-canonical canonical type. llvm-svn: 341013
* [Sema/Attribute] Make types declared with address_space an AttributedTypeLeonard Chan2018-08-271-0/+7
| | | | | | | | | | | | | | | Currently an address_space is stored in a qualifier. This makes any type declared with an address_space attribute in the form `__attribute__((address_space(1))) int 1;` be wrapped in an AttributedType. This is for a later patch where if `address_space` is declared in a macro, any diagnostics that would normally print the address space will instead dump the macro name. This will require saving any macro information in the AttributedType. Differential Revision: https://reviews.llvm.org/D51229 llvm-svn: 340765
* [ASTImporter] Remove duplicated and dead CXXNamedCastExpr handling code.Raphael Isemann2018-08-221-32/+0
| | | | | | | | | | | | | | | | | | Summary: `CXXNamedCastExpr` importing is already handled in the respective `VisitCXXNamedCastExpr` method. So this code here can never be reached under normal circumstances and we might as well remove it. This patch shouldn't change any observable behavior of the ASTImporter. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51110 llvm-svn: 340466
* Fix import of class templates partial specializationGabor Marton2018-08-221-24/+74
| | | | | | | | | | | | | | | | | | | Summary: Currently there are several issues with the import of class template specializations. (1) Different TUs may have class template specializations with the same template arguments, but with different set of instantiated MethodDecls and FieldDecls. In this patch we provide a fix to merge these methods and fields. (2) Currently, we search the partial template specializations in the set of simple specializations and we add partial specializations as simple specializations. This is bad, this patch fixes it. Reviewers: a_sidorin, xazax.hun, r.stahl Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D50451 llvm-svn: 340402
* [AST] correct the behavior of -fvisibility-inlines-hidden option (don't make ↵Hiroshi Inoue2018-08-221-0/+10
| | | | | | | | | | | | | static local variables hidden) The command line option -fvisibility-inlines-hidden makes inlined method hidden, but it is expected not to affect the visibility of static local variables in the function. However, Clang makes the static local variables in the function also hidden as reported in PR37595. This problem causes LLVM bootstarp failure on Fedora 28 if configured with -DBUILD_SHARED_LIBS=ON. This patch makes the behavior of -fvisibility-inlines-hidden option to be consistent with that of gcc; the option does not change the visibility of the static local variables if the containing function does not associated with explicit visibility attribute and becomes hidden due to this option. Differential Revision: https://reviews.llvm.org/D50968 llvm-svn: 340386
* Add space to TemplateArgument dumpRichard Trieu2018-08-211-1/+1
| | | | | | | Add a missing space when dumping a template argument which is a template expansion. Found during debugging so no test. llvm-svn: 340357
* Add a new flag and attributes to control static destructor registrationErik Pilkington2018-08-211-0/+6
| | | | | | | | | | | | | | | | | | | | This commit adds the flag -fno-c++-static-destructors and the attributes [[clang::no_destroy]] and [[clang::always_destroy]]. no_destroy specifies that a specific static or thread duration variable shouldn't have it's destructor registered, and is the default in -fno-c++-static-destructors mode. always_destroy is the opposite, and is the default in -fc++-static-destructors mode. A variable whose destructor is disabled (either because of -fno-c++-static-destructors or [[clang::no_destroy]]) doesn't count as a use of the destructor, so we don't do any access checking or mark it referenced. We also don't emit -Wexit-time-destructors for these variables. rdar://21734598 Differential revision: https://reviews.llvm.org/D50994 llvm-svn: 340306
* Model type attributes as regular Attrs.Richard Smith2018-08-204-221/+127
| | | | | | | | | | | | | | Specifically, AttributedType now tracks a regular attr::Kind rather than having its own parallel Kind enumeration, and AttributedTypeLoc now holds an Attr* instead of holding an ad-hoc collection of Attr fields. Differential Revision: https://reviews.llvm.org/D50526 This reinstates r339623, reverted in r339638, with a fix to not fail template instantiation if we instantiate a QualType with no associated type source information and we encounter an AttributedType. llvm-svn: 340215
* [ASTImporter] Add test for C++ casts and fix broken const_cast importing.Raphael Isemann2018-08-201-0/+4
| | | | | | | | | | | | | | | | Summary: The ASTImporter does currently not handle const_casts. This patch adds the missing const_cast importer code and the test case that discovered this. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50932 llvm-svn: 340182
* [MS] Mangle a hash of the main file path into anonymous namespacesReid Kleckner2018-08-171-3/+38
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is needed to avoid conflicts in mangled names for codeview types in anonymous namespaces. In CodeView, types refer to each other typically through forward declarations, which contain mangled names. These names have to be unique, otherwise the debugger will look up the mangled name and find the wrong definition. Furthermore, ThinLTO will deduplicate the types, and debug info verification can fail when the types have the wrong sizes. This is PR38608. Fixes PR38609. Reviewers: majnemer, inglorion, hans Subscribers: mehdi_amini, aprantl, JDevlieghere, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50877 llvm-svn: 340079
OpenPOWER on IntegriCloud