llvm-project/clang/lib/Basic
Akira Hatanaka fcbe17c6be [ObjC++] Make parameter passing and function return compatible with ObjC
ObjC and ObjC++ pass non-trivial structs in a way that is incompatible
with each other. For example:
    
typedef struct {
  id f0;
  __weak id f1;
} S;
    
// this code is compiled in c++.
extern "C" {
  void foo(S s);
}
    
void caller() {
  // the caller passes the parameter indirectly and destructs it.
  foo(S());
}
    
// this function is compiled in c.
// 'a' is passed directly and is destructed in the callee.
void foo(S a) {
}
    
This patch fixes the incompatibility by passing and returning structs
with __strong or weak fields using the C ABI in C++ mode. __strong and
__weak fields in a struct do not cause the struct to be destructed in
the caller and __strong fields do not cause the struct to be passed
indirectly.
    
Also, this patch fixes the microsoft ABI bug mentioned here:
    
https://reviews.llvm.org/D41039?id=128767#inline-364710
    
rdar://problem/38887866
    
Differential Revision: https://reviews.llvm.org/D44908

llvm-svn: 328731
2018-03-28 21:13:14 +00:00
..
Targets [ObjC++] Make parameter passing and function return compatible with ObjC 2018-03-28 21:13:14 +00:00
Attributes.cpp Add #pragma clang attribute 2017-04-18 14:33:39 +00:00
Builtins.cpp [OpenMP] Implement omp_is_initial_device() as builtin 2017-10-17 14:28:14 +00:00
CMakeLists.txt [RISCV] Add the RISCV target and compiler driver 2018-01-11 13:36:56 +00:00
CharInfo.cpp
Cuda.cpp Add NVPTX Support to ValidCPUList (enabling march notes) 2018-02-08 23:16:00 +00:00
Diagnostic.cpp [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-02-16 23:40:07 +00:00
DiagnosticIDs.cpp Make DiagnosticIDs::getAllDiagnostics use std::vector. NFC. 2017-12-20 16:55:41 +00:00
DiagnosticOptions.cpp [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-02-16 23:40:07 +00:00
FileManager.cpp Use VFS operations in FileManager::makeAbsolutePath. 2017-08-02 07:25:24 +00:00
FileSystemStatCache.cpp [VFS] Replace TimeValue usage with std::chrono 2016-11-09 10:52:22 +00:00
IdentifierTable.cpp [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-11-03 22:35:27 +00:00
LangOptions.cpp [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-02-16 23:40:07 +00:00
MemoryBufferCache.cpp Reapply "Modules: Cache PCMs in memory and avoid a use-after-free" 2017-03-20 17:58:26 +00:00
Module.cpp [Modules] Add more language features to be used with requires-declaration 2018-02-14 19:01:03 +00:00
ObjCRuntime.cpp Watch and TV OS: wire up basic ABI choices 2015-10-30 16:30:36 +00:00
OpenMPKinds.cpp [OPENMP] Initial codegen for `target teams distribute parallel for 2018-01-15 20:59:40 +00:00
OperatorPrecedence.cpp [c++20] P0515R3: Parsing support and basic AST construction for operator <=>. 2017-12-14 15:16:18 +00:00
SanitizerBlacklist.cpp Allow specifying sanitizers in blacklists 2017-09-25 22:11:12 +00:00
SanitizerSpecialCaseList.cpp Update SanitizerSpecialCaseList to use renamed functions in base class. 2017-11-07 21:16:37 +00:00
Sanitizers.cpp Pull trivial SanitizerSet methods into the header. 2015-07-14 15:34:19 +00:00
SourceLocation.cpp [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-02-16 23:40:07 +00:00
SourceManager.cpp Fix for LLVM r326109 2018-02-26 18:42:30 +00:00
TargetInfo.cpp [ObjC++] Make parameter passing and function return compatible with ObjC 2018-03-28 21:13:14 +00:00
Targets.cpp Make march/target-cpu print a note with the list of valid values for ARM 2018-02-08 23:14:15 +00:00
Targets.h [MINGW] normalize WIN32 macros 2017-11-21 11:28:29 +00:00
TokenKinds.cpp
Version.cpp
VersionTuple.cpp
VirtualFileSystem.cpp [clang] Change std::sort to llvm::sort in response to r327219 2018-03-27 16:50:00 +00:00
Warnings.cpp
XRayLists.cpp Allow specifying sanitizers in blacklists 2017-09-25 22:11:12 +00:00