Preserve -fretain-comments-from-system-headers in modules
authorBen Langmuir <blangmuir@apple.com>
Thu, 9 Jan 2014 20:53:49 +0000 (20:53 +0000)
committerBen Langmuir <blangmuir@apple.com>
Thu, 9 Jan 2014 20:53:49 +0000 (20:53 +0000)
Preserves the setting of -fretain-comments-from-system-headers when
building/saving/loading module files. This allows code completion to pick up
documentation comments from system modules.

llvm-svn: 198890

clang/include/clang/Basic/LangOptions.def
clang/test/Index/Inputs/retain-comments-from-system-headers-module.map [new file with mode: 0644]
clang/test/Index/retain-comments-from-system-headers.c

index 5a1025c..cbde6e2 100644 (file)
@@ -178,7 +178,7 @@ VALUE_LANGOPT(MSCVersion, 32, 0,
 
 LANGOPT(ApplePragmaPack, 1, 0, "Apple gcc-compatible #pragma pack handling")
 
-BENIGN_LANGOPT(RetainCommentsFromSystemHeaders, 1, 0, "retain documentation comments from system headers in the AST")
+LANGOPT(RetainCommentsFromSystemHeaders, 1, 0, "retain documentation comments from system headers in the AST")
 
 #undef LANGOPT
 #undef VALUE_LANGOPT
diff --git a/clang/test/Index/Inputs/retain-comments-from-system-headers-module.map b/clang/test/Index/Inputs/retain-comments-from-system-headers-module.map
new file mode 100644 (file)
index 0000000..0b77f3c
--- /dev/null
@@ -0,0 +1,4 @@
+module retain_comments_from_system_headers {
+  header "retain-comments-from-system-headers.h"
+  export *
+}
index 67a0fd0..bc6021f 100644 (file)
@@ -11,9 +11,12 @@ int user_function(int a);
 // RUN: c-index-test -test-load-source all %s -I %S/Inputs | FileCheck %s
 // RUN: c-index-test -test-load-source all %s -fretain-comments-from-system-headers -I %S/Inputs | FileCheck %s -check-prefix=CHECK-RETAIN
 
+// Modules:
+// RUN: c-index-test -test-load-source all %s -I %S/Inputs -fmodules -fmodules-cache-path=%t/cache -fmodule-map-file=%S/Inputs/retain-comments-from-system-headers-module.map | FileCheck %s -check-prefix=CHECK
+// RUN: c-index-test -test-load-source all %s -fretain-comments-from-system-headers -I %S/Inputs -fmodules -fmodules-cache-path=%t/cache -fmodule-map-file=%S/Inputs/retain-comments-from-system-headers-module.map | FileCheck %s -check-prefix=CHECK-RETAIN
+
 // CHECK: retain-comments-from-system-headers.h:7:5: FunctionDecl=system_function:7:5 Extent=[7:1 - 7:27]
 // CHECK: retain-comments-from-system-headers.c:9:5: FunctionDecl=user_function:9:5 RawComment=[/**\n * user_function\n * \param a Aaa.\n */] RawCommentRange=[5:1 - 8:4] BriefComment=[user_function]
 
 // CHECK-RETAIN: retain-comments-from-system-headers.h:7:5: FunctionDecl=system_function:7:5 RawComment=[/**\n * system_function\n * \param a Aaa.\n */] RawCommentRange=[3:1 - 6:4] BriefComment=[system_function]
 // CHECK-RETAIN: retain-comments-from-system-headers.c:9:5: FunctionDecl=user_function:9:5 RawComment=[/**\n * user_function\n * \param a Aaa.\n */] RawCommentRange=[5:1 - 8:4] BriefComment=[user_function]
-