/// argument and how it is interpreted. Defaults to NoAlignment.
LCOMM::LCOMMType LCOMMDirectiveAlignmentType = LCOMM::NoAlignment;
+ /// True if the target only has basename for .file directive. False if the
+ /// target also needs the directory along with the basename. Default to true.
+ bool HasBasenameOnlyForFileDirective = true;
+
// True if the target allows .align directives on functions. This is true for
// most targets, so defaults to true.
bool HasFunctionAlignment = true;
return LCOMMDirectiveAlignmentType;
}
+ bool hasBasenameOnlyForFileDirective() const {
+ return HasBasenameOnlyForFileDirective;
+ }
bool hasFunctionAlignment() const { return HasFunctionAlignment; }
bool hasDotTypeDotSizeDirective() const { return HasDotTypeDotSizeDirective; }
bool hasSingleParameterDotFile() const { return HasSingleParameterDotFile; }
// don't, this at least helps the user find where a global came from.
if (MAI->hasSingleParameterDotFile()) {
// .file "foo.c"
- OutStreamer->emitFileDirective(
- llvm::sys::path::filename(M.getSourceFileName()));
+ if (MAI->hasBasenameOnlyForFileDirective())
+ OutStreamer->emitFileDirective(
+ llvm::sys::path::filename(M.getSourceFileName()));
+ else
+ OutStreamer->emitFileDirective(M.getSourceFileName());
}
GCModuleInfo *MI = getAnalysisIfAvailable<GCModuleInfo>();
MCAsmInfoXCOFF::MCAsmInfoXCOFF() {
IsLittleEndian = false;
HasVisibilityOnlyWithLinkage = true;
+ HasBasenameOnlyForFileDirective = false;
PrivateGlobalPrefix = "L..";
PrivateLabelPrefix = "L..";
SupportsQuotedNames = false;
--- /dev/null
+; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff < %s \
+; RUN: | FileCheck %s
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff < %s \
+; RUN: | FileCheck %s
+
+; CHECK: .file "/absolute/path/to/file"
+
+source_filename = "/absolute/path/to/file"
--- /dev/null
+; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff < %s \
+; RUN: | FileCheck %s
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff < %s \
+; RUN: | FileCheck %s
+
+; CHECK: .file "../relative/path/to/file"
+
+source_filename = "../relative/path/to/file"