Skip to content

Commit 4b4a00d

Browse files
authored
merge main into amd-staging (llvm#2342)
2 parents b8a7ea1 + 17c59b2 commit 4b4a00d

38 files changed

+1272
-841
lines changed

clang/lib/AST/ByteCode/Function.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class Function final {
115115

116116
/// Returns the name of the function decl this code
117117
/// was generated for.
118-
const std::string getName() const {
118+
std::string getName() const {
119119
if (!Source || !getDecl())
120120
return "<<expr>>";
121121

clang/lib/Driver/ToolChains/ZOS.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,10 @@ void zos::Linker::ConstructJob(Compilation &C, const JobAction &JA,
153153
StringRef OutputName = Output.getFilename();
154154
// Strip away the last file suffix in presence from output name and add
155155
// a new .x suffix.
156-
size_t Suffix = OutputName.find_last_of('.');
157-
const char *SideDeckName =
158-
Args.MakeArgString(OutputName.substr(0, Suffix) + ".x");
156+
SmallString<128> SideDeckName = OutputName;
157+
llvm::sys::path::replace_extension(SideDeckName, "x");
159158
CmdArgs.push_back("-x");
160-
CmdArgs.push_back(SideDeckName);
159+
CmdArgs.push_back(Args.MakeArgString(SideDeckName));
161160
} else {
162161
// We need to direct side file to /dev/null to suppress linker warning when
163162
// the object file contains exported symbols, and -shared or
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Try using various forms of output file name to see what side deck file name looks like
2+
// RUN: %clang -### --shared --target=s390x-ibm-zos %s -o foo.out 2>&1 \
3+
// RUN: | FileCheck --check-prefix=SD-BASE %s
4+
// RUN: %clang -### --shared --target=s390x-ibm-zos %s -o foo 2>&1 \
5+
// RUN: | FileCheck --check-prefix=SD-BASE %s
6+
// SD-BASE: "-x" "foo.x"
7+
8+
// RUN: %clang -### --shared --target=s390x-ibm-zos %s -o lib/foo.out 2>&1 \
9+
// RUN: | FileCheck --check-prefix=SD-SUBDIR %s
10+
// RUN: %clang -### --shared --target=s390x-ibm-zos %s -o lib/foo 2>&1 \
11+
// RUN: | FileCheck --check-prefix=SD-SUBDIR %s
12+
// SD-SUBDIR: "-x" "lib/foo.x"
13+
14+
15+
// RUN: %clang -### --shared --target=s390x-ibm-zos %s -o ../lib/foo.out 2>&1 \
16+
// RUN: | FileCheck --check-prefix=SD-REL %s
17+
// RUN: %clang -### --shared --target=s390x-ibm-zos %s -o ../lib/foo 2>&1 \
18+
// RUN: | FileCheck --check-prefix=SD-REL %s
19+
// SD-REL: "-x" "../lib/foo.x"

llvm/include/llvm/MC/MCLinkerOptimizationHint.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class MCLOHDirective {
108108
/// Emit this directive in \p OutStream using the information available
109109
/// in the given \p ObjWriter and \p Layout to get the address of the
110110
/// arguments within the object file.
111-
void emit_impl(const MCAssembler &Asm, raw_ostream &OutStream,
111+
void emit_impl(raw_ostream &OutStream,
112112
const MachObjectWriter &ObjWriter) const;
113113

114114
public:

llvm/include/llvm/MC/MCMachObjectWriter.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,8 @@ class MachObjectWriter final : public MCObjectWriter {
184184

185185
const MCSymbol &findAliasedSymbol(const MCSymbol &Sym) const;
186186

187-
/// \name Lifetime management Methods
188-
/// @{
189-
190187
void reset() override;
191-
192-
/// @}
188+
void setAssembler(MCAssembler *Asm) override;
193189

194190
/// \name Utility Methods
195191
/// @{
@@ -208,7 +204,7 @@ class MachObjectWriter final : public MCObjectWriter {
208204
uint64_t getSectionAddress(const MCSection *Sec) const {
209205
return SectionAddress.lookup(Sec);
210206
}
211-
uint64_t getSymbolAddress(const MCSymbol &S, const MCAssembler &Asm) const;
207+
uint64_t getSymbolAddress(const MCSymbol &S) const;
212208

213209
uint64_t getFragmentAddress(const MCAssembler &Asm,
214210
const MCFragment *Fragment) const;

llvm/include/llvm/MC/MCObjectWriter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class MCObjectWriter {
9797
MutableArrayRef<std::pair<std::string, size_t>> getFileNames() {
9898
return FileNames;
9999
}
100-
void addFileName(MCAssembler &Asm, StringRef FileName);
100+
void addFileName(StringRef FileName);
101101
void setCompilerVersion(StringRef CompilerVers) {
102102
CompilerVersion = CompilerVers;
103103
}

llvm/include/llvm/MC/MCParser/AsmLexer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ class AsmLexer {
213213
StringRef LexUntilEndOfLine();
214214
};
215215

216-
using MCAsmLexer = AsmLexer;
217-
218216
} // end namespace llvm
219217

220218
#endif // LLVM_MC_MCPARSER_ASMLEXER_H

llvm/include/llvm/MC/MCParser/MCAsmLexer.h

Lines changed: 0 additions & 9 deletions
This file was deleted.

llvm/include/llvm/MC/MCParser/MCAsmParser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ class MCAsmParser {
163163
MCContext &getContext() { return Ctx; }
164164
MCStreamer &getStreamer() { return Out; }
165165
SourceMgr &getSourceManager() { return SrcMgr; }
166-
MCAsmLexer &getLexer() { return Lexer; }
167-
const MCAsmLexer &getLexer() const { return Lexer; }
166+
AsmLexer &getLexer() { return Lexer; }
167+
const AsmLexer &getLexer() const { return Lexer; }
168168

169169
MCTargetAsmParser &getTargetParser() const { return *TargetParser; }
170170
void setTargetParser(MCTargetAsmParser &P);

llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class MCAsmParserExtension {
5353

5454
MCContext &getContext() { return getParser().getContext(); }
5555

56-
MCAsmLexer &getLexer() { return getParser().getLexer(); }
57-
const MCAsmLexer &getLexer() const {
56+
AsmLexer &getLexer() { return getParser().getLexer(); }
57+
const AsmLexer &getLexer() const {
5858
return const_cast<MCAsmParserExtension *>(this)->getLexer();
5959
}
6060

0 commit comments

Comments
 (0)