summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-09-30 05:12:12 +0000
committerJohn McCall <rjmccall@apple.com>2011-09-30 05:12:12 +0000
commit32f5fe1467c4f6cb9c3efe174cb6c8a374e6e149 (patch)
tree0045d1a99fc26a8c59d42184c0f322b6e97d7712 /clang/lib/Lex/PPDirectives.cpp
parent3360b411a5cddd9b7067147b3621d90b56dd90a8 (diff)
downloadbcm5719-llvm-32f5fe1467c4f6cb9c3efe174cb6c8a374e6e149.tar.gz
bcm5719-llvm-32f5fe1467c4f6cb9c3efe174cb6c8a374e6e149.zip
Add explicit attributes to mark functions as having had their
CoreFoundation object-transfer properties audited, and add a #pragma to cause them to be automatically applied to functions in a particular span of code. This has to be implemented largely in the preprocessor because of the requirement that the region be entirely contained in a single file; that's hard to impose from the parser without registering for a ton of callbacks. llvm-svn: 140846
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index fc147e420e1..95f7ca9644b 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -1217,6 +1217,15 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
return;
}
+ // Complain about attempts to #include files in an audit pragma.
+ if (PragmaARCCFCodeAuditedLoc.isValid()) {
+ Diag(HashLoc, diag::err_pp_include_in_arc_cf_code_audited);
+ Diag(PragmaARCCFCodeAuditedLoc, diag::note_pragma_entered_here);
+
+ // Immediately leave the pragma.
+ PragmaARCCFCodeAuditedLoc = SourceLocation();
+ }
+
// Search include directories.
const DirectoryLookup *CurDir;
llvm::SmallString<1024> SearchPath;
OpenPOWER on IntegriCloud