[clang] [llvm] Triple: Forward declare Twine and remove include (PR #145685)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 25 21:46:01 PDT 2025


================
@@ -349,7 +350,12 @@ class Triple {
   /// triple fields unknown.
   Triple() = default;
 
+  LLVM_ABI explicit Triple(std::string &&Str);
+  explicit Triple(StringRef Str) : Triple(Str.str()) {}
+  explicit Triple(const char *Str) : Triple(std::string(Str)) {}
+  explicit Triple(const std::string &Str) : Triple(std::string(Str)) {}
----------------
MaskRay wrote:

With the StringRef overload, is `Triple(const std::string &Str)` still useful?

https://github.com/llvm/llvm-project/pull/145685


More information about the cfe-commits mailing list