File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 22
22
#include " clang/Sema/Sema.h"
23
23
#include " clang/Sema/SemaDiagnostic.h"
24
24
25
+ // Implements the CValueExtractionPrinter interface.
26
+ extern " C" {
27
+ CLING_LIB_EXPORT
28
+ void cling_SetValueNoAlloc (void * /* cling::Value* V*/ ) {}
29
+ CLING_LIB_EXPORT
30
+ void cling_SetValueWithAlloc (void * /* cling::Value* V*/ ) {}
31
+ }
32
+
25
33
using namespace clang ;
26
34
27
35
namespace cling {
@@ -436,6 +444,10 @@ namespace {
436
444
return VSError (m_Sema, E, " cling::runtime::gCling" );
437
445
if (!(NSD = utils::Lookup::Namespace (m_Sema, " internal" , NSD)))
438
446
return VSError (m_Sema, E, " cling::runtime::internal namespace" );
447
+ } else {
448
+ // C, ObjC,...
449
+ if (!(NSD = utils::Lookup::Namespace (m_Sema, " cling" )))
450
+ return VSError (m_Sema, E, " cling namespace" );
439
451
}
440
452
LookupResult R (*m_Sema, &m_Context->Idents .get (" setValueNoAlloc" ),
441
453
SourceLocation (), Sema::LookupOrdinaryName,
Original file line number Diff line number Diff line change 11
11
12
12
// Validate cling C mode.
13
13
14
- // Fix value printing!
15
-
16
14
int printf (const char * ,...);
17
15
printf ("CHECK 123 %p\n" , gCling ); // CHECK: CHECK 123
18
16
19
- 12 // expected-error {{ValueExtractionSynthesizer could not find: 'cling::runtime::internal::setValueNoAlloc'.}}
20
-
21
- 32 // expected-error {{ValueExtractionSynthesizer could not find: 'cling::runtime::internal::setValueNoAlloc'.}}
17
+ int i = 1 // CHECK: (int) 1
18
+ sizeof (int ) // CHECK: (unsigned long) 4
19
+ int x = sizeof (int );
20
+ printf ("CHECK %d\n" , x ); // CHECK: CHECK 4
22
21
22
+ // expected-no-diagnostics
23
23
.q
You can’t perform that action at this time.
0 commit comments