Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] 回复: 回复: 回复: editor still gray out the codes

hi, Mark

Yes, I define GBE_COMPILER_AVAILABLE macro in "Path and Symbols", and the value is 1.

Beignet code is simple

#ifdef GBE_COMPILER_AVAILABLE

#include "llvm/Config/llvm-config.h"

#include "llvm/IR/LLVMContext.h"

#include "llvm/IR/Module.h"

#include "llvm/IR/DataLayout.h"

#include "llvm-c/Linker.h"

#include "llvm-c/BitReader.h"

#include "llvm-c/BitWriter.h"

#include "llvm/Transforms/Utils/Cloning.h"

#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40

#include "llvm/Bitcode/BitcodeWriter.h"

#else

#include "llvm/Bitcode/ReaderWriter.h"

#endif /* LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40 */

#include "llvm/Support/raw_ostream.h"

#include "llvm/ADT/StringRef.h"

#include "llvm/Support/MemoryBuffer.h"

#include "llvm/Support/SourceMgr.h"

#include "llvm/IRReader/IRReader.h"

#endif


It is strange that the issue is gone after I add println in addMacroDefinition like following code:

private void addMacroDefinition(IIndexMacro macro) {

try {

final char[] expansionImage = macro.getExpansionImage();

if (expansionImage == null) {

// this is an undef

System.err.println("remove: " + String.valueOf(macro.getNameCharArray()) + " " + macro.getExpansion());

//System.err.println("remove: " + String.valueOf(macro.getNameCharArray()));

fMacroDictionary.remove(macro.getNameCharArray());

} else {


If I remove " "+macro.getExpansion(), the issue come back.

Thanks

Janboe


发件人: cdt-dev-bounces@xxxxxxxxxxx <cdt-dev-bounces@xxxxxxxxxxx> 代表 Mark B <marco.stornelli@xxxxxxxxx>
发送时间: 2019年7月3日 9:25
收件人: CDT General developers list.
主题: Re: [cdt-dev] 回复: 回复: editor still gray out the codes
 
1) did you define the macro assigning a value like 1?
2) did you define the macro in the correct section, i.e. c or c++?

Il mer 3 lug 2019, 18:20 叶 渊博 <janboe.ye@xxxxxxxxxxx> ha scritto:
hi,  All

Does anyone know what mean macro.getExpansionImage() return null?

Thanks

Janboe

发件人: cdt-dev-bounces@xxxxxxxxxxx <cdt-dev-bounces@xxxxxxxxxxx> 代表 叶 渊博 <janboe.ye@xxxxxxxxxxx>
发送时间: 2019年7月3日 2:50
收件人: CDT General developers list.
主题: [cdt-dev] 回复: editor still gray out the codes
 
Marc-Andre

I used CDT to index beignet project. I define GBE_COMPILER_AVAILABLE macro in "Path and Symbols",  but it does not work. After I debug cdt, this macro is defined at first and is removed in org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor.addMacroDefinition(IIndexMacro macro).

macro.getExpansionImage return null and it seems that pdom does not include this macro. Does you know the reason?

Thanks

Janboe

发件人: cdt-dev-bounces@xxxxxxxxxxx <cdt-dev-bounces@xxxxxxxxxxx> 代表 Marc-Andre Laperle <malaperle@xxxxxxxxx>
发送时间: 2019年7月2日 19:07
收件人: CDT General developers list.
主题: Re: [cdt-dev] editor still gray out the codes
 
Hi!

Perhaps you could create a bug on Bugzilla [1] with an example and we could try a few steps to troubleshoot.


Regards,
Marc-André

On Jul 2, 2019, at 11:43 AM, 叶 渊博 <janboe.ye@xxxxxxxxxxx> wrote:

hi, 

I meet a problem that CDT still grays out #ifdef codes when the macro is defined. How can I start to debug this issue?
Which function checks if the macro is defined or not?

Thanks

Janboe
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

Back to the top