[cfe-commits] r39794 - in /cfe/trunk: CodeGen/CGExpr.cpp clang.xcodeproj/project.pbxproj test/Makefile

Chris Lattner sabre at nondot.org
Thu Jul 12 20:25:54 PDT 2007


Author: lattner
Date: Thu Jul 12 22:25:53 2007
New Revision: 39794

URL: http://llvm.org/viewvc/llvm-project?rev=39794&view=rev
Log:
"Someone typed "PtrToInt" where they meant "IntToPtr".

I've added a tests/CodeGen directory, and a test for this case that
used to fail and now passes."

Patch by Keith Bauer


Modified:
    cfe/trunk/CodeGen/CGExpr.cpp
    cfe/trunk/clang.xcodeproj/project.pbxproj
    cfe/trunk/test/Makefile

Modified: cfe/trunk/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExpr.cpp?rev=39794&r1=39793&r2=39794&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/CodeGen/CGExpr.cpp Thu Jul 12 22:25:53 2007
@@ -97,7 +97,7 @@
     if (isa<llvm::PointerType>(Val.getVal()->getType()))
       return RValue::get(Builder.CreateBitCast(Val.getVal(), DestTy, "conv"));
     assert(ValTy->isIntegerType() && "Not ptr->ptr or int->ptr conversion?");
-    return RValue::get(Builder.CreatePtrToInt(Val.getVal(), DestTy, "conv"));
+    return RValue::get(Builder.CreateIntToPtr(Val.getVal(), DestTy, "conv"));
   }
   
   if (isa<PointerType>(ValTy)) {

Modified: cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=39794&r1=39793&r2=39794&view=diff

==============================================================================
--- cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/trunk/clang.xcodeproj/project.pbxproj Thu Jul 12 22:25:53 2007
@@ -189,7 +189,7 @@
 		1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LiteralSupport.cpp; sourceTree = "<group>"; };
 		84D9A8870C1A57E100AC7ABC /* AttributeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AttributeList.cpp; path = Parse/AttributeList.cpp; sourceTree = "<group>"; };
 		84D9A88B0C1A581300AC7ABC /* AttributeList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AttributeList.h; path = clang/Parse/AttributeList.h; sourceTree = "<group>"; };
-		8DD76F6C0486A84900D96B5E /* clang */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = clang; sourceTree = BUILT_PRODUCTS_DIR; };
+		8DD76F6C0486A84900D96B5E /* clang */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = clang; sourceTree = BUILT_PRODUCTS_DIR; };
 		DE01DA480B12ADA300AC22CE /* PPCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PPCallbacks.h; sourceTree = "<group>"; };
 		DE06756B0C051CFE00EBBFD8 /* ParseExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ParseExprCXX.cpp; path = Parse/ParseExprCXX.cpp; sourceTree = "<group>"; };
 		DE06B73D0A8307640050E87E /* LangOptions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LangOptions.h; sourceTree = "<group>"; };

Modified: cfe/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Makefile?rev=39794&r1=39793&r2=39794&view=diff

==============================================================================
--- cfe/trunk/test/Makefile (original)
+++ cfe/trunk/test/Makefile Thu Jul 12 22:25:53 2007
@@ -1,3 +1,3 @@
 
 all:
-	find Lexer Preprocessor Parser \( -name '*.c' -or -name '*.cpp' \) -print -exec ./TestRunner.sh {} \;
+	find CodeGen Lexer Preprocessor Parser \( -name '*.c' -or -name '*.cpp' \) -print -exec ./TestRunner.sh {} \;





More information about the cfe-commits mailing list