]> granicus.if.org Git - clang/commitdiff
Add #line to make the Visual Studio compiler happy.
authorSteve Naroff <snaroff@apple.com>
Wed, 21 Jan 2009 19:24:01 +0000 (19:24 +0000)
committerSteve Naroff <snaroff@apple.com>
Wed, 21 Jan 2009 19:24:01 +0000 (19:24 +0000)
Fixes <rdar://problem/6507668> clang ObjC rewriter: put #line statement at top of rewritten file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62706 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteObjC.cpp

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