llvm-project/clang/lib
David Majnemer a7f8c46439 MS ABI: Implement the MSVC 2015 scheme for scope disambiguation
consider C++ that looks like:
  inline int &f(bool b) {
    if (b) {
      static int i;
      return i;
    }
    static int i;
    return i;
  }

Both 'i' variables must have distinct (and stable) names for linkage
purposes.  The MSVC 2013 ABI would number the variables using a count of
the number of scopes that have been created.  However, the final 'i'
returns to a scope that has already been created leading to a mangling
collision.

MSVC 2015 fixes this by giving the second 'i' the name it would have if
it were declared before the 'if'.  However, this results in ABI breakage
because the mangled name, in cases where there was no ambiguity, would
now be different.

We implement the new behavior and only enable it if we are targeting the
MSVC 2015 ABI, otherwise the old behavior will be used.

This fixes PR18131.

llvm-svn: 232766
2015-03-19 21:54:30 +00:00
..
ARCMigrate [SDK modernizer] Patch to fix type of the typed enums when 2015-03-02 23:58:02 +00:00
AST Fix -ast-dump of dependent new and delete exprs 2015-03-19 18:47:47 +00:00
ASTMatchers ASTMatchers: Add an explicit dependency on libclangBasic. 2015-03-12 16:25:19 +00:00
Analysis Take the non-reference type when constructing a dummy expression. 2015-03-16 21:49:43 +00:00
Basic OpenCL: CL2.0 atomic types 2015-03-18 12:55:29 +00:00
CodeGen Remove .CUDAIsDevice flags from CodeGenOpts as it's already 2015-03-19 18:58:18 +00:00
Driver Ensure that we still parse preprocessed CUDA files as CUDA when we use 2015-03-19 17:32:06 +00:00
Edit Remove many superfluous SmallString::str() calls. 2015-03-18 10:17:07 +00:00
Format clang-format: Fix another bug in wrapping around "*". 2015-03-19 09:40:16 +00:00
Frontend Remove .CUDAIsDevice flags from CodeGenOpts as it's already 2015-03-19 18:58:18 +00:00
FrontendTool Provide a BuryPointer for unique_ptrs. 2014-08-29 16:53:14 +00:00
Headers [X86, AVX2] Replace inserti128 and extracti128 intrinsics with generic shuffles 2015-03-12 21:54:24 +00:00
Index [libclang] Use same USR encoding for 'char' regardless of what the target considers the sign to be. 2014-12-08 09:09:05 +00:00
Lex Remove many superfluous SmallString::str() calls. 2015-03-18 10:17:07 +00:00
Parse MS ABI: Implement the MSVC 2015 scheme for scope disambiguation 2015-03-19 21:54:30 +00:00
Rewrite [Rewrite] Make RewriteBuffer accessible on its own, and add a unit test for it. 2015-03-08 04:00:33 +00:00
Sema MS ABI: Implement the MSVC 2015 scheme for scope disambiguation 2015-03-19 21:54:30 +00:00
Serialization Remove many superfluous SmallString::str() calls. 2015-03-18 10:17:07 +00:00
StaticAnalyzer Fix another ternary Visual C++ is OK wiht but gcc not. 2015-03-18 10:30:57 +00:00
Tooling Remove many superfluous SmallString::str() calls. 2015-03-18 10:17:07 +00:00
CMakeLists.txt Fix build with various feature flag combinations 2014-07-14 22:17:22 +00:00
Makefile Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00