This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 235102 - 5% inaccuracy in LLVM
Summary: 5% inaccuracy in LLVM
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on: 240929
Blocks:
  Show dependency tree
 
Reported: 2013-08-27 13:32 UTC by Vladimir Voskresensky
Modified: 2015-09-09 16:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
very draft patch to fix casts (22 failed unit tests, only works when all decls are in the same namespace) (81.77 KB, patch)
2014-01-23 12:10 UTC, petrk
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2013-08-27 13:32:13 UTC
a lot of unresolved identifiers in LLVM project
Comment 1 Vladimir Voskresensky 2013-08-27 15:14:19 UTC
#include "llvm/ADT/SmallVector.h"
#include "clang/Basic/LLVM.h"

namespace clang {

    void foo() {
        SmallVector<int, 5> v;
        v.push_back(5); // unresolved push_back
        v.size(); // unresolved size
    }

}
Comment 2 Vladimir Voskresensky 2013-08-27 15:21:26 UTC
more unresolved:
namespace clang {

    class MyVector : public SmallVector<double, 10> {
    public:
        bool IsSmallImpl() {
            return SmallVector::isSmall();
        }
    };
    
    void foo() {
        SmallVector<int, 5> v;
        v.push_back(5); // unresolved push_back
        v.size(); // unresolved size
        
        MyVector mv;
        if (mv.empty() || mv.IsSmallImpl()) { // unresolved empty
            SmallVector<float*, 5> cache;
            for (SmallVectorImpl<float*>::iterator
                I = cache.begin(), E = cache.end(); I != E; ++I) { // unresolved begin and end
                delete *I;
            }
        }
    }
}
Comment 3 Quality Engineering 2013-08-29 01:43:30 UTC
Integrated into 'main-silver', will be available in build *201308290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/2ca32bf55ae6
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixing #235102 - 5% inaccuracy in LLVM
- search in used declarations, moved antiLoop check into UsingDeclarationImpl from Resolver3
Comment 4 petrk 2014-01-23 12:10:08 UTC
Created attachment 144291 [details]
very draft patch to fix casts (22 failed unit tests, only works when all decls are in the same namespace)
Comment 5 Vladimir Voskresensky 2014-01-24 11:51:03 UTC
Top issues:
TOTAL for LLVM34:
8027 errors    4575307 lines    3326 files    1.75 errors per 1K lines

Statistics by message
     267   3%  Unable to resolve identifier size - SmallVector.size
     266   3%  Unable to resolve identifier push_back
     211   2%  Unable to resolve identifier getZExtValue  - <cast>
     194   2%  Unable to resolve identifier getSVal - IntrusiveRefCntPtr->
     160   1%  Unable to resolve identifier get - IntrusiveRefCntPtr->
     133   1%  Unable to resolve identifier empty - StringRef.empty
     130   1%  Unable to resolve identifier Writer
     125   1%  Unable to resolve identifier getElementType - <cast>
     117   1%  Unable to resolve identifier begin - SmallVector<...>.begin
     113   1%  Unable to resolve identifier end - SmallVector<...>.end
      94   1%  Unable to resolve identifier back - SmallVector<...>.back

Then from <cast> about 3000 or remaining 6000 errors
Comment 6 petrk 2014-01-26 16:24:44 UTC
Test case for unresolved methods from SmallVector.
============================================================
namespace A {
    struct AAA {
        int foo();
    };
    
}

namespace B {
    using namespace A;
}

namespace B {
    namespace C {
        AAA x;
        
        int function() {
            x.foo(); // foo is unresolved
        }
    }
}
=============================================================
Comment 7 Quality Engineering 2014-03-12 02:48:08 UTC
Integrated into 'main-silver', will be available in build *201403120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/114d890820e3
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixing for #235102 - 5% inaccuracy on LLVM
-- fixed some usings
Comment 8 petrk 2014-03-14 18:29:06 UTC
Next test case:
=================================
namespace XXX {
    struct AAA {
        struct BBB;
        int foo();
    };
}

using namespace XXX; 

struct AAA::BBB {
    int foo();
};

int XXX::AAA::foo() {
    BBB b;
    b.foo();
}
=================================
Comment 9 Quality Engineering 2014-03-15 06:08:12 UTC
Integrated into 'main-silver', will be available in build *201403150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/98933b57abaa
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixing #235102 - 5% inaccuracy in LLVM
Comment 10 Quality Engineering 2014-04-24 02:09:15 UTC
Integrated into 'releases/release80', will be available in build *201404240045* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/9a4995e92cd6
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixing for #235102 - 5% inaccuracy on LLVM
-- fixed some usings
(transplanted from 114d890820e3def911e7e18fc2cb14a276b592cc)
Comment 11 Quality Engineering 2014-07-22 02:33:47 UTC
Integrated into 'main-silver', will be available in build *201407220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/7143cc4d951d
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Additional fix for #235102 - 5% inaccuracy in LLVM
Comment 12 Alexander Simon 2015-09-09 16:43:40 UTC
There is no goal of issue.
There is no work on issue more then year.
Close as fixed.
Comment 13 Alexander Simon 2015-09-09 16:45:14 UTC
Last numbers is:
Number of analyzed contexts 2884774
Unresolved 10832 (0.38%) where MacroBased 7227 (0.25%) of 2884774 checkpoints [TemplateBased warnings 70 (0.00%), Builtin 81 (0.00%)]
Line count: 4634995, time 3248303 ms, 
speed 1426.90 lines/sec, 888.09 refs/sec