Add #line to make the Visual Studio compiler happy.

Fixes <rdar://problem/6507668> clang ObjC rewriter: put #line statement at top of rewritten file

llvm-svn: 62706
This commit is contained in:
Steve Naroff 2009-01-21 19:24:01 +00:00
parent 1d09218b98
commit 050dd11e90
1 changed files with 2 additions and 1 deletions

View File

@ -456,10 +456,11 @@ void RewriteObjC::Initialize(ASTContext &context) {
Rewrite.setSourceMgr(Context->getSourceManager()); Rewrite.setSourceMgr(Context->getSourceManager());
Preamble = "#line 2\n";
// declaring objc_selector outside the parameter list removes a silly // declaring objc_selector outside the parameter list removes a silly
// scope related warning... // scope related warning...
if (IsHeader) if (IsHeader)
Preamble = "#pragma once\n"; Preamble += "#pragma once\n";
Preamble += "struct objc_selector; struct objc_class;\n"; Preamble += "struct objc_selector; struct objc_class;\n";
Preamble += "struct __rw_objc_super { struct objc_object *object; "; Preamble += "struct __rw_objc_super { struct objc_object *object; ";
Preamble += "struct objc_object *superClass; "; Preamble += "struct objc_object *superClass; ";