Skip to content

Commit 3660ee5

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:c13f7e17409b into amd-gfx:abbd8f9cb6f8
Local branch amd-gfx abbd8f9 Merged main:a51196ec6ed7 into amd-gfx:1962fcd7d484 Remote branch main c13f7e1 [flang][runtime] Allow already-documented missing w on edit descriptor (llvm#72901)
2 parents abbd8f9 + c13f7e1 commit 3660ee5

File tree

209 files changed

+16044
-20390
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+16044
-20390
lines changed

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,8 @@ void DWARFRewriter::updateDebugInfo() {
679679
assert(CompDirAttrInfo && "DW_AT_comp_dir is not in Skeleton CU.");
680680

681681
if (!opts::DwarfOutputPath.empty()) {
682+
if (!sys::fs::exists(opts::DwarfOutputPath))
683+
sys::fs::create_directory(opts::DwarfOutputPath);
682684
addStringHelper(DIEBldr, UnitDIE, Unit, CompDirAttrInfo,
683685
opts::DwarfOutputPath.c_str());
684686
}

bolt/test/X86/dwarf5-df-output-dir-same-name.test

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,19 @@
2121
; BOLT: split.dwo1.dwo
2222
; BOLT: DW_AT_dwo_name ("split.dwo0.dwo")
2323
; BOLT: DW_AT_dwo_name ("split.dwo1.dwo")
24+
25+
; Tests that when --dwarf-output-path is specified, but path do not exist BOLT creates it.
26+
27+
; RUN: rm -rf dwo
28+
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections --dwarf-output-path=%t/dwo
29+
; RUN: ls -l %t/dwo > log
30+
; RUN: llvm-dwarfdump --debug-info main.exe.bolt >> log
31+
; RUN: cat log | FileCheck -check-prefix=BOLT1 %s
32+
33+
; Tests that BOLT handles correctly writing out .dwo files to the same directory when input has input where part of path
34+
; is in DW_AT_dwo_name and the .dwo file names are the same.
35+
36+
; BOLT1: split.dwo0.dwo
37+
; BOLT1: split.dwo1.dwo
38+
; BOLT1: DW_AT_dwo_name ("split.dwo0.dwo")
39+
; BOLT1: DW_AT_dwo_name ("split.dwo1.dwo")

clang/docs/ClangOffloadBundler.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ Additional Options while Archive Unbundling
500500
as defined in :ref:`code-object-composition` before creating device-specific
501501
archive(s).
502502

503-
504503
**-debug-only=CodeObjectCompatibility**
505504
Verbose printing of matched/unmatched comparisons between bundle entry id of
506505
a device binary from HDA and bundle entry ID of a given target processor

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5169,7 +5169,7 @@ def nodriverkitlib : Flag<["-"], "nodriverkitlib">;
51695169
def nofixprebinding : Flag<["-"], "nofixprebinding">;
51705170
def nolibc : Flag<["-"], "nolibc">;
51715171
def nomultidefs : Flag<["-"], "nomultidefs">;
5172-
def nopie : Flag<["-"], "nopie">, Visibility<[ClangOption, FlangOption]>;
5172+
def nopie : Flag<["-"], "nopie">, Visibility<[ClangOption, FlangOption]>, Flags<[TargetSpecific]>; // OpenBSD
51735173
def no_pie : Flag<["-"], "no-pie">, Visibility<[ClangOption, FlangOption]>;
51745174
def noprebind : Flag<["-"], "noprebind">;
51755175
def noprofilelib : Flag<["-"], "noprofilelib">;

clang/lib/CodeGen/CGObjC.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -827,11 +827,8 @@ static void emitStructGetterCall(CodeGenFunction &CGF, ObjCIvarDecl *ivar,
827827
// sizeof (Type of Ivar), isAtomic, false);
828828
CallArgList args;
829829

830-
llvm::Value *dest =
831-
CGF.Builder.CreateBitCast(CGF.ReturnValue.getPointer(), CGF.VoidPtrTy);
830+
llvm::Value *dest = CGF.ReturnValue.getPointer();
832831
args.add(RValue::get(dest), Context.VoidPtrTy);
833-
834-
src = CGF.Builder.CreateBitCast(src, CGF.VoidPtrTy);
835832
args.add(RValue::get(src), Context.VoidPtrTy);
836833

837834
CharUnits size = CGF.getContext().getTypeSizeInChars(ivar->getType());
@@ -1098,7 +1095,6 @@ static void emitCPPObjectAtomicGetterCall(CodeGenFunction &CGF,
10981095
llvm::Value *ivarAddr =
10991096
CGF.EmitLValueForIvar(CGF.TypeOfSelfObject(), CGF.LoadObjCSelf(), ivar, 0)
11001097
.getPointer(CGF);
1101-
ivarAddr = CGF.Builder.CreateBitCast(ivarAddr, CGF.Int8PtrTy);
11021098
args.add(RValue::get(ivarAddr), CGF.getContext().VoidPtrTy);
11031099

11041100
// Third argument is the helper function.
@@ -1340,7 +1336,6 @@ static void emitStructSetterCall(CodeGenFunction &CGF, ObjCMethodDecl *OMD,
13401336
argVar->getType().getNonReferenceType(), VK_LValue,
13411337
SourceLocation());
13421338
llvm::Value *argAddr = CGF.EmitLValue(&argRef).getPointer(CGF);
1343-
argAddr = CGF.Builder.CreateBitCast(argAddr, CGF.Int8PtrTy);
13441339
args.add(RValue::get(argAddr), CGF.getContext().VoidPtrTy);
13451340

13461341
// The third argument is the sizeof the type.
@@ -1377,7 +1372,6 @@ static void emitCPPObjectAtomicSetterCall(CodeGenFunction &CGF,
13771372
llvm::Value *ivarAddr =
13781373
CGF.EmitLValueForIvar(CGF.TypeOfSelfObject(), CGF.LoadObjCSelf(), ivar, 0)
13791374
.getPointer(CGF);
1380-
ivarAddr = CGF.Builder.CreateBitCast(ivarAddr, CGF.Int8PtrTy);
13811375
args.add(RValue::get(ivarAddr), CGF.getContext().VoidPtrTy);
13821376

13831377
// The second argument is the address of the parameter variable.
@@ -1386,7 +1380,6 @@ static void emitCPPObjectAtomicSetterCall(CodeGenFunction &CGF,
13861380
argVar->getType().getNonReferenceType(), VK_LValue,
13871381
SourceLocation());
13881382
llvm::Value *argAddr = CGF.EmitLValue(&argRef).getPointer(CGF);
1389-
argAddr = CGF.Builder.CreateBitCast(argAddr, CGF.Int8PtrTy);
13901383
args.add(RValue::get(argAddr), CGF.getContext().VoidPtrTy);
13911384

13921385
// Third argument is the helper function.
@@ -3685,7 +3678,6 @@ void CodeGenFunction::EmitExtendGCLifetime(llvm::Value *object) {
36853678
/* constraints */ "r",
36863679
/* side effects */ true);
36873680

3688-
object = Builder.CreateBitCast(object, VoidPtrTy);
36893681
EmitNounwindRuntimeCall(extender, object);
36903682
}
36913683

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,7 @@ llvm::Value *CGOpenMPRuntime::getThreadID(CodeGenFunction &CGF,
14411441
setLocThreadIdInsertPt(CGF);
14421442
CGBuilderTy::InsertPointGuard IPG(CGF.Builder);
14431443
CGF.Builder.SetInsertPoint(Elem.second.ServiceInsertPt);
1444+
auto DL = ApplyDebugLocation::CreateDefaultArtificial(CGF, Loc);
14441445
llvm::CallInst *Call = CGF.Builder.CreateCall(
14451446
OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(),
14461447
OMPRTL___kmpc_global_thread_num),

clang/lib/CodeGen/MicrosoftCXXABI.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,7 +2266,6 @@ MicrosoftCXXABI::performReturnAdjustment(CodeGenFunction &CGF, Address Ret,
22662266
if (RA.isEmpty())
22672267
return Ret.getPointer();
22682268

2269-
auto OrigTy = Ret.getType();
22702269
Ret = Ret.withElementType(CGF.Int8Ty);
22712270

22722271
llvm::Value *V = Ret.getPointer();
@@ -2283,8 +2282,7 @@ MicrosoftCXXABI::performReturnAdjustment(CodeGenFunction &CGF, Address Ret,
22832282
if (RA.NonVirtual)
22842283
V = CGF.Builder.CreateConstInBoundsGEP1_32(CGF.Int8Ty, V, RA.NonVirtual);
22852284

2286-
// Cast back to the original type.
2287-
return CGF.Builder.CreateBitCast(V, OrigTy);
2285+
return V;
22882286
}
22892287

22902288
bool MicrosoftCXXABI::requiresArrayCookie(const CXXDeleteExpr *expr,

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) {
496496
do {
497497
NextTok = Tokens->getNextToken();
498498
} while (NextTok->is(tok::comment));
499-
while (NextTok->is(tok::hash)) {
499+
while (NextTok->is(tok::hash) && !Line->InMacroBody) {
500500
NextTok = Tokens->getNextToken();
501501
do {
502502
NextTok = Tokens->getNextToken();

clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ void ModuleDepCollector::applyDiscoveredDependencies(CompilerInvocation &CI) {
316316

317317
static std::string getModuleContextHash(const ModuleDeps &MD,
318318
const CowCompilerInvocation &CI,
319-
bool EagerLoadModules) {
319+
bool EagerLoadModules,
320+
llvm::vfs::FileSystem &VFS) {
320321
llvm::HashBuilder<llvm::TruncatedBLAKE3<16>, llvm::endianness::native>
321322
HashBuilder;
322323
SmallString<32> Scratch;
@@ -325,6 +326,9 @@ static std::string getModuleContextHash(const ModuleDeps &MD,
325326
// will be readable.
326327
HashBuilder.add(getClangFullRepositoryVersion());
327328
HashBuilder.add(serialization::VERSION_MAJOR, serialization::VERSION_MINOR);
329+
llvm::ErrorOr<std::string> CWD = VFS.getCurrentWorkingDirectory();
330+
if (CWD)
331+
HashBuilder.add(*CWD);
328332

329333
// Hash the BuildInvocation without any input files.
330334
SmallString<0> ArgVec;
@@ -356,7 +360,8 @@ static std::string getModuleContextHash(const ModuleDeps &MD,
356360

357361
void ModuleDepCollector::associateWithContextHash(
358362
const CowCompilerInvocation &CI, ModuleDeps &Deps) {
359-
Deps.ID.ContextHash = getModuleContextHash(Deps, CI, EagerLoadModules);
363+
Deps.ID.ContextHash = getModuleContextHash(
364+
Deps, CI, EagerLoadModules, ScanInstance.getVirtualFileSystem());
360365
bool Inserted = ModuleDepsByID.insert({Deps.ID, &Deps}).second;
361366
(void)Inserted;
362367
assert(Inserted && "duplicate module mapping");

0 commit comments

Comments
 (0)