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)
commita55b95b58ad8f2d474564eefd3815759c5a0d1c2
tree8b595a435702695b569fbd488a734b462e71cad7
parent54cc62740f8abe1ac69c664e006c22bea5c4957b
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.

llvm-svn: 212398
llvm/include/llvm/Support/SourceMgr.h
llvm/lib/MC/MCContext.cpp
llvm/lib/MC/MCDwarf.cpp
llvm/lib/MC/MCParser/AsmParser.cpp
llvm/lib/MC/MCParser/DarwinAsmParser.cpp
llvm/lib/Support/SourceMgr.cpp
llvm/lib/TableGen/TGLexer.cpp
llvm/lib/TableGen/TGLexer.h
llvm/tools/llvm-mc/llvm-mc.cpp
llvm/utils/TableGen/CTagsEmitter.cpp