Skip to content

Commit 7b7122f

Browse files
Jacob Mizrajigottesmm
authored andcommitted
Update ClangImporter and IRGenDebugInfo to build with upstream clang
(cherry picked from commit dab04d0) (cherry picked from commit d6b6594)
1 parent f363c54 commit 7b7122f

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ getNormalInvocationArguments(std::vector<std::string> &invocationArgStrs,
453453
invocationArgStrs.push_back("-fmodules-cache-path=");
454454
invocationArgStrs.back().append(moduleCachePath);
455455
}
456-
456+
457457
if (importerOpts.DetailedPreprocessingRecord) {
458458
invocationArgStrs.insert(invocationArgStrs.end(), {
459459
"-Xclang", "-detailed-preprocessing-record",
@@ -831,7 +831,7 @@ void ClangImporter::Implementation::addMacrosToLookupTable(
831831
// Check whether we have a macro defined in this module.
832832
auto info = pp.getMacroInfo(macro.first);
833833
if (!info || info->isFromASTFile() || info->isBuiltinMacro()) continue;
834-
834+
835835
// Only interested in macro definitions.
836836
auto *defMD = dyn_cast<clang::DefMacroDirective>(MD);
837837
if (!defMD) continue;
@@ -909,7 +909,7 @@ bool ClangImporter::Implementation::importHeader(
909909
// Force the import to occur.
910910
pp.LookAhead(0);
911911

912-
SmallVector<clang::DeclGroupRef, 16> allParsedDecls;
912+
SmallVector<clang::DeclGroupRef, 16> allParsedDecls;
913913
auto handleParsed = [&](clang::DeclGroupRef parsed) {
914914
if (trackParsedSymbols) {
915915
for (auto *D : parsed) {
@@ -3144,7 +3144,7 @@ isAccessibilityConformingContext(const clang::DeclContext *ctx) {
31443144
return true;
31453145
}
31463146
return false;
3147-
3147+
31483148
}
31493149

31503150
/// Determine whether the given method potentially conflicts with the
@@ -3907,7 +3907,7 @@ static bool isVisibleClangEntry(clang::ASTContext &ctx,
39073907
// Check whether the macro is defined.
39083908
auto clangMacro = entry.get<clang::MacroInfo *>();
39093909
if (auto moduleID = clangMacro->getOwningModuleID()) {
3910-
if (auto module = ctx.getExternalSource()->getModule(moduleID))
3910+
if (auto module = ctx.getExternalSource()->getModule(moduleID))
39113911
return module->NameVisibility == clang::Module::AllVisible;
39123912
}
39133913

@@ -3976,7 +3976,8 @@ void ClangImporter::loadObjCMethods(
39763976
SmallVector<clang::ObjCMethodDecl *, 4> objcMethods;
39773977
auto &sema = Impl.Instance->getSema();
39783978
sema.CollectMultipleMethodsInGlobalPool(clangSelector, objcMethods,
3979-
isInstanceMethod);
3979+
isInstanceMethod,
3980+
/*CheckTheOther=*/false);
39803981

39813982
// Check whether this method is in the class we care about.
39823983
SmallVector<AbstractFunctionDecl *, 4> foundMethods;
@@ -4054,10 +4055,12 @@ void ClangModuleUnit::lookupObjCMethods(
40544055
auto &clangSema = owner.Impl.getClangSema();
40554056
clangSema.CollectMultipleMethodsInGlobalPool(clangSelector,
40564057
objcMethods,
4057-
/*instance=*/true);
4058+
/*instance=*/true,
4059+
/*CheckTheOther=*/false);
40584060
clangSema.CollectMultipleMethodsInGlobalPool(clangSelector,
40594061
objcMethods,
4060-
/*instance=*/false);
4062+
/*instance=*/false,
4063+
/*CheckTheOther=*/false);
40614064

40624065
// Import the methods.
40634066
auto &clangCtx = clangSema.getASTContext();
@@ -4102,7 +4105,7 @@ void ClangModuleUnit::collectLinkLibraries(
41024105
kind = LibraryKind::Framework;
41034106
else
41044107
kind = LibraryKind::Library;
4105-
4108+
41064109
callback(LinkLibrary(clangLinkLib.Library, kind));
41074110
}
41084111
}
@@ -4694,7 +4697,7 @@ EffectiveClangContext ClangImporter::Implementation::getEffectiveClangContext(
46944697

46954698
/// FIXME: Other type declarations should also be okay?
46964699
}
4697-
}
4700+
}
46984701
}
46994702

47004703
return EffectiveClangContext();

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ IRGenDebugInfo::IRGenDebugInfo(const IRGenOptions &Opts,
137137
Lang, AbsMainFile, Opts.DebugCompilationDir, Producer, IsOptimized,
138138
Flags, MajorRuntimeVersion, SplitName,
139139
Opts.DebugInfoKind == IRGenDebugInfoKind::LineTables
140-
? llvm::DIBuilder::LineTablesOnly
141-
: llvm::DIBuilder::FullDebug);
140+
? llvm::DICompileUnit::LineTablesOnly
141+
: llvm::DICompileUnit::FullDebug);
142142
MainFile = getOrCreateFile(BumpAllocatedString(AbsMainFile).data());
143143

144144
// Because the swift compiler relies on Clang to setup the Module,
@@ -1458,7 +1458,7 @@ llvm::DIType *IRGenDebugInfo::createType(DebugTypeInfo DbgTy,
14581458
llvm::dwarf::DW_TAG_structure_type, MangledName, Scope, File, 0,
14591459
llvm::dwarf::DW_LANG_Swift, SizeInBits, AlignInBits, Flags,
14601460
MangledName));
1461-
1461+
14621462
DITypeCache[DbgTy.getType()] = llvm::TrackingMDNodeRef(FwdDecl.get());
14631463

14641464
unsigned RealSize;
@@ -1663,7 +1663,7 @@ llvm::DIType *IRGenDebugInfo::createType(DebugTypeInfo DbgTy,
16631663
auto *CanTy = DictionaryTy->getDesugaredType();
16641664
return getOrCreateDesugaredType(CanTy, DbgTy);
16651665
}
1666-
1666+
16671667
case TypeKind::GenericTypeParam: {
16681668
auto *ParamTy = cast<GenericTypeParamType>(BaseTy);
16691669
// FIXME: Provide a more meaningful debug type.

0 commit comments

Comments
 (0)