summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate/TransformActions.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-04 23:43:03 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-04 23:43:03 +0000
commit6b2d47d8299ffd74c4418936da2322ce988340f5 (patch)
tree03f5ef2b90816eccb0076519ab5a3621e4d3fa8b /clang/lib/ARCMigrate/TransformActions.cpp
parentb0a48e1dd808fb95d46cc3f80089ea3b08a49ed6 (diff)
downloadbcm5719-llvm-6b2d47d8299ffd74c4418936da2322ce988340f5.tar.gz
bcm5719-llvm-6b2d47d8299ffd74c4418936da2322ce988340f5.zip
[arcmt] In GC, error out when there is a call that returns a pointer to
GC managed non-objc object memory. llvm-svn: 143747
Diffstat (limited to 'clang/lib/ARCMigrate/TransformActions.cpp')
-rw-r--r--clang/lib/ARCMigrate/TransformActions.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/ARCMigrate/TransformActions.cpp b/clang/lib/ARCMigrate/TransformActions.cpp
index ec676e909a3..7ad9b6005dc 100644
--- a/clang/lib/ARCMigrate/TransformActions.cpp
+++ b/clang/lib/ARCMigrate/TransformActions.cpp
@@ -122,6 +122,8 @@ public:
ASTContext &ctx, Preprocessor &PP)
: CapturedDiags(capturedDiags), Ctx(ctx), PP(PP), IsInTransaction(false) { }
+ ASTContext &getASTContext() { return Ctx; }
+
void startTransaction();
bool commitTransaction();
void abortTransaction();
@@ -674,6 +676,12 @@ void TransformActions::reportError(StringRef error, SourceLocation loc,
SourceRange range) {
assert(!static_cast<TransformActionsImpl*>(Impl)->isInTransaction() &&
"Errors should be emitted out of a transaction");
+
+ SourceManager &SM = static_cast<TransformActionsImpl*>(Impl)->
+ getASTContext().getSourceManager();
+ if (SM.isInSystemHeader(SM.getExpansionLoc(loc)))
+ return;
+
// FIXME: Use a custom category name to distinguish rewriter errors.
std::string rewriteErr = "[rewriter] ";
rewriteErr += error;
@@ -688,6 +696,12 @@ void TransformActions::reportNote(StringRef note, SourceLocation loc,
SourceRange range) {
assert(!static_cast<TransformActionsImpl*>(Impl)->isInTransaction() &&
"Errors should be emitted out of a transaction");
+
+ SourceManager &SM = static_cast<TransformActionsImpl*>(Impl)->
+ getASTContext().getSourceManager();
+ if (SM.isInSystemHeader(SM.getExpansionLoc(loc)))
+ return;
+
// FIXME: Use a custom category name to distinguish rewriter errors.
std::string rewriteNote = "[rewriter] ";
rewriteNote += note;
OpenPOWER on IntegriCloud