Explorar o código

Added back the "wantsDIForwardDecl = false" for LLVM

Not having this extra type information was causing types like enums to come out as 'void' in debug information due to (seemingly) an LLVM bug with forward decls
Brian Fiete %!s(int64=5) %!d(string=hai) anos
pai
achega
939c818581
Modificáronse 3 ficheiros con 18 adicións e 7 borrados
  1. 4 3
      IDEHelper/Compiler/BfIRBuilder.cpp
  2. 13 3
      IDEHelper/DbgModule.cpp
  3. 1 1
      IDEHelper/Debugger.cpp

+ 4 - 3
IDEHelper/Compiler/BfIRBuilder.cpp

@@ -1887,9 +1887,10 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine)
 			
 	// Types that don't have a proper 'defining module' need to be defined in every module they are used	
 	bool wantsDIForwardDecl = (type->GetModule() != mModule) && (!type->IsFunction());
-	// Forward declarations of valuetypes doesn't work in LLVM backend for Win32.....
-//  	if ((!mIsBeefBackend) && (type->IsValueType()))
-//  		wantsDIForwardDecl = false;
+	// Forward declarations of valuetypes don't work in LLVM backend for Win32.....
+	//TODO: Why was this commented out?
+  	if ((!mIsBeefBackend) && (type->IsValueType()))
+  		wantsDIForwardDecl = false;
 	if (mModule->mExtensionCount != 0)
 		wantsDIForwardDecl = true;
 	if (forceDbgDefine)

+ 13 - 3
IDEHelper/DbgModule.cpp

@@ -1663,8 +1663,7 @@ void DbgType::ToString(StringImpl& str, DbgLanguage language, bool allowDirectBf
 			}
 			return;
 		}
-
-		char* nameP = (char*)mTypeName;
+		
 		//String combName;
 		/*if (mTemplateParams != NULL)
 		{
@@ -1677,6 +1676,7 @@ void DbgType::ToString(StringImpl& str, DbgLanguage language, bool allowDirectBf
 		{
 			FixName();
 		}		
+		char* nameP = (char*)mTypeName;
 
 		if (parent == NULL)
 		{
@@ -2285,7 +2285,17 @@ void DbgModule::Fail(const StringImpl& error)
 			*mFailMsgPtr = error;
 	}
 
-	mDebugger->OutputRawMessage("error " + error + "\n");
+	String errorStr = "error ";
+	if (!mFilePath.IsEmpty())
+	{
+		errorStr += "Error in ";
+		errorStr += mFilePath;
+		errorStr += ": ";
+	}
+	errorStr += error;	
+	errorStr += "\n";
+
+	mDebugger->OutputRawMessage(errorStr);
 	mFailed = true;
 }
 

+ 1 - 1
IDEHelper/Debugger.cpp

@@ -5,7 +5,7 @@
 USING_NS_BF;
 
 DbgModuleMemoryCache::DbgModuleMemoryCache(uintptr addr, int size)
-{
+{	
 	mAddr = addr;
 	mSize = size;