llvm-project/clang/lib
Jordan Rose 9503501dae [analyzer] When forced to fake a block type, do it correctly.
BlockDecl has a poor AST representation because it doesn't carry its type
with it. Instead, the containing BlockExpr has the full type. This almost
never matters for the analyzer, but if the block decl contains static
local variables we need to synthesize a region to put them in, and this
region will necessarily not have the right type.

Even /that/ doesn't matter, unless

(1) the block calls the function or method containing the block, and
(2) the value of the block expr is used in some interesting way.

In this case, we actually end up needing the type of the block region,
and it will be set to our synthesized type. It turns out we've been doing
a terrible job faking that type -- it wasn't a block pointer type at all.
This commit fixes that to at least guarantee a block pointer type, using
the signature written by the user if there is one.

This is not really a correct answer because the block region's type will
/still/ be wrong, but further efforts to make this right in the analyzer
would probably be silly. We should just change the AST.

rdar://problem/21698099

llvm-svn: 241944
2015-07-10 21:41:59 +00:00
..
ARCMigrate Switch users of the 'for (StmtRange range = stmt->children(); range; ++range)‘ pattern to range for loops. 2015-07-02 21:03:14 +00:00
AST [MS ABI] Don't generates code for unreferenced inline definitions of library builtins 2015-07-10 20:55:38 +00:00
ASTMatchers Replace some const std::string & with llvm::StringRef or std::string 2015-07-06 08:47:15 +00:00
Analysis Rewrite users of Stmt::child_begin/end into for-range loops. 2015-07-03 15:12:24 +00:00
Basic Fix a couple of typos: specifc->specific. 2015-07-10 18:25:52 +00:00
CodeGen [inlineasm] Attach readonly and readnone to inline-asm instructions. 2015-07-10 18:44:40 +00:00
Driver Add an experimental flag -fsanitize-memory-use-after-dtor. 2015-07-10 20:07:16 +00:00
Edit [edit] Don't hit an assert when trying to delete a trailing space at EOF 2015-03-29 18:07:29 +00:00
Format clang-format: [JS] Assign proper penalties when breaking a type annotation 2015-07-10 13:39:26 +00:00
Frontend Add an experimental flag -fsanitize-memory-use-after-dtor. 2015-07-10 20:07:16 +00:00
FrontendTool Provide a BuryPointer for unique_ptrs. 2014-08-29 16:53:14 +00:00
Headers Add missing builtins to altivec.h for ABI compliance (vol. 3) 2015-07-10 13:11:34 +00:00
Index Rename MacroDefinition -> MacroDefinitionRecord, Preprocessor::MacroDefinition -> MacroDefinition. 2015-05-04 02:25:31 +00:00
Lex [modules] Fix "prefer own module over others" rule when selecting a module for a header to work in the presence of module hierarchy. 2015-07-10 20:09:49 +00:00
Parse Revert "parser: wordsmith diagnostic message" and "parser: diagnose empty attribute blocks" 2015-07-08 05:55:00 +00:00
Rewrite Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
Sema Fix a couple of typos: specifc->specific. 2015-07-10 18:25:52 +00:00
Serialization [modules] Fix crash when writing an update record for a redeclaration of an empty namespace. 2015-07-08 21:15:32 +00:00
StaticAnalyzer [analyzer] When forced to fake a block type, do it correctly. 2015-07-10 21:41:59 +00:00
Tooling Driver: Remove the Job class. NFC 2015-07-02 22:52:08 +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