Changes the JSON parser to use the SourceMgr.

Diagnostics are now emitted via the SourceMgr and we use MemoryBuffer
for buffer management. Switched the code to make use of the trailing
'0' that MemoryBuffer guarantees where it makes sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147063 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Manuel Klimek
2011-12-21 18:16:39 +00:00
parent edae8e1e4d
commit 84cbb6f00d
4 changed files with 61 additions and 75 deletions

View File

@@ -41,7 +41,8 @@ void benchmark(llvm::TimerGroup &Group, llvm::StringRef Name,
llvm::Timer Parsing((Name + ": Parsing").str(), Group);
Parsing.startTimer();
llvm::JSONParser Parser(JSONText);
llvm::SourceMgr SM;
llvm::JSONParser Parser(JSONText, &SM);
if (!Parser.validate()) {
llvm::errs() << "Parsing error in JSON parser benchmark.\n";
exit(1);