From d04a8d4b33ff316ca4cf961e06c9e312eff8e64f Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 3 Dec 2012 16:50:05 +0000 Subject: Use the new script to sort the includes of every file under lib. Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/SourceMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Support/SourceMgr.cpp') diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp index e4e01be..6580137 100644 --- a/lib/Support/SourceMgr.cpp +++ b/lib/Support/SourceMgr.cpp @@ -13,10 +13,10 @@ // //===----------------------------------------------------------------------===// -#include "llvm/ADT/Twine.h" #include "llvm/Support/SourceMgr.h" -#include "llvm/Support/MemoryBuffer.h" #include "llvm/ADT/OwningPtr.h" +#include "llvm/ADT/Twine.h" +#include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/system_error.h" using namespace llvm; -- cgit v1.1 From 3ebe59c892051375623fea55e977ff559fdb3323 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Mon, 7 Jan 2013 19:00:49 +0000 Subject: Change SMRange to be half-open (exclusive end) instead of closed (inclusive) This is necessary not only for representing empty ranges, but for handling multibyte characters in the input. (If the end pointer in a range refers to a multibyte character, should it point to the beginning or the end of the character in a char array?) Some of the code in the asm parsers was already assuming this anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171765 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/SourceMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Support/SourceMgr.cpp') diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp index 6580137..6540319 100644 --- a/lib/Support/SourceMgr.cpp +++ b/lib/Support/SourceMgr.cpp @@ -304,7 +304,7 @@ void SMDiagnostic::print(const char *ProgName, raw_ostream &S, for (unsigned r = 0, e = Ranges.size(); r != e; ++r) { std::pair R = Ranges[r]; for (unsigned i = R.first, - e = std::min(R.second, (unsigned)LineContents.size())+1; i != e; ++i) + e = std::min(R.second, (unsigned)LineContents.size()); i != e; ++i) CaretLine[i] = '~'; } -- cgit v1.1