SourceMgr: make valid buffer IDs start from one
authorAlp Toker <alp@nuanti.com>
Sun, 6 Jul 2014 10:33:31 +0000 (10:33 +0000)
committerAlp Toker <alp@nuanti.com>
Sun, 6 Jul 2014 10:33:31 +0000 (10:33 +0000)
commit1508c820959f037578173981905b916ad8ba47d2
tree1d60f2cfa5d4605526415c98353a00ccc3e76c66
parent1a5e5e38147d165f148c1837993f87a055875bef
SourceMgr: make valid buffer IDs start from one

Use 0 for the invalid buffer instead of -1/~0 and switch to unsigned
representation to enable more idiomatic usage.

Also introduce a trivial SourceMgr::getMainFileID() instead of hard-coding 0/1
to identify the main file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212398 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/SourceMgr.h
lib/MC/MCContext.cpp
lib/MC/MCDwarf.cpp
lib/MC/MCParser/AsmParser.cpp
lib/MC/MCParser/DarwinAsmParser.cpp
lib/Support/SourceMgr.cpp
lib/TableGen/TGLexer.cpp
lib/TableGen/TGLexer.h
tools/llvm-mc/llvm-mc.cpp
utils/TableGen/CTagsEmitter.cpp