From: Mehdi Amini Date: Thu, 6 Oct 2016 23:41:49 +0000 (+0000) Subject: Revert "Add a static_assert to enforce that parameters to llvm::format() are not... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f95e5b2e32fa6c15cd837deb55aa51a97ecdff5;p=llvm Revert "Add a static_assert to enforce that parameters to llvm::format() are not totally unsafe" This reverts commit r283509, clang is hitting the assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283510 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/Format.h b/include/llvm/Support/Format.h index 026488cc70f..d5c301cd7e2 100644 --- a/include/llvm/Support/Format.h +++ b/include/llvm/Support/Format.h @@ -75,16 +75,6 @@ public: /// printed, this synthesizes the string into a temporary buffer provided and /// returns whether or not it is big enough. -// Helper to validate that format() parameters are scalars or pointers. -template struct validate_format_parameters; -template -struct validate_format_parameters { - static_assert(std::is_scalar::value, - "format can't be used with non fundamental / non pointer type"); - validate_format_parameters() { validate_format_parameters(); } -}; -template <> struct validate_format_parameters<> {}; - template class format_object final : public format_object_base { std::tuple Vals; @@ -101,9 +91,7 @@ class format_object final : public format_object_base { public: format_object(const char *fmt, const Ts &... vals) - : format_object_base(fmt), Vals(vals...) { - validate_format_parameters(); - } + : format_object_base(fmt), Vals(vals...) {} int snprint(char *Buffer, unsigned BufferSize) const override { return snprint_tuple(Buffer, BufferSize, index_sequence_for()); diff --git a/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp b/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp index 8197285b7b1..d53c8e38254 100644 --- a/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp +++ b/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp @@ -962,8 +962,7 @@ void PPCVSXSwapRemoval::dumpSwapVector() { DEBUG(dbgs() << format("%6d", ID)); DEBUG(dbgs() << format("%6d", EC->getLeaderValue(ID))); DEBUG(dbgs() << format(" BB#%3d", MI->getParent()->getNumber())); - DEBUG(dbgs() << format(" %14s ", - TII->getName(MI->getOpcode()).str().c_str())); + DEBUG(dbgs() << format(" %14s ", TII->getName(MI->getOpcode()))); if (SwapVector[EntryIdx].IsLoad) DEBUG(dbgs() << "load ");