mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[AST] For USR generation, ignore symbols coming from the builtin module.
Swift SVN r17858
This commit is contained in:
@@ -394,6 +394,9 @@ public:
|
||||
/// \returns true if this module is the "swift" standard library module.
|
||||
bool isStdlibModule() const;
|
||||
|
||||
/// \returns true if this module is the "builtin" module.
|
||||
bool isBuiltinModule() const;
|
||||
|
||||
/// \returns true if this module is a system module; note that the StdLib is
|
||||
/// considered a system module.
|
||||
bool isSystemModule() const;
|
||||
|
||||
@@ -1070,6 +1070,10 @@ bool Module::isStdlibModule() const {
|
||||
return !getParent() && Name == Ctx.StdlibModuleName;
|
||||
}
|
||||
|
||||
bool Module::isBuiltinModule() const {
|
||||
return this == Ctx.TheBuiltinModule;
|
||||
}
|
||||
|
||||
bool Module::isSystemModule() const {
|
||||
if (isStdlibModule())
|
||||
return true;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "swift/AST/ASTContext.h"
|
||||
#include "swift/AST/Module.h"
|
||||
#include "swift/AST/USRGeneration.h"
|
||||
#include "swift/AST/Mangle.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
@@ -33,6 +34,8 @@ bool ide::printDeclUSR(const ValueDecl *D, raw_ostream &OS) {
|
||||
|
||||
if (isa<VarDecl>(D) && !D->hasName())
|
||||
return true; // Ignore.
|
||||
if (D->getModuleContext()->isBuiltinModule())
|
||||
return true; // Ignore.
|
||||
|
||||
ValueDecl *VD = const_cast<ValueDecl *>(D);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user