[llvm-commits] [llvm] r151045 - in /llvm/trunk: include/llvm/ADT/Triple.h lib/Support/Triple.cpp
Chandler Carruth
chandlerc at gmail.com
Tue Feb 21 00:31:18 PST 2012
Author: chandlerc
Date: Tue Feb 21 02:31:18 2012
New Revision: 151045
URL: http://llvm.org/viewvc/llvm-project?rev=151045&view=rev
Log:
Clean up comments that I missed when changing the triple representation.
Somehow, I even missed the ones I wrote just the other day...
Thanks to Matt for the code review.
Modified:
llvm/trunk/include/llvm/ADT/Triple.h
llvm/trunk/lib/Support/Triple.cpp
Modified: llvm/trunk/include/llvm/ADT/Triple.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=151045&r1=151044&r2=151045&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h (original)
+++ llvm/trunk/include/llvm/ADT/Triple.h Tue Feb 21 02:31:18 2012
@@ -132,7 +132,8 @@
/// @name Constructors
/// @{
- /// \brief Default constructor produces an empty, invalid triple.
+ /// \brief Default constructor is the same as an empty string and leaves all
+ /// triple fields unknown.
Triple() : Data(), Arch(), Vendor(), OS(), Environment() {}
explicit Triple(const Twine &Str);
Modified: llvm/trunk/lib/Support/Triple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=151045&r1=151044&r2=151045&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Triple.cpp (original)
+++ llvm/trunk/lib/Support/Triple.cpp Tue Feb 21 02:31:18 2012
@@ -292,10 +292,8 @@
/// \brief Construct a triple from the string representation provided.
///
-/// This doesn't actually parse the string representation eagerly. Instead it
-/// stores it, and tracks the fact that it hasn't been parsed. The first time
-/// any of the structural queries are made, the string is parsed and the
-/// results cached in various members.
+/// This stores the string representation and parses the various pieces into
+/// enum members.
Triple::Triple(const Twine &Str)
: Data(Str.str()),
Arch(ParseArch(getArchName())),
@@ -307,9 +305,9 @@
/// \brief Construct a triple from string representations of the architecture,
/// vendor, and OS.
///
-/// This doesn't actually use these already distinct strings to setup the
-/// triple information. Instead it joins them into a canonical form of a triple
-/// string, and lazily parses it on use.
+/// This joins each argument into a canonical string representation and parses
+/// them into enum members. It leaves the environment unknown and omits it from
+/// the string representation.
Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr)
: Data((ArchStr + Twine('-') + VendorStr + Twine('-') + OSStr).str()),
Arch(ParseArch(ArchStr.str())),
@@ -321,9 +319,8 @@
/// \brief Construct a triple from string representations of the architecture,
/// vendor, OS, and environment.
///
-/// This doesn't actually use these already distinct strings to setup the
-/// triple information. Instead it joins them into a canonical form of a triple
-/// string, and lazily parses it on use.
+/// This joins each argument into a canonical string representation and parses
+/// them into enum members.
Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
const Twine &EnvironmentStr)
: Data((ArchStr + Twine('-') + VendorStr + Twine('-') + OSStr + Twine('-') +
More information about the llvm-commits
mailing list