summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2018-12-05 13:56:26 +0000
committerRenato Golin <renato.golin@linaro.org>2018-12-05 13:56:26 +0000
commit5419a3ce123b8ba557fab1ed722946d0efef1379 (patch)
treec49f21e71211c0f209e7fbe736d13e33ed887397
parentd0afe724d1f5ca3e0a46e75849450a934ffa5ef2 (diff)
downloadbcm5719-llvm-5419a3ce123b8ba557fab1ed722946d0efef1379.tar.gz
bcm5719-llvm-5419a3ce123b8ba557fab1ed722946d0efef1379.zip
Revert: Honor -fdebug-prefix-map when creating function names for the debug info.
This commit reverts r348060 and r348062 due to it breaking the AArch64 Full buildbot: https://bugs.llvm.org/show_bug.cgi?id=39892 llvm-svn: 348364
-rw-r--r--clang/include/clang/AST/PrettyPrinter.h35
-rw-r--r--clang/lib/AST/TypePrinter.cpp10
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp3
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.h6
-rw-r--r--clang/test/CodeGenCXX/debug-prefix-map-lambda.cpp10
5 files changed, 21 insertions, 43 deletions
diff --git a/clang/include/clang/AST/PrettyPrinter.h b/clang/include/clang/AST/PrettyPrinter.h
index 0a4dc42898f..ed6b97f9b9b 100644
--- a/clang/include/clang/AST/PrettyPrinter.h
+++ b/clang/include/clang/AST/PrettyPrinter.h
@@ -38,20 +38,21 @@ public:
struct PrintingPolicy {
/// Create a default printing policy for the specified language.
PrintingPolicy(const LangOptions &LO)
- : Indentation(2), SuppressSpecifiers(false),
- SuppressTagKeyword(LO.CPlusPlus), IncludeTagDefinition(false),
- SuppressScope(false), SuppressUnwrittenScope(false),
- SuppressInitializers(false), ConstantArraySizeAsWritten(false),
- AnonymousTagLocations(true), SuppressStrongLifetime(false),
- SuppressLifetimeQualifiers(false),
- SuppressTemplateArgsInCXXConstructors(false), Bool(LO.Bool),
- Restrict(LO.C99), Alignof(LO.CPlusPlus11), UnderscoreAlignof(LO.C11),
- UseVoidForZeroParams(!LO.CPlusPlus), TerseOutput(false),
- PolishForDeclaration(false), Half(LO.Half),
- MSWChar(LO.MicrosoftExt && !LO.WChar), IncludeNewlines(true),
- MSVCFormatting(false), ConstantsAsWritten(false),
- SuppressImplicitBase(false), FullyQualifiedName(false),
- RemapFilePaths(false) {}
+ : Indentation(2), SuppressSpecifiers(false),
+ SuppressTagKeyword(LO.CPlusPlus),
+ IncludeTagDefinition(false), SuppressScope(false),
+ SuppressUnwrittenScope(false), SuppressInitializers(false),
+ ConstantArraySizeAsWritten(false), AnonymousTagLocations(true),
+ SuppressStrongLifetime(false), SuppressLifetimeQualifiers(false),
+ SuppressTemplateArgsInCXXConstructors(false),
+ Bool(LO.Bool), Restrict(LO.C99),
+ Alignof(LO.CPlusPlus11), UnderscoreAlignof(LO.C11),
+ UseVoidForZeroParams(!LO.CPlusPlus),
+ TerseOutput(false), PolishForDeclaration(false),
+ Half(LO.Half), MSWChar(LO.MicrosoftExt && !LO.WChar),
+ IncludeNewlines(true), MSVCFormatting(false),
+ ConstantsAsWritten(false), SuppressImplicitBase(false),
+ FullyQualifiedName(false) { }
/// Adjust this printing policy for cases where it's known that we're
/// printing C++ code (for instance, if AST dumping reaches a C++-only
@@ -224,12 +225,6 @@ struct PrintingPolicy {
/// When true, print the fully qualified name of function declarations.
/// This is the opposite of SuppressScope and thus overrules it.
unsigned FullyQualifiedName : 1;
-
- /// Whether to apply -fdebug-prefix-map to any file paths.
- unsigned RemapFilePaths : 1;
-
- /// When RemapFilePaths is true, this function performs the action.
- std::function<std::string(StringRef)> remapPath;
};
} // end namespace clang
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp
index c05169389c6..365f84c5990 100644
--- a/clang/lib/AST/TypePrinter.cpp
+++ b/clang/lib/AST/TypePrinter.cpp
@@ -1157,13 +1157,9 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream &OS) {
PresumedLoc PLoc = D->getASTContext().getSourceManager().getPresumedLoc(
D->getLocation());
if (PLoc.isValid()) {
- OS << " at ";
- StringRef File = PLoc.getFilename();
- if (Policy.RemapFilePaths)
- OS << Policy.remapPath(File);
- else
- OS << File;
- OS << ':' << PLoc.getLine() << ':' << PLoc.getColumn();
+ OS << " at " << PLoc.getFilename()
+ << ':' << PLoc.getLine()
+ << ':' << PLoc.getColumn();
}
}
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 3492fbacd33..dbceaa7aa86 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -235,9 +235,6 @@ PrintingPolicy CGDebugInfo::getPrintingPolicy() const {
if (CGM.getCodeGenOpts().EmitCodeView)
PP.MSVCFormatting = true;
- // Apply -fdebug-prefix-map.
- PP.RemapFilePaths = true;
- PP.remapPath = [this](StringRef Path) { return remapDIPath(Path); };
return PP;
}
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index 4b627d615f8..93c9b7d3671 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -341,9 +341,6 @@ public:
void finalize();
- /// Remap a given path with the current debug prefix map
- std::string remapDIPath(StringRef) const;
-
/// Register VLA size expression debug node with the qualified type.
void registerVLASizeExpression(QualType Ty, llvm::Metadata *SizeExpr) {
SizeExprCache[Ty] = SizeExpr;
@@ -531,6 +528,9 @@ private:
/// Create new compile unit.
void CreateCompileUnit();
+ /// Remap a given path with the current debug prefix map
+ std::string remapDIPath(StringRef) const;
+
/// Compute the file checksum debug info for input file ID.
Optional<llvm::DIFile::ChecksumKind>
computeChecksum(FileID FID, SmallString<32> &Checksum) const;
diff --git a/clang/test/CodeGenCXX/debug-prefix-map-lambda.cpp b/clang/test/CodeGenCXX/debug-prefix-map-lambda.cpp
deleted file mode 100644
index f0fb1a312c8..00000000000
--- a/clang/test/CodeGenCXX/debug-prefix-map-lambda.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple \
-// RUN: -fdebug-prefix-map=%S=/SOURCE_ROOT %s -emit-llvm -o - | FileCheck %s
-
-template <typename T> void b(T) {}
-void c() {
- // CHECK: !DISubprogram(name: "b<(lambda at
- // CHECK-SAME: SOURCE_ROOT
- // CHECK-SAME: [[@LINE+1]]:{{[0-9]+}})>"
- b([]{});
-}
OpenPOWER on IntegriCloud