From: Ben Langmuir Date: Thu, 9 Jan 2014 20:53:49 +0000 (+0000) Subject: Preserve -fretain-comments-from-system-headers in modules X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de049233441fc12e2f01f0662bdd0bfc8b15111f;p=platform%2Fupstream%2Fllvm.git Preserve -fretain-comments-from-system-headers in modules 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 --- diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def index 5a1025c..cbde6e2 100644 --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -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 index 0000000..0b77f3c --- /dev/null +++ b/clang/test/Index/Inputs/retain-comments-from-system-headers-module.map @@ -0,0 +1,4 @@ +module retain_comments_from_system_headers { + header "retain-comments-from-system-headers.h" + export * +} diff --git a/clang/test/Index/retain-comments-from-system-headers.c b/clang/test/Index/retain-comments-from-system-headers.c index 67a0fd0..bc6021f 100644 --- a/clang/test/Index/retain-comments-from-system-headers.c +++ b/clang/test/Index/retain-comments-from-system-headers.c @@ -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] -