[llvm-commits] [llvm] r153979 - in /llvm/trunk: include/llvm/Support/YAMLParser.h lib/Support/YAMLParser.cpp
Matt Beaumont-Gay
matthewbg at google.com
Wed Apr 4 14:34:35 PDT 2012
Unfortunately, now -Wnon-virtual-dtor complains about the Node class
and each of its subclasses. We could fix this by adding a protected
destructor to each class. What do you think?
On Tue, Apr 3, 2012 at 16:36, Michael J. Spencer <bigcheesegs at gmail.com> wrote:
> Author: mspencer
> Date: Tue Apr 3 18:36:44 2012
> New Revision: 153979
>
> URL: http://llvm.org/viewvc/llvm-project?rev=153979&view=rev
> Log:
> Sorry about that. MSVC seems to accept just about any random string you give it ;/
>
> Modified:
> llvm/trunk/include/llvm/Support/YAMLParser.h
> llvm/trunk/lib/Support/YAMLParser.cpp
>
> Modified: llvm/trunk/include/llvm/Support/YAMLParser.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/YAMLParser.h?rev=153979&r1=153978&r2=153979&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/YAMLParser.h (original)
> +++ llvm/trunk/include/llvm/Support/YAMLParser.h Tue Apr 3 18:36:44 2012
> @@ -113,7 +113,6 @@
> };
>
> Node(unsigned int Type, OwningPtr<Document>&, StringRef Anchor);
> - virtual ~Node();
>
> /// @brief Get the value of the anchor attached to this node. If it does not
> /// have one, getAnchor().size() will be 0.
> @@ -208,25 +207,6 @@
> , SmallVectorImpl<char> &Storage) const;
> };
>
> -static bool getAs(const ScalarNode *SN, bool &Result) {
> - SmallString<4> Storage;
> - StringRef Value = SN->getValue(Storage);
> - if (Value == "true")
> - Result = true;
> - else if (Value == "false")
> - Result = false;
> - else
> - return false;
> - return true;
> -}
> -
> -template<class T>
> -typename enable_if_c<std::numeric_limits<T>::is_integer, bool>::type
> -getAs(const ScalarNode *SN, T &Result) {
> - SmallString<4> Storage;
> - return !SN->getValue(Storage).getAsInteger(0, Result);
> -}
> -
> /// @brief A key and value pair. While not technically a Node under the YAML
> /// representation graph, it is easier to treat them this way.
> ///
>
> Modified: llvm/trunk/lib/Support/YAMLParser.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/YAMLParser.cpp?rev=153979&r1=153978&r2=153979&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/YAMLParser.cpp (original)
> +++ llvm/trunk/lib/Support/YAMLParser.cpp Tue Apr 3 18:36:44 2012
> @@ -133,6 +133,7 @@
> }
> }
>
> +namespace llvm {
> template<>
> struct ilist_sentinel_traits<Token> {
> Token *createSentinel() const {
> @@ -163,6 +164,7 @@
>
> BumpPtrAllocator Alloc;
> };
> +}
>
> typedef ilist<Token> TokenQueueT;
>
> @@ -1564,8 +1566,6 @@
> SourceRange = SMRange(Start, Start);
> }
>
> -Node::~Node() {}
> -
> Token &Node::peekNext() {
> return Doc->peekNext();
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list