[prev in list] [next in list] [prev in thread] [next in thread]
List: cfe-commits
Subject: Re: [PATCH] D11403: [Modules] Add Darwin-specific compatibility module map parsing hacks
From: Richard Smith via cfe-commits <cfe-commits () lists ! llvm ! org>
Date: 2015-08-12 18:36:11
Message-ID: 96ce52f5ed4511e620c276aba52822b2 () localhost ! localdomain
[Download RAW message or body]
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.
Looks fine, go ahead once you're satisfied that the performance is OK for the \
`requires excluded` / umbrella dir hack.
================
Comment at: include/clang/Basic/Module.h:363
@@ +362,3 @@
+ /// This is more efficient than getFullModuleName().
+ bool fullModuleNameEqual(ArrayRef<StringRef> nameParts) const;
+
----------------
`fullModuleNameEquals` (extra 's' at the end) or `fullModuleNameIs` maybe?
================
Comment at: lib/Basic/Module.cpp:142-147
@@ +141,8 @@
+bool Module::fullModuleNameEqual(ArrayRef<StringRef> nameParts) const {
+ for (const Module *M = this; M; M = M->Parent) {
+ if (nameParts.empty() || M->Name != nameParts.back())
+ return false;
+ nameParts = nameParts.drop_back();
+ }
+ return nameParts.empty();
+}
----------------
Seems weird to do this by modifying `nameParts` rather than tracking an index, but \
OK...
================
Comment at: lib/Lex/ModuleMap.cpp:1025-1026
@@ +1024,4 @@
+ /// non-modular headers. For backwards compatibility, we continue to
+ /// support
+ /// this idiom for just these modules, and map the headers to 'textual' to
+ /// match the original intent.
----------------
Unnecessary newline?
================
Comment at: lib/Lex/ModuleMap.cpp:1607-1608
@@ +1606,4 @@
+ M->fullModuleNameEqual(TclPrivate))) {
+ IsRequiresExcludedHack = true;
+ return false;
+ } else if (Feature == "cplusplus" && M->fullModuleNameEqual(IOKitAVC)) {
----------------
Overindented.
Repository:
rL LLVM
http://reviews.llvm.org/D11403
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic