teak-llvm/clang/lib/Frontend/Rewrite
Jonas Devlieghere 64a2630825 Pass the function type instead of the return type to FunctionDecl::Create
Fix places where the return type of a FunctionDecl was being used in
place of the function type

FunctionDecl::Create() takes as its T parameter the type of function
that should be created, not the return type. Passing in the return type
looks to have been copypasta'd around a bit, but the number of correct
usages outweighs the incorrect ones so I've opted for keeping what T is
the same and fixing up the call sites instead.

This fixes a crash in Clang when attempting to compile the following
snippet of code with -fblocks -fsanitize=function -x objective-c++ (my
original repro case):

  void g(void(^)());
  void f()
  {
      __block int a = 0;
        g(^(){ a++; });
  }

as well as the following which only requires -fsanitize=function -x c++:

  void f(char * buf)
  {
      __builtin_os_log_format(buf, "");
  }

Patch by: Ben (bobsayshilol)

Differential revision: https://reviews.llvm.org/D53263

llvm-svn: 346601
2018-11-11 00:56:15 +00:00
..
CMakeLists.txt Attempt to fix shared library build: RewriteFrontend depends on Serialization after r305116. 2017-06-09 22:02:33 +00:00
FixItRewriter.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
FrontendActions.cpp [modules] Support use of -E on modules built from the command line. 2018-09-15 01:21:18 +00:00
HTMLPrint.cpp Clean up use of C allocation functions 2018-02-21 02:02:39 +00:00
InclusionRewriter.cpp Fix clang -Wimplicit-fallthrough warnings across llvm, NFC 2018-11-01 19:54:45 +00:00
RewriteMacros.cpp Spelling mistakes in comments. NFCI. (PR27635) 2017-03-30 14:13:19 +00:00
RewriteModernObjC.cpp Pass the function type instead of the return type to FunctionDecl::Create 2018-11-11 00:56:15 +00:00
RewriteObjC.cpp NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects) 2018-10-30 20:31:30 +00:00
RewriteTest.cpp