diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-04 23:43:03 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-04 23:43:03 +0000 |
commit | 1fe4203ca05d0a3283efc8a2e8c01ecdf78fbf2e (patch) | |
tree | 82d9ed955ef92f4b9120fb32920e6832377fe1b5 /lib/ARCMigrate/TransformActions.cpp | |
parent | e71202efccdead44c8a3d4a2296d866d0e89799b (diff) |
[arcmt] In GC, error out when there is a call that returns a pointer to
GC managed non-objc object memory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ARCMigrate/TransformActions.cpp')
-rw-r--r-- | lib/ARCMigrate/TransformActions.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/ARCMigrate/TransformActions.cpp b/lib/ARCMigrate/TransformActions.cpp index ec676e909a..7ad9b6005d 100644 --- a/lib/ARCMigrate/TransformActions.cpp +++ b/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; |