]> granicus.if.org Git - clang/commitdiff
Teach objc-rewriter to pass -fobjc-exceptions along.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 25 Feb 2011 17:24:55 +0000 (17:24 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 25 Feb 2011 17:24:55 +0000 (17:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126497 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CompilerInvocation.cpp
test/Rewriter/rewrite-try-catch.m

index 0a1b2572d540e80b8e58d37908193a29d6e21b26..b9d15ad01ab126bbd2bd85dacc6bc96c3b3a1ad6 100644 (file)
@@ -1663,8 +1663,11 @@ void CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
   InputKind DashX = ParseFrontendArgs(Res.getFrontendOpts(), *Args, Diags);
   ParseCodeGenArgs(Res.getCodeGenOpts(), *Args, DashX, Diags);
   ParseHeaderSearchArgs(Res.getHeaderSearchOpts(), *Args);
-  if (DashX != IK_AST && DashX != IK_LLVM_IR)
+  if (DashX != IK_AST && DashX != IK_LLVM_IR) {
     ParseLangArgs(Res.getLangOpts(), *Args, DashX, Diags);
+    if (Res.getFrontendOpts().ProgramAction == frontend::RewriteObjC)
+      Res.getLangOpts().ObjCExceptions = 1;
+  }
   // FIXME: ParsePreprocessorArgs uses the FileManager to read the contents of
   // PCH file and find the original header name. Remove the need to do that in
   // ParsePreprocessorArgs and remove the FileManager 
index 5e7b3cf9040762890863e1dae2bf6d22eb43f78c..d0c6d2acf67d1bc5692db8e7f3b5bb7f6fa77cd1 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -rewrite-objc -fobjc-exceptions %s -o -
+// RUN: %clang_cc1 -rewrite-objc %s -o -
 
 @interface Foo @end
 @interface GARF @end